mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Wavefront Propagation

Tools for modeling wavefront propagation

Classes

class  mx::wfp::fraunhoferPropagator< _wavefrontT >
 Class to perform Fraunhofer propagation between pupil and focal planes. More...
 
class  mx::wfp::fraunhoferPropagator< _wavefrontT, 1 >
 Class to perform Fraunhofer propagation between pupil and focal planes using a GPU. More...
 

Modules

 Point Spread Functions
 
 Coronagraphs
 
 Adaptive Optics
 
 Wavefront Propagation Files
 

Files

file  fraunhoferPropagator.hpp
 Declares and defines a class for Fraunhofer propagation of optical wavefronts.
 
file  fraunhoferPropagatorCuda.hpp
 Declares and defines a class for Fraunhofer propagation of optical wavefronts with Cuda.
 
file  imagingArray.hpp
 Declares and defines a class for managing images.
 
file  imagingUtils.hpp
 Utilities for modeling image formation.
 

Functions

template<typename realT >
realT mx::wfp::fftPlateScale (size_t pixels, realT metersPerPixel, realT lambda)
 Calculate the angular plate scale (radians per pixel) of an image after propagation by FFT. More...
 
template<class arrayT >
int mx::wfp::circularPupil (arrayT &m, typename arrayT::Scalar eps=0, typename arrayT::Scalar rad=0, typename arrayT::Scalar overscan=0)
 Fill in an Eigen-like array with a circular pupil mask. More...
 
template<typename arrayOutT , typename arrayInT >
void mx::wfp::makeComplexPupil (arrayOutT &complexPupil, const arrayInT &realPupil, int wavefrontSizePixels)
 Create a complex pupil plane wavefront from a real amplitude mask. More...
 
template<typename arrayOutT , typename arrayInT >
void mx::wfp::makeComplexPupil (arrayOutT &complexWavefront, const arrayInT &realAmplitude, const arrayInT &realPhase, int wavefrontSizePixels)
 Create a complex wavefront from a real amplitude and a real phase. More...
 
template<typename wavefrontT >
void mx::wfp::tiltWavefront (wavefrontT &complexWavefront, typename wavefrontT::Scalar::value_type xTilt, typename wavefrontT::Scalar::value_type yTilt)
 Apply a tilt to a wavefront. More...
 

Function Documentation

◆ circularPupil()

template<class arrayT >
int mx::wfp::circularPupil ( arrayT &  m,
typename arrayT::Scalar  eps = 0,
typename arrayT::Scalar  rad = 0,
typename arrayT::Scalar  overscan = 0 
)

Fill in an Eigen-like array with a circular pupil mask.

Sets any pixel which is at rad <= r < rad+(1.0/overscan) pixels to rho = 1,

Return values
0on success
-1on error
Parameters
m[in.out] is the allocated Array. Dimensions are used to create the pupil.
[in]eps[optional] is the central obscuration. 0-1, default is 0.
[in]rad[optional] is the desired radius. If rad <= 0, then the maximum radius based on dimensions of m is used. Default is 0.
[in]overscan[optional] overscan in fractional pixels, to include partial pixels on the edge. Default is 0.

Definition at line 72 of file imagingUtils.hpp.

Referenced by mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::makeFocalMask(), and mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC().

◆ fftPlateScale()

template<typename realT >
realT mx::wfp::fftPlateScale ( size_t  pixels,
realT  metersPerPixel,
realT  lambda 
)

Calculate the angular plate scale (radians per pixel) of an image after propagation by FFT.

Returns
the platescale of the wavefront after propagation by FFT, in radians per pixel.
Template Parameters
realTa real floating point type
Parameters
[in]pixelsthe linear dimension of the FFT (including 0 pad, etc.)
[in]metersPerPixelthe scale of the input wavefront [m/pix]
[in]lambdathe wavelength of the wavefront [m]

Definition at line 54 of file imagingUtils.hpp.

◆ makeComplexPupil() [1/2]

template<typename arrayOutT , typename arrayInT >
void mx::wfp::makeComplexPupil ( arrayOutT &  complexPupil,
const arrayInT &  realPupil,
int  wavefrontSizePixels 
)

Create a complex pupil plane wavefront from a real amplitude mask.

The input real amplitude mask is placed in the center of a 0-padded complex array.

Parameters
[out]complexPupilthe complex pupil plane wavefront
[in]realPupila real amplitude mask.
[in]wavefrontSizePixelsthe desired size of the ouput wavefront, should be at least as big as realPupil

Definition at line 183 of file imagingUtils.hpp.

Referenced by mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC().

◆ makeComplexPupil() [2/2]

template<typename arrayOutT , typename arrayInT >
void mx::wfp::makeComplexPupil ( arrayOutT &  complexWavefront,
const arrayInT &  realAmplitude,
const arrayInT &  realPhase,
int  wavefrontSizePixels 
)

Create a complex wavefront from a real amplitude and a real phase.

The wavefront is placed in the center of a 0-padded complex array.

Parameters
[out]complexWavefrontthe complex pupil plane wavefront
[in]realAmplitudeis the real-valued amplitude.
[in]realPhaseis the real-valued phase in radians, same size as realAmplitude
[in]wavefrontSizePixelsthe desired size of the ouput wavefront, should be at least as big as the real arrays

Definition at line 217 of file imagingUtils.hpp.

◆ tiltWavefront()

template<typename wavefrontT >
void mx::wfp::tiltWavefront ( wavefrontT &  complexWavefront,
typename wavefrontT::Scalar::value_type  xTilt,
typename wavefrontT::Scalar::value_type  yTilt 
)

Apply a tilt to a wavefront.

Parameters
complexWavefront[in.out] the complex wavefront to tilt, will be modified on output
xTilt[input] the amount of tilt in the x direction, in pixels
yTilt[input] the amount of tilt in the y direction, in pixels

Definition at line 248 of file imagingUtils.hpp.