mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::wfp::idealCoronagraph< _realT > Struct Template Reference

template<typename _realT>
struct mx::wfp::idealCoronagraph< _realT >

The Ideal Coronagraph.

A simple toy coronagraph which operates only the pupil plane, subtracting the energy-minimizing wavefront [3]. For an on-axis source with a perfectly flat wavefront this results in perfect extinction. This coronagraph is not physically realizable, but it is often useful for modeling and analysis, and it has been shown that real-world optimized coronagraphs often approach ideal performance [23] [and Males in prep].

Definition at line 55 of file idealCoronagraph.hpp.

#include <wfp/idealCoronagraph.hpp>

Public Types

typedef _realT realT
 The real floating point type. More...
 
typedef std::complex< realTcomplexT
 The complex floating point type. More...
 
typedef imagingArray< std::complex< realT >, fftwAllocator< std::complex< realT > >, 0 > complexFieldT
 The wavefront complex field type. More...
 
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic > imageT
 The image type. More...
 

Public Member Functions

int wfSz ()
 Get the wavefront size in pixels. More...
 
void wfSz (int sz)
 Set the wavefront size in pixels. More...
 
int setPupil (imageT &pupil)
 Set the real pupil mask. More...
 
int loadPupil (const std::string &pupilFile)
 Load the real pupil mask from a FITS file. More...
 
int loadCoronagraph (const std::string &cName)
 Load the components of the coronagraph (just a pupil) based in its base name. More...
 
int propagate (complexFieldT &pupilPlane)
 Propagate the given pupil-plane wavefront through the coronagraph to the exit pupil plane. More...
 
int propagate (imageT &fpIntensity, complexFieldT &pupilPlane)
 Propagate the given pupil-plane wavefront through the coronagraph to the exit pupil plane, and then to the final focal plane. More...
 
int propagateNC (complexFieldT &pupilPlane)
 Propagate the given pupil-plane wavefront without the coronagraph. More...
 
int propagateNC (imageT &fpIntensity, complexFieldT &pupilPlane)
 Propagate the given pupil-plane wavefront without the coronagraph to the exit pupil plane, and then to the final focal plane. More...
 

Public Attributes

std::string _fileDir
 The directory where coronagraph files are stored. More...
 
int _wfSz
 The linear size of the wavefront in pixels. More...
 
fraunhoferPropagator< complexFieldTm_fi
 Fraunhofer propagator. More...
 
realT m_wholePixel {0}
 Determines how the image is centered.
More...
 

Member Typedef Documentation

◆ complexFieldT

template<typename _realT >
typedef imagingArray<std::complex<realT>, fftwAllocator<std::complex<realT> >, 0> mx::wfp::idealCoronagraph< _realT >::complexFieldT

The wavefront complex field type.

Definition at line 64 of file idealCoronagraph.hpp.

◆ complexT

template<typename _realT >
typedef std::complex<realT> mx::wfp::idealCoronagraph< _realT >::complexT

The complex floating point type.

Definition at line 61 of file idealCoronagraph.hpp.

◆ imageT

template<typename _realT >
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic> mx::wfp::idealCoronagraph< _realT >::imageT

The image type.

Definition at line 67 of file idealCoronagraph.hpp.

◆ realT

template<typename _realT >
typedef _realT mx::wfp::idealCoronagraph< _realT >::realT

The real floating point type.

Definition at line 58 of file idealCoronagraph.hpp.

Member Function Documentation

◆ loadCoronagraph()

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::loadCoronagraph ( const std::string &  cName)

Load the components of the coronagraph (just a pupil) based in its base name.

Looks in _filDir for the files.

Returns
0 on success.
-1 on error.
Parameters
cNameThe name of the coronagraph, without directory or file extensions

Definition at line 206 of file idealCoronagraph.hpp.

◆ loadPupil()

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::loadPupil ( const std::string &  pupilFile)

Load the real pupil mask from a FITS file.

