|
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 88 of file fraunhoferPropagator.hpp.
#include <wfp/fraunhoferPropagator.hpp>
Public Types | |
| typedef _wavefrontT | wavefrontT |
| The wavefront data type. | |
| typedef wavefrontT::Scalar | complexT |
| The complex data type. | |
| typedef wavefrontT::Scalar::value_type | realT |
| The real data type. | |
| typedef fraunhoferPropagatorArrayT< wavefrontT, cudaGPU >::arrayT | arrayT |
| The array data type. | |
Public Member Functions | |
| fraunhoferPropagator () | |
| Constructor. | |
| ~fraunhoferPropagator () | |
| Destructor. | |
| int | wholePixel () |
| Get the value of the wholePixel parameter. | |
| void | wholePixel (realT wp) |
| Set the value of the wholePixel parameter. | |
| template<int ccudaGPU = cudaGPU> | |
| error_t | shiftPupil (arrayT &complexPupil, typename std::enable_if< ccudaGPU==0 >::type *=0) |
| Apply the shift to a pupil wavefront and apply the normalization. | |
| template<int ccudaGPU = cudaGPU> | |
| error_t | shiftPupil (arrayT &complexPupil, typename std::enable_if< ccudaGPU==1 >::type *=0) |
| Apply the shift to a pupil wavefront and apply the normalization. | |
| template<int ccudaGPU = cudaGPU> | |
| error_t | unshiftPupil (arrayT &complexPupil, typename std::enable_if< ccudaGPU==0 >::type *=0) |
| Apply the shift to a pupil wavefront which will restore it to a centered pupil image, with correct flux. | |
| template<int ccudaGPU = cudaGPU> | |
| error_t | unshiftPupil (arrayT &complexPupil, typename std::enable_if< ccudaGPU==1 >::type *=0) |
| Apply the shift to a pupil wavefront which will restore it to a centered pupil image, with correct flux. | |
| error_t | propagatePupilToFocal (arrayT &complexFocal, arrayT &complexPupil, bool doCenter=true) |
| Propagate the wavefront from the pupil plane to the focal plane. | |
| error_t | propagateFocalToPupil (arrayT &complexPupil, arrayT &complexFocal, bool doCenter=true) |
| Propagate the wavefront from Focal plane to Pupil plane. | |
| void | setWavefrontSizePixels (int wfsPix) |
| Set the size of the wavefront, in pixels. | |
Protected Member Functions | |
| void | makeShiftPhase () |
| Calculate the complex tilt arrays for centering and normalizing the wavefronts. | |
Protected Attributes | |
| int | m_wavefrontSizePixels { 0 } |
| The size of the wavefront in pixels. | |
| realT | m_xcen { 0 } |
| x-coordinate of focal plane center, in pixels | |
| realT | m_ycen { 0 } |
| x-coordinate of focal plane center, in pixels | |
| realT | m_wholePixel { 0 } |
| Determines how the image is centered. | |
| fraunhoferPropagatorArrayT< wavefrontT, cudaGPU >::arrayT | m_centerFocal |
| Phase screen for tilting the pupil plane so that the focal plane image is centered. | |
| fraunhoferPropagatorArrayT< wavefrontT, cudaGPU >::arrayT | m_centerPupil |
| Phase screen for un-tilting the pupil plane after propagating from a centered focal plane. | |
| math::ft::fftT< complexT, complexT, 2, cudaGPU > | m_fft_fwd |
| FFT object for forward FFTs. | |
| math::ft::fftT< complexT, complexT, 2, cudaGPU > | m_fft_back |
| FFT object for backward FFTs. | |
| typedef fraunhoferPropagatorArrayT<wavefrontT,cudaGPU>::arrayT mx::wfp::fraunhoferPropagator< _wavefrontT, _cudaGPU >::arrayT |
The array data type.
Definition at line 104 of file fraunhoferPropagator.hpp.
| typedef wavefrontT::Scalar mx::wfp::fraunhoferPropagator< _wavefrontT, _cudaGPU >::complexT |
The complex data type.
Definition at line 98 of file fraunhoferPropagator.hpp.
| typedef wavefrontT::Scalar::value_type mx::wfp::fraunhoferPropagator< _wavefrontT, _cudaGPU >::realT |
The real data type.
Definition at line 101 of file fraunhoferPropagator.hpp.
| typedef _wavefrontT mx::wfp::fraunhoferPropagator< _wavefrontT, _cudaGPU >::wavefrontT |
The wavefront data type.
Definition at line 93 of file fraunhoferPropagator.hpp.
| mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::fraunhoferPropagator | ( | ) |
Constructor.
Definition at line 239 of file fraunhoferPropagator.hpp.
| mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::~fraunhoferPropagator | ( | ) |
Destructor.
Definition at line 244 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 475 of file fraunhoferPropagator.hpp.
References mx::math::six_fifths().
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::propagateFocalToPupil | ( | arrayT & | complexPupil, |
| arrayT & | 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 365 of file fraunhoferPropagator.hpp.
References mx::noerror.
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::propagatePupilToFocal | ( | arrayT & | complexFocal, |
| arrayT & | 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 330 of file fraunhoferPropagator.hpp.
References mx::noerror.
| void mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::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 399 of file fraunhoferPropagator.hpp.
References backward.
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::shiftPupil | ( | arrayT & | complexPupil, |
| typename std::enable_if< ccudaGPU==0 >::type * | = 0 |
||
| ) |
Apply the shift to a pupil wavefront and apply the normalization.
This will center the resultant focal plane image. 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 268 of file fraunhoferPropagator.hpp.
References mx::noerror.
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::shiftPupil | ( | arrayT & | complexPupil, |
| typename std::enable_if< ccudaGPU==1 >::type * | = 0 |
||
| ) |
Apply the shift to a pupil wavefront and apply the normalization.
This will center the resultant focal plane image. 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 278 of file fraunhoferPropagator.hpp.
References mx::noerror.
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::unshiftPupil | ( | arrayT & | complexPupil, |
| typename std::enable_if< ccudaGPU==0 >::type * | = 0 |
||
| ) |
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 302 of file fraunhoferPropagator.hpp.
References mx::noerror.
| error_t mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::unshiftPupil | ( | arrayT & | complexPupil, |
| typename std::enable_if< ccudaGPU==1 >::type * | = 0 |
||
| ) |
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 312 of file fraunhoferPropagator.hpp.
References mx::noerror.
| int mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::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 249 of file fraunhoferPropagator.hpp.
| void mx::wfp::fraunhoferPropagator< wavefrontT, cudaGPU >::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 255 of file fraunhoferPropagator.hpp.
|
protected |
Phase screen for tilting the pupil plane so that the focal plane image is centered.
Definition at line 121 of file fraunhoferPropagator.hpp.
|
protected |
Phase screen for un-tilting the pupil plane after propagating from a centered focal plane.
Definition at line 124 of file fraunhoferPropagator.hpp.
|
protected |
FFT object for backward FFTs.
Definition at line 130 of file fraunhoferPropagator.hpp.
|
protected |
FFT object for forward FFTs.
Definition at line 127 of file fraunhoferPropagator.hpp.
|
protected |
The size of the wavefront in pixels.
Definition at line 110 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 118 of file fraunhoferPropagator.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 112 of file fraunhoferPropagator.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 113 of file fraunhoferPropagator.hpp.