mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Class to perform Fraunhofer propagation between pupil and focal planes.
This class uses the FFT to propagate between planes, and normalizes so that flux is conserved. For propagation from pupil to focal plane, the pupil wavefront is tilted so that the focal-plane image is centered at the geometric center of the array. After propagation from focal plane to pupil plane, the pupil plane wavefront is un-tilted to restore the pupil to its original position.
_wavefrontT | is an Eigen::Array-like type, with std::complex values. |
Definition at line 56 of file fraunhoferPropagator.hpp.
#include <wfp/fraunhoferPropagator.hpp>
Public Types | |
typedef _wavefrontT | wavefrontT |
The wavefront data type. More... | |
typedef wavefrontT::Scalar | complexT |
The complex data type. More... | |
typedef wavefrontT::Scalar::value_type | realT |
The real data type. More... | |
Public Member Functions | |
fraunhoferPropagator () | |
Constructor. More... | |
~fraunhoferPropagator () | |
Destructor. More... | |
int | wholePixel () |
Get the value of the wholePixel parameter. More... | |
void | wholePixel (realT wp) |
Set the value of the wholePixel parameter. More... | |
void | shiftPupil (wavefrontT &complexPupil) |
Apply the shift to a pupil wavefront which will center the resultant focal plane image, and apply the normalization. More... | |
void | unshiftPupil (wavefrontT &complexPupil) |
Apply the shift to a pupil wavefront which will restore it to a centered pupil image, with correct flux. More... | |
void | propagatePupilToFocal (wavefrontT &complexFocal, wavefrontT &complexPupil, bool doCenter=true) |
Propagate the wavefront from the pupil plane to the focal plane. More... | |
void | propagateFocalToPupil (wavefrontT &complexPupil, wavefrontT &complexFocal, bool doCenter=true) |
Propagate the wavefront from Focal plane to Pupil plane. More... | |
void | setWavefrontSizePixels (int wfsPix) |
Set the size of the wavefront, in pixels. More... | |
Protected Member Functions | |
void | initialize () |
Initialize members. More... | |
void | makeShiftPhase () |
Calculate the complex tilt arrays for centering and normalizing the wavefronts. More... | |
Protected Attributes | |
int | m_wavefrontSizePixels {0} |
The size of the wavefront in pixels. More... | |
realT | m_xcen {0} |
x-coordinate of focal plane center, in pixels More... | |
realT | m_ycen {0} |
x-coordinate of focal plane center, in pixels More... | |
realT | m_wholePixel {0} |
Determines how the image is centered. More... | |
wavefrontT | m_centerFocal |
Phase screen for tilting the pupil plane so that the focal plane image is centered. More... | |
wavefrontT | m_centerPupil |
Phase screen for un-tilting the pupil plane after propagating from a centered focal plane. More... | |
math::fft::fftT< complexT, complexT, 2, 0 > | m_fft_fwd |
FFT object for forward FFTs. More... | |
math::fft::fftT< complexT, complexT, 2, 0 > | m_fft_back |
FFT object for backward FFTs. More... | |
typedef wavefrontT::Scalar mx::wfp::fraunhoferPropagator< _wavefrontT >::complexT |
The complex data type.
Definition at line 65 of file fraunhoferPropagator.hpp.
typedef wavefrontT::Scalar::value_type mx::wfp::fraunhoferPropagator< _wavefrontT >::realT |
The real data type.
Definition at line 68 of file fraunhoferPropagator.hpp.
typedef _wavefrontT mx::wfp::fraunhoferPropagator< _wavefrontT >::wavefrontT |
The wavefront data type.
Definition at line 62 of file fraunhoferPropagator.hpp.
mx::wfp::fraunhoferPropagator< wavefrontT >::fraunhoferPropagator |
Constructor.
Definition at line 177 of file fraunhoferPropagator.hpp.
mx::wfp::fraunhoferPropagator< wavefrontT >::~fraunhoferPropagator |
Destructor.
Definition at line 182 of file fraunhoferPropagator.hpp.
|
protected |
Initialize members.
Definition at line 168 of file fraunhoferPropagator.hpp.
|
protected |
Calculate the complex tilt arrays for centering and normalizing the wavefronts.
Host memory to build the shift screens
Definition at line 265 of file fraunhoferPropagator.hpp.
References mx::math::pi().
void mx::wfp::fraunhoferPropagator< wavefrontT >::propagateFocalToPupil | ( | wavefrontT & | complexPupil, |
wavefrontT & | complexFocal, | ||
bool | doCenter = true |
||
) |
Propagate the wavefront from Focal plane to Pupil plane.
After the fourier transform, the output pupil plane wavefront is de-tilted, restoring it to the state prior to calling propagatePupilToFocal. This can be prevented by setting doCenter to false.
[out] | complexPupil | the pupil plane wavefront. Must be pre-allocated to same size as complexFocal. |
[in] | complexFocal | the focal plane wavefront. |
[in] | doCenter | [optional] set to false to not apply the centering shift |
Definition at line 231 of file fraunhoferPropagator.hpp.
void mx::wfp::fraunhoferPropagator< wavefrontT >::propagatePupilToFocal | ( | wavefrontT & | complexFocal, |
wavefrontT & | complexPupil, | ||
bool | doCenter = true |
||
) |
Propagate the wavefront from the pupil plane to the focal plane.
The pupil plane wavefront (complexPupil) is multiplied by a tilt to place the image in the geometric center of the focal plane. This can be prevented by setting doCenter to false.
[out] | complexFocal | the focal plane wavefront. Must be pre-allocated to same size as complexPupil. |
[in] | complexPupil | the pupil plane wavefront. Modified due to application of centering tilt. |
[in] | doCenter | [optional] set to false to not apply the centering shift |
Definition at line 215 of file fraunhoferPropagator.hpp.
void mx::wfp::fraunhoferPropagator< wavefrontT >::setWavefrontSizePixels | ( | int | wfsPix | ) |
Set the size of the wavefront, in pixels.
Checks if the size changes, does nothing if no change. Otherwise, calls makeShiftPhase to pre-calculate the tilt arrays and plans the FFTs.
[in] | wfsPix | the desired new size of the wavefront |
Definition at line 247 of file fraunhoferPropagator.hpp.
void mx::wfp::fraunhoferPropagator< wavefrontT >::shiftPupil | ( | wavefrontT & | complexPupil | ) |
Apply the shift to a pupil wavefront which will center the resultant focal plane image, and apply the normalization.
You must have allocated the shift screens first, by calling propagatePupilToFocal, propagateFocalToPupil, or setWavefrontSizePixels.
complexPupil | [in.out] the complex pupil plane wavefront to shift |
Definition at line 203 of file fraunhoferPropagator.hpp.
void mx::wfp::fraunhoferPropagator< wavefrontT >::unshiftPupil | ( | wavefrontT & | complexPupil | ) |
Apply the shift to a pupil wavefront which will restore it to a centered pupil image, with correct flux.
You must have allocated the shift screens first, by calling propagatePupilToFocal, propagateFocalToPupil, or setWavefrontSizePixels.
complexPupil | [in.out] the complex pupil plane wavefront to shift |
Definition at line 209 of file fraunhoferPropagator.hpp.
int mx::wfp::fraunhoferPropagator< wavefrontT >::wholePixel |
Get the value of the wholePixel parameter.
The wholePixel parameter determines how the image is centered. If 0 (default) it is at 0.5*(wfSz-1), if true it is shifted by 0.5*m_wholePixel in each axis.
Definition at line 187 of file fraunhoferPropagator.hpp.
void mx::wfp::fraunhoferPropagator< wavefrontT >::wholePixel | ( | realT | wp | ) |
Set the value of the wholePixel parameter.
The wholePixel parameter determines how the image is centered. If 0 (default) it is at 0.5*(wfSz-1), if true it is shifted by 0.5*m_wholePixel in each axis.
[in] | wp | the new wholePixel value |
Definition at line 193 of file fraunhoferPropagator.hpp.
|
protected |
Phase screen for tilting the pupil plane so that the focal plane image is centered.
Definition at line 84 of file fraunhoferPropagator.hpp.
|
protected |
Phase screen for un-tilting the pupil plane after propagating from a centered focal plane.
Definition at line 87 of file fraunhoferPropagator.hpp.
|
protected |
FFT object for backward FFTs.
Definition at line 93 of file fraunhoferPropagator.hpp.
|
protected |
FFT object for forward FFTs.
Definition at line 90 of file fraunhoferPropagator.hpp.
|
protected |
The size of the wavefront in pixels.
Definition at line 73 of file fraunhoferPropagator.hpp.
|
protected |
Determines how the image is centered.
If 0 (default) it is at 0.5*(wfSz-1), if true it is shifted by 0.5*m_wholePixel in each axis.
Definition at line 81 of file fraunhoferPropagator.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 75 of file fraunhoferPropagator.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 76 of file fraunhoferPropagator.hpp.