LCOV - code coverage report
Current view: top level - source/ao/analysis - aoPSDs.cpp (source / functions) Coverage Total Hit
Test: mxlib Lines: 60.0 % 20 12
Test Date: 2026-08-30 22:23:37 Functions: 100.0 % 2 2

            Line data    Source code
       1              : /** \file aoPSDs.cpp
       2              :  * \author Jared R. Males (jaredmales@gmail.com)
       3              :  * \brief Implementation of spatial power spectra used in adaptive optics.
       4              :  * \ingroup mxAO_files
       5              :  *
       6              :  */
       7              : 
       8              : //***********************************************************************//
       9              : // Copyright 2021 Jared R. Males (jaredmales@gmail.com)
      10              : //
      11              : // This file is part of mxlib.
      12              : //
      13              : // mxlib is free software: you can redistribute it and/or modify
      14              : // it under the terms of the GNU General Public License as published by
      15              : // the Free Software Foundation, either version 3 of the License, or
      16              : // (at your option) any later version.
      17              : //
      18              : // mxlib is distributed in the hope that it will be useful,
      19              : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      20              : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      21              : // GNU General Public License for more details.
      22              : //
      23              : // You should have received a copy of the GNU General Public License
      24              : // along with mxlib.  If not, see <http://www.gnu.org/licenses/>.
      25              : //***********************************************************************//
      26              : 
      27              : #include "ao/analysis/aoPSDs.hpp"
      28              : 
      29              : namespace mx
      30              : {
      31              : namespace AO
      32              : {
      33              : namespace analysis
      34              : {
      35              : 
      36              : namespace PSDComponent
      37              : {
      38              : 
      39           15 : std::string compName( int cc )
      40              : {
      41           15 :     if( cc == phase )
      42           30 :         return "phase";
      43            0 :     if( cc == amplitude )
      44            0 :         return "amplitude";
      45            0 :     if( cc == dispPhase )
      46            0 :         return "dispPhase";
      47            0 :     if( cc == dispAmplitude )
      48            0 :         return "dispAmplitude";
      49              : 
      50            0 :     return "unknown";
      51              : }
      52              : 
      53           14 : int compNum( const std::string &name )
      54              : {
      55           14 :     if( name == "phase" )
      56           11 :         return phase;
      57            3 :     else if( name == "amplitude" )
      58            1 :         return amplitude;
      59            2 :     else if( name == "dispPhase" )
      60            1 :         return dispPhase;
      61            1 :     else if( name == "dispAmplitude" )
      62            1 :         return dispAmplitude;
      63              : 
      64            0 :     return -1;
      65              : }
      66              : 
      67              : } // namespace PSDComponent
      68              : 
      69              : template struct vonKarmanSpectrum<float>;
      70              : 
      71              : template struct vonKarmanSpectrum<double>;
      72              : 
      73              : template struct vonKarmanSpectrum<long double>;
      74              : 
      75              : #ifdef HASQUAD
      76              : template struct vonKarmanSpectrum<__float128>;
      77              : #endif
      78              : 
      79              : } // namespace analysis
      80              : } // namespace AO
      81              : } // namespace mx
        

Generated by: LCOV version 2.0-1