mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
wfsNoisePSD.hpp
Go to the documentation of this file.
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 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  realT snr2 = pow(Fg*tau,2) / (Fg*tau + npx*Fb*tau + npx*ron*ron);
36 
37  realT psd = 2*pow(beta_p_k,2)/snr2 * tau;
38 
39  for(size_t i=0; i< PSD.size(); ++i)
40  {
41  PSD[i] = psd;
42  }
43 }
44 
45 } //namespace analysis
46 } //namespace AO
47 } //namespace mx
48 
49 #endif //__wfsNoisePSD_hpp__
50 
void wfsNoisePSD(std::vector< realT > &PSD, realT beta_p_k, realT Fg, realT tau, realT npx, realT Fb, realT ron)
Populate a vector with the PSD of measurement noise given WFS parameters.
Definition: wfsNoisePSD.hpp:25
The mxlib c++ namespace.
Definition: mxError.hpp:107