LCOV - code coverage report
Current view: top level - include/ao/analysis - wfsNoisePSD.hpp (source / functions) Coverage Total Hit
Test: mxlib Lines: 0.0 % 6 0
Test Date: 2026-08-30 22:23:37 Functions: 0.0 % 1 0

            Line data    Source code
       1              : /** \file wfsNoisePSD.hpp
       2              :  * \author Jared R. Males (jaredmales@gmail.com)
       3              :  * \brief Declares and defines a function to calculate the measurement noise PSD
       4              :  * \ingroup mxAO_files
       5              :  *
       6              :  */
       7              : 
       8              : #ifndef __wfsNoisePSD_hpp__
       9              : #define __wfsNoisePSD_hpp__
      10              : 
      11              : namespace mx
      12              : {
      13              : namespace AO
      14              : {
      15              : namespace analysis
      16              : {
      17              : 
      18              : /// Populate a vector with the PSD of measurement noise given WFS parameters.
      19              : /**
      20              :  * \tparam realT is the real floating point type for calculations
      21              :  *
      22              :  * \ingroup mxAOAnalytic
      23              :  */
      24              : template <typename realT>
      25            0 : void wfsNoisePSD( std::vector<realT> &PSD, ///< [out] A pre-allocated vector which will be filled with the PSD value.
      26              :                   realT beta_p_k, ///< [in] The WFS \f$ \beta_p \f$ parameter (see Guyon, 2005 \cite guyon_2005).
      27              :                   realT Fg,       ///< [in] Total photons/sec used by the WFS
      28              :                   realT tau,      ///< [in] WFS Integration time [sec]
      29              :                   realT npx,      ///< [in] Number of pixesl used by the WFS
      30              :                   realT Fb,       ///< [in] Background flux, in photons/sec/pixel.
      31              :                   realT ron       ///< [in] Readout noise, in photons/pixel/read.
      32              : )
      33              : {
      34              : 
      35            0 :     realT snr2 = pow( Fg * tau, 2 ) / ( Fg * tau + npx * Fb * tau + npx * ron * ron );
      36              : 
      37            0 :     realT psd = 2 * pow( beta_p_k, 2 ) / snr2 * tau;
      38              : 
      39            0 :     for( size_t i = 0; i < PSD.size(); ++i )
      40              :     {
      41            0 :         PSD[i] = psd;
      42              :     }
      43            0 : }
      44              : 
      45              : } // namespace analysis
      46              : } // namespace AO
      47              : } // namespace mx
      48              : 
      49              : #endif //__wfsNoisePSD_hpp__
        

Generated by: LCOV version 2.0-1