mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::wfp Namespace Reference

Classes

struct  fftwAllocator
 
class  fraunhoferPropagator
 Class to perform Fraunhofer propagation between pupil and focal planes. More...
 
class  fraunhoferPropagator< _wavefrontT, 1 >
 Class to perform Fraunhofer propagation between pupil and focal planes using a GPU. More...
 
struct  idealCoronagraph
 The Ideal Coronagraph. More...
 
class  imagingArray
 
class  imagingArray< _Scalar, _allocatorT, 0 >
 
struct  imagingArrayInplaceAdd
 
struct  imagingArrayInplaceAdd< imageT, typeT, true >
 
struct  imagingArrayInplaceDivision
 
struct  imagingArrayInplaceDivision< imageT, typeT, true >
 
struct  imagingArrayInplaceProduct
 
struct  imagingArrayInplaceProduct< imageT, typeT, true >
 
struct  is_imagingArray
 Test whether a type is an imagingArray by testing whether it has a typedef of "is_imagingArray". More...
 
struct  lyotCoronagraph
 The Lyot Coronagraph. More...
 

Typedefs

template<typename scalarT >
using imagingArrayT = imagingArray< scalarT, fftwAllocator< scalarT >, 0 >
 

Functions

template<typename realT >
realT fftPlateScale (size_t pixels, realT metersPerPixel, realT lambda)
 Calculate the angular plate scale (radians per pixel) of an image after propagation by FFT.
 
template<class arrayT >
int 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.
 
template<class arrayT >
void drawLine (arrayT &im, typename arrayT::Scalar x0, typename arrayT::Scalar y0, typename arrayT::Scalar x1, typename arrayT::Scalar y1, typename arrayT::Scalar halfWidth)
 Draw a line in an image.
 
template<typename arrayOutT , typename arrayInT >
void makeComplexPupil (arrayOutT &complexPupil, const arrayInT &realPupil, int wavefrontSizePixels)
 Create a complex pupil plane wavefront from a real amplitude mask.
 
template<typename arrayOutT , typename arrayInT >
void makeComplexPupil (arrayOutT &complexWavefront, const arrayInT &realAmplitude, const arrayInT &realPhase, int wavefrontSizePixels)
 Create a complex wavefront from a real amplitude and a real phase.
 
template<typename wavefrontT >
void tiltWavefront (wavefrontT &complexWavefront, typename wavefrontT::Scalar::value_type xTilt, typename wavefrontT::Scalar::value_type yTilt)
 Apply a tilt to a wavefront.
 
template<typename imageT1 , typename imageT2 >
void extractBlock (imageT1 &dest, int imX0, int imXsz, int imY0, int imYsz, imageT2 &src, int wfX0, int wfY0)
 Extract a block from one image and insert it into a second.
 
template<typename imageT1 , typename imageT2 , typename imageT3 >
void extractMaskedPixels (imageT1 &dest, const imageT2 &src, const imageT3 &mask)
 Extract a pixels from one image and insert them into a second based on a mask.
 
template<typename realImageT , typename complexImageT >
void extractIntensityImage (realImageT &im, int imX0, int imXsz, int imY0, int imYsz, complexImageT &wf, int wfX0, int wfY0)
 
template<typename realImageT , typename complexImageT >
void extractIntensityImageAccum (realImageT &im, int imX0, int imXsz, int imY0, int imYsz, complexImageT &wf, int wfX0, int wfY0)
 

Typedef Documentation

◆ imagingArrayT

template<typename scalarT >
using mx::wfp::imagingArrayT = typedef imagingArray<scalarT, fftwAllocator<scalarT>, 0>

Definition at line 353 of file imagingArray.hpp.

Function Documentation

◆ drawLine()

template<class arrayT >
void mx::wfp::drawLine ( arrayT &  im,
typename arrayT::Scalar  x0,
typename arrayT::Scalar  y0,
typename arrayT::Scalar  x1,
typename arrayT::Scalar  y1,
typename arrayT::Scalar  halfWidth 
)

Draw a line in an image.

Todo:
should handle width much more intelligently, this only works for ~45 degree lines.
Template Parameters
arrayTis an Eigen-like array with public typedef Scalar
Parameters
im[in.out] The input image, modified.
[in]x0the x value, relative to image center, of the starting point
[in]y0the y value, relative to image center, of the starting point
[in]x1the x value, relative to image center, of the end point
[in]y1the y value, relative to image center, of the end point
[in]halfWidththe half-width of the line.

Definition at line 124 of file imagingUtils.hpp.

◆ extractBlock()

template<typename imageT1 , typename imageT2 >
void mx::wfp::extractBlock ( imageT1 &  dest,
int  imX0,
int  imXsz,
int  imY0,
int  imYsz,
imageT2 &  src,
int  wfX0,
int  wfY0 
)

Extract a block from one image and insert it into a second.

Parameters
dest[in/out] the image in which to place the extracted block. Must be pre-allocated.
[in]imX0the x/row-coord of the lower left pixel of the destination region.
[in]imXszthe x size (number of rows) of the block
[in]imY0the y/col-coord of the lower left pixel of the desination region
[in]imYszthe y=size (number of cols) ov the block
[in]srcthe source of the block. Must be large enough.
[in]wfX0the x/row-coord of the lower left pixel of the source region
[in]wfY0the y/col-coord of the lower left pixel of the source region

Definition at line 280 of file imagingUtils.hpp.

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

◆ extractIntensityImage()

template<typename realImageT , typename complexImageT >
void mx::wfp::extractIntensityImage ( realImageT &  im,
int  imX0,
int  imXsz,
int  imY0,
int  imYsz,
complexImageT &  wf,
int  wfX0,
int  wfY0 
)

◆ extractIntensityImageAccum()

template<typename realImageT , typename complexImageT >
void mx::wfp::extractIntensityImageAccum ( realImageT &  im,
int  imX0,
int  imXsz,
int  imY0,
int  imYsz,
complexImageT &  wf,
int  wfX0,
int  wfY0 
)

◆ extractMaskedPixels()

template<typename imageT1 , typename imageT2 , typename imageT3 >
void mx::wfp::extractMaskedPixels ( imageT1 &  dest,
const imageT2 &  src,
const imageT3 &  mask 
)

Extract a pixels from one image and insert them into a second based on a mask.

Only pixels with a non-zero value in mask are changed in dest to have the value in src. Other pixels are not modified.

Parameters
dest[in/out] the image in which to place the extracted pixels. Must be the same size as src and mask.
[in]srcthe source of the pixels. Must be the same size as mask.
[in]maskthe mask image, where any value other than 0 indicates a pixel to extract. Must be the same size as src.

Definition at line 314 of file imagingUtils.hpp.

References mxThrowException.

Referenced by mx::AO::sim::pyramidSensor< _realT, _detectorT >::makeOpdMask().