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 using a GPU.
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 35 of file fraunhoferPropagatorCuda.hpp.
#include <wfp/fraunhoferPropagatorCuda.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... | |
void | setWavefrontSizePixels (int wfsPix) |
Set the size of the wavefront, in pixels. More... | |
void | propagatePupilToFocal (devicePtrT *complexFocal, devicePtrT *complexPupil) |
Propagate the wavefront from the pupil plane to the focal plane. More... | |
void | propagateFocalToPupil (devicePtrT *complexPupil, devicePtrT *complexFocal) |
Propagate the wavefront from Focal plane to Pupil plane. More... | |
Protected Member Functions | |
void | makeShiftPhase () |
Calculate the complex tilt arrays for centering and normalizing the wavefronts. More... | |
Protected Attributes | |
int | wavefrontSizePixels {0} |
The size of the wavefront in pixels. More... | |
realT | xcen {0} |
x-coordinate of focal plane center, in pixels More... | |
realT | ycen {0} |
x-coordinate of focal plane center, in pixels More... | |
mx::cuda::cudaPtr< complexT > | m_centerFocal |
Phase screen for tilting the pupil plane so that the focal plane image is centered [GPU memory]. More... | |
mx::cuda::cudaPtr< complexT > | m_centerPupil |
Phase screen for un-tilting the pupil plane after propagating from a centered focal plane [GPU memory]. More... | |
cufftHandle | m_fftPlan {0} |
Cuda FFT plan. We only need one since the forward/inverse is part of execution. More... | |
typedef wavefrontT::Scalar mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::complexT |
The complex data type.
Definition at line 43 of file fraunhoferPropagatorCuda.hpp.
typedef wavefrontT::Scalar::value_type mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::realT |
The real data type.
Definition at line 46 of file fraunhoferPropagatorCuda.hpp.
typedef _wavefrontT mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::wavefrontT |
The wavefront data type.
Definition at line 40 of file fraunhoferPropagatorCuda.hpp.
mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::fraunhoferPropagator | ( | ) |
Constructor.
mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::~fraunhoferPropagator | ( | ) |
Destructor.
|
protected |
Calculate the complex tilt arrays for centering and normalizing the wavefronts.
void mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::propagateFocalToPupil | ( | devicePtrT * | complexPupil, |
devicePtrT * | complexFocal | ||
) |
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
[out] | complexPupil | the pupil plane wavefront. Must be pre-allocated to same size as complexFocal. |
[in] | complexFocal | the focal plane wavefront. |
void mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::propagatePupilToFocal | ( | devicePtrT * | complexFocal, |
devicePtrT * | complexPupil | ||
) |
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.
[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. |
void mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::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 |
|
protected |
Phase screen for tilting the pupil plane so that the focal plane image is centered [GPU memory].
Definition at line 60 of file fraunhoferPropagatorCuda.hpp.
|
protected |
Phase screen for un-tilting the pupil plane after propagating from a centered focal plane [GPU memory].
Definition at line 64 of file fraunhoferPropagatorCuda.hpp.
|
protected |
Cuda FFT plan. We only need one since the forward/inverse is part of execution.
Definition at line 67 of file fraunhoferPropagatorCuda.hpp.
|
protected |
The size of the wavefront in pixels.
Definition at line 53 of file fraunhoferPropagatorCuda.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 55 of file fraunhoferPropagatorCuda.hpp.
|
protected |
x-coordinate of focal plane center, in pixels
Definition at line 56 of file fraunhoferPropagatorCuda.hpp.