The input mask does not have to be the same size as wfSz, as the stored mask will be padded.

Returns
0 on success.
-1 on error.
Parameters
[in]pupilFilethe FITS file containing the pupil mask.

Definition at line 191 of file idealCoronagraph.hpp.

References mx::fits::fitsFile< dataT >::read().

◆ propagate() [1/2]

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::propagate ( complexFieldT pupilPlane)

Propagate the given pupil-plane wavefront through the coronagraph to the exit pupil plane.

Parameters
pupilPlane[in.out] The wavefront at the input pupil plane. It is modified by the coronagraph.

Definition at line 222 of file idealCoronagraph.hpp.

◆ propagate() [2/2]

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::propagate ( imageT fpIntensity,
complexFieldT pupilPlane 
)

Propagate the given pupil-plane wavefront through the coronagraph to the exit pupil plane, and then to the final focal plane.

Parameters
[out]fpIntensityThe intensity image in the focal plane. This should be pre-allocated.
pupilPlane[in.out] The wavefront at the input pupil plane. It is modified by the coronagraph.

Definition at line 244 of file idealCoronagraph.hpp.

◆ propagateNC() [1/2]

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::propagateNC ( complexFieldT pupilPlane)

Propagate the given pupil-plane wavefront without the coronagraph.

For the ideal coronagraph nothing is done. This method is included for compliance with with the coronagraph interface.

Parameters
pupilPlane[in.out] The wavefront at the input pupil plane. It is un-modified.

Definition at line 261 of file idealCoronagraph.hpp.

◆ propagateNC() [2/2]

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::propagateNC ( imageT fpIntensity,
complexFieldT pupilPlane 
)

Propagate the given pupil-plane wavefront without the coronagraph to the exit pupil plane, and then to the final focal plane.

For the ideal coronagraph nothing is done to the input wavefront.

Parameters
[out]fpIntensityThe intensity image in the focal plane. This should be pre-allocated.
pupilPlane[in.out] The wavefront at the input pupil plane. It is un-modified.

Definition at line 268 of file idealCoronagraph.hpp.

◆ setPupil()

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::setPupil ( imageT pupil)

Set the real pupil mask.

The input mask does not have to be the same size as wfSz, as the stored mask will be padded.

Returns
0 on success.
-1 on error.
Parameters
[in]pupilthe pupil mask.

Definition at line 176 of file idealCoronagraph.hpp.

References mx::improc::padImage().

◆ wfSz() [1/2]

template<typename realT >
int mx::wfp::idealCoronagraph< realT >::wfSz

Get the wavefront size in pixels.

Returns
the wavefront size in pixels

Definition at line 159 of file idealCoronagraph.hpp.

◆ wfSz() [2/2]

template<typename realT >
void mx::wfp::idealCoronagraph< realT >::wfSz ( int  sz)

Set the wavefront size in pixels.

Parameters
[in]szis the new size

Definition at line 165 of file idealCoronagraph.hpp.

Member Data Documentation

◆ _fileDir

template<typename _realT >
std::string mx::wfp::idealCoronagraph< _realT >::_fileDir

The directory where coronagraph files are stored.

Definition at line 70 of file idealCoronagraph.hpp.

◆ _wfSz

template<typename _realT >
int mx::wfp::idealCoronagraph< _realT >::_wfSz

The linear size of the wavefront in pixels.

Definition at line 73 of file idealCoronagraph.hpp.

◆ m_fi

template<typename _realT >
fraunhoferPropagator<complexFieldT> mx::wfp::idealCoronagraph< _realT >::m_fi

Fraunhofer propagator.

Definition at line 80 of file idealCoronagraph.hpp.

◆ m_wholePixel

template<typename _realT >
realT mx::wfp::idealCoronagraph< _realT >::m_wholePixel {0}

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. This is passed to fraunhoferPropagator when it is resized.

Definition at line 86 of file idealCoronagraph.hpp.


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