mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::wfp::fraunhoferPropagator< _wavefrontT, 1 > Class Template Reference

template<typename _wavefrontT>
class mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >

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.

Template Parameters
_wavefrontTis 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< complexTm_centerFocal
 Phase screen for tilting the pupil plane so that the focal plane image is centered [GPU memory]. More...
 
mx::cuda::cudaPtr< complexTm_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...
 

Member Typedef Documentation

◆ complexT

template<typename _wavefrontT >
typedef wavefrontT::Scalar mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::complexT

The complex data type.

Definition at line 43 of file fraunhoferPropagatorCuda.hpp.

◆ realT

template<typename _wavefrontT >
typedef wavefrontT::Scalar::value_type mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::realT

The real data type.

Definition at line 46 of file fraunhoferPropagatorCuda.hpp.

◆ wavefrontT

template<typename _wavefrontT >
typedef _wavefrontT mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::wavefrontT

The wavefront data type.

Definition at line 40 of file fraunhoferPropagatorCuda.hpp.

Constructor & Destructor Documentation

◆ fraunhoferPropagator()

template<typename _wavefrontT >
mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::fraunhoferPropagator ( )

Constructor.

◆ ~fraunhoferPropagator()

template<typename _wavefrontT >
mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::~fraunhoferPropagator ( )

Destructor.

Member Function Documentation

◆ makeShiftPhase()

template<typename _wavefrontT >
void mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::makeShiftPhase ( )
protected

Calculate the complex tilt arrays for centering and normalizing the wavefronts.

◆ propagateFocalToPupil()

template<typename _wavefrontT >
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

Parameters
[out]complexPupilthe pupil plane wavefront. Must be pre-allocated to same size as complexFocal.
[in]complexFocalthe focal plane wavefront.

◆ propagatePupilToFocal()

template<typename _wavefrontT >
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.

Parameters
[out]complexFocalthe focal plane wavefront. Must be pre-allocated to same size as complexPupil.
[in]complexPupilthe pupil plane wavefront. Modified due to application of centering tilt.

◆ setWavefrontSizePixels()

template<typename _wavefrontT >
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.

Parameters
[in]wfsPixthe desired new size of the wavefront

Member Data Documentation

◆ m_centerFocal

template<typename _wavefrontT >
mx::cuda::cudaPtr<complexT> mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::m_centerFocal
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.

◆ m_centerPupil

template<typename _wavefrontT >
mx::cuda::cudaPtr<complexT> mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::m_centerPupil
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.

◆ m_fftPlan

template<typename _wavefrontT >
cufftHandle mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::m_fftPlan {0}
protected

Cuda FFT plan. We only need one since the forward/inverse is part of execution.

Definition at line 67 of file fraunhoferPropagatorCuda.hpp.

◆ wavefrontSizePixels

template<typename _wavefrontT >
int mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::wavefrontSizePixels {0}
protected

The size of the wavefront in pixels.

Definition at line 53 of file fraunhoferPropagatorCuda.hpp.

◆ xcen

template<typename _wavefrontT >
realT mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::xcen {0}
protected

x-coordinate of focal plane center, in pixels

Definition at line 55 of file fraunhoferPropagatorCuda.hpp.

◆ ycen

template<typename _wavefrontT >
realT mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >::ycen {0}
protected

x-coordinate of focal plane center, in pixels

Definition at line 56 of file fraunhoferPropagatorCuda.hpp.


The documentation for this class was generated from the following file: