mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
wavefront.hpp
1 
2 
3 
4 #ifndef wavefront_hpp
5 #define wavefront_hpp
6 
7 #pragma GCC system_header
8 #include <Eigen/Dense>
9 
10 #include "../../wfp/imagingArray.hpp"
11 #include "../../wfp/imagingUtils.hpp"
12 
13 
14 namespace mx
15 {
16 namespace AO
17 {
18 namespace sim
19 {
20 
21 ///Structure containing the phase and amplitude of a wavefront
22 /** The phase and amplitude are stored separately in real valued arrays.
23  */
24 template<typename _realT>
25 struct wavefront
26 {
27  ///The floating point type used for all calculations
28  typedef _realT realT;
29 
30  ///The data type of the real image, used to hold the phase and amplitude
31  typedef Eigen::Array<_realT, Eigen::Dynamic, Eigen::Dynamic> realImageT;
32 
33  ///The wavefront data type
34  typedef wfp::imagingArray<std::complex<realT>, wfp::fftwAllocator<std::complex<realT> >, 0> complexAmplitudeT;
35 
36  ///The wavefront amplitude
38 
39  ///The wavefront phase
41 
42  ///The wavelength at which the wavefront is specified
44 
45  ///The iteration number of this wavefront
47 
48  ///Zero the wavefront
49  void setZero()
50  {
51  amplitude.setZero();
52  phase.setZero();
53  }
54 
55  void setAmplitude(const realImageT & amp)
56  {
57  amplitude = amp;
58  }
59 
60  void setPhase(const realImageT & ph)
61  {
62  phase = ph;
63  }
64 
65  void getWavefront(complexAmplitudeT & wf, int wfSz)
66  {
68  }
69 
70  void getWavefront( complexAmplitudeT & wf,
71  realT dlambda,
72  int wfSz
73  )
74  {
75  realImageT dphase = phase*(lambda/dlambda);
76  wfp::makeComplexPupil( wf, amplitude, dphase, wfSz);
77  }
78 
79 
80 
81 };
82 
83 } //namespace sim
84 } //namespace AO
85 } //namespace mx
86 
87 
88 #endif
89 
void makeComplexPupil(arrayOutT &complexPupil, const arrayInT &realPupil, int wavefrontSizePixels)
Create a complex pupil plane wavefront from a real amplitude mask.
The mxlib c++ namespace.
Definition: mxError.hpp:107
Structure containing the phase and amplitude of a wavefront
Definition: wavefront.hpp:26
realT lambda
The wavelength at which the wavefront is specified.
Definition: wavefront.hpp:43
realImageT amplitude
The wavefront amplitude.
Definition: wavefront.hpp:37
Eigen::Array< _realT, Eigen::Dynamic, Eigen::Dynamic > realImageT
The data type of the real image, used to hold the phase and amplitude.
Definition: wavefront.hpp:31
void setZero()
Zero the wavefront.
Definition: wavefront.hpp:49
_realT realT
The floating point type used for all calculations.
Definition: wavefront.hpp:28
realT iterNo
The iteration number of this wavefront.
Definition: wavefront.hpp:46
realImageT phase
The wavefront phase.
Definition: wavefront.hpp:40
wfp::imagingArray< std::complex< realT >, wfp::fftwAllocator< std::complex< realT > >, 0 > complexAmplitudeT
The wavefront data type.
Definition: wavefront.hpp:34