mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
jincFuncs.hpp
Go to the documentation of this file.
1 /** \file jincFuncs.hpp
2  * \author Jared R. Males (jaredmales@gmail.com)
3  * \brief The +/- Jinc functions for analyzing contrast
4  * \ingroup mxAO_files
5  *
6  */
7 
8 #ifndef jincFuncs_hpp
9 #define jincFuncs_hpp
10 
11 #include "../../math/constants.hpp"
12 #include "../../math/func/jinc.hpp"
13 
14 namespace mx
15 {
16 namespace AO
17 {
18 namespace analysis
19 {
20 
21 /// The +/- Jinc functions for analyzing contrast
22 /** See Males and Guyon
23  *
24  */
25 template<typename realT>
26 int jincFuncs( realT & Jp, ///< [out]
27  realT & Jm, ///< [out]
28  int mpos, ///< [in]
29  int npos, ///< [in]
30  int mmode, ///< [in]
31  int nmode ///< [in]
32  )
33 {
34  realT ku = mpos;
35  realT kv = npos;
36 
37  realT kp = sqrt( pow(ku + mmode,2) + pow(kv + nmode,2) );
38  realT km = sqrt( pow(ku - mmode,2) + pow(kv - nmode,2) );
39 
40  Jp = math::func::jinc(math::pi<realT>()*kp);
41 
42  Jm = math::func::jinc(math::pi<realT>()*km);
43 
44  return 0;
45 }
46 
47 
48 
49 
50 } //namespace analysis
51 } //namespace AO
52 } //namespace mx
53 
54 #endif //jincFuncs_hpp
T jinc(const T &x)
The Jinc function.
Definition: jinc.hpp:64
int jincFuncs(realT &Jp, realT &Jm, int mpos, int npos, int mmode, int nmode)
The +/- Jinc functions for analyzing contrast.
Definition: jincFuncs.hpp:26
The mxlib c++ namespace.
Definition: mxError.hpp:107