mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
The Lyot Coronagraph.
A generalized Lyot coronagraph, which can include a pupil apodization, a focal plane mask with complex transmission, and a Lyot stop. Light is propagated through the coronagraph plane-by-plane, and the complex wavefront can be accessed at any plane. Also provides functions for optimizing the pupil apodizer and focal plane mask.
Definition at line 56 of file lyotCoronagraph.hpp.
#include <wfp/lyotCoronagraph.hpp>
Public Types | |
typedef _realT | realT |
The real floating point type. More... | |
typedef _fpmaskFloatT | fpmaskFloatT |
The real floating point type for mask calculations. More... | |
typedef std::complex< realT > | complexT |
The complex floating point type. More... | |
typedef mx::wfp::imagingArray< std::complex< realT >, fftwAllocator< std::complex< realT > >, 0 > | complexFieldT |
The wavefront complex field type. More... | |
typedef Eigen::Array< std::complex< fpmaskFloatT >, Eigen::Dynamic, Eigen::Dynamic > | fpMaskT |
The focal plane mask type. More... | |
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic > | imageT |
The image type. More... | |
Public Member Functions | |
lyotCoronagraph () | |
Default c'tor. More... | |
int | wfSz () |
Get the wavefront size in pixels. More... | |
void | wfSz (int sz) |
Set the wavefront size in pixels. More... | |
void | makeFocalMask (realT rad, fpmaskFloatT trans=0.0, int sz=0.0) |
Make the focal plane mask. More... | |
int | loadApodizer (const std::string &apodName) |
Load the apodizer from a FITS file. More... | |
int | loadFocalMask (const std::string &fpmName) |
Load the focal plane mask from a FITS file. More... | |
int | loadLyotStop (const std::string &lyotName) |
Load the Lyot stop from a FITS file. More... | |
int | loadCoronagraph (const std::string &apodName, const std::string &fpmName, const std::string &lyotName) |
Load the components of the coronagraph from FITS files. More... | |
int | loadCoronagraph (const std::string &cName) |
Load the components of the coronagraph based in its base name. More... | |
int | propagate (complexFieldT &pupilPlane) |
Propagate the given pupil-plane wavefront through the coronagraph. More... | |
int | propagate (imageT &fpIntensity, complexFieldT &pupilPlane) |
int | propagateNC (complexFieldT &pupilPlane) |
Propagate the given pupil-plane wavefront without the coronagraph. More... | |
int | propagateNC (imageT &fpIntensity, complexFieldT &pupilPlane) |
void | optimizeAPLCMC (imageT &geomPupil, realT fpmRadPix, realT relTol, realT absTol, int maxIter, const std::string &cname) |
Optimize the pupil amplitude apodization and focal-plane mask complex transmission. More... | |
void | optimizeAPLCMC (imageT &geomPupil, realT fpmRadPix, imageT &fpmPhase, realT relTol, realT absTol, int maxIter, const std::string &cname) |
Public Attributes | |
std::string | m_fileDir {"coron"} |
The directory where coronagraph files are stored. More... | |
int | m_wfSz {0} |
The linear size of the wavefront in pixels. More... | |
imageT | m_pupilApodizer |
Image containing the pupil apodization. More... | |
int | m_maskSource |
0= read from file, 1 = constructed by makeFocalMask, 2 = trans optimized. More... | |
std::string | m_maskFile |
Name of file from which mask was loaded. More... | |
realT | m_maskRad |
Radius of mask if it was constructed. More... | |
realT | m_maskTrans |
Transmission of mask if it was constructed. More... | |
fpMaskT | m_focalMask |
The focal plane mask. More... | |
imageT | m_lyotStop |
Image containing the lyot stop. More... | |
fraunhoferPropagator< complexFieldT > | m_fp |
Fraunhofer propagator. More... | |
typedef mx::wfp::imagingArray<std::complex<realT>, fftwAllocator<std::complex<realT> >, 0> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::complexFieldT |
The wavefront complex field type.
Definition at line 69 of file lyotCoronagraph.hpp.
typedef std::complex<realT> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::complexT |
The complex floating point type.
Definition at line 66 of file lyotCoronagraph.hpp.
typedef _fpmaskFloatT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::fpmaskFloatT |
The real floating point type for mask calculations.
Definition at line 63 of file lyotCoronagraph.hpp.
typedef Eigen::Array< std::complex<fpmaskFloatT>, Eigen::Dynamic, Eigen::Dynamic> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::fpMaskT |
The focal plane mask type.
Definition at line 72 of file lyotCoronagraph.hpp.
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::imageT |
The image type.
Definition at line 75 of file lyotCoronagraph.hpp.
typedef _realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::realT |
The real floating point type.
Definition at line 60 of file lyotCoronagraph.hpp.
mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::lyotCoronagraph |
Default c'tor.
Definition at line 220 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadApodizer | ( | const std::string & | apodName | ) |
Load the apodizer from a FITS file.
[in] | apodName | is the name of the FITS file containing the apodizer. |
Definition at line 274 of file lyotCoronagraph.hpp.
References mx::fits::fitsFile< dataT >::read().
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadCoronagraph | ( | const std::string & | apodName, |
const std::string & | fpmName, | ||
const std::string & | lyotName | ||
) |
Load the components of the coronagraph from FITS files.
[in] | apodName | is the name of the FITS file containing the apodizer. |
[in] | fpmName | is the name of the FITS file containing the focal plane mask. |
[in] | lyotName | is the name of the FITS file containing the lyot stop. |
Definition at line 330 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadCoronagraph | ( | const std::string & | cName | ) |
Load the components of the coronagraph based in its base name.
Looks in _filDir for the files.
[in] | cName | is the base name of the coronagraph without directory or file extension. |
Definition at line 342 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadFocalMask | ( | const std::string & | fpmName | ) |
Load the focal plane mask from a FITS file.
[in] | fpmName | is the name of the FITS file containing the focal plane mask. |
Definition at line 283 of file lyotCoronagraph.hpp.
References mx::astro::constants::c(), mx::improc::eigenCube< dataT >::image(), and mx::fits::fitsFile< dataT >::read().
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadLyotStop | ( | const std::string & | lyotName | ) |
Load the Lyot stop from a FITS file.
[in] | lyotName | is the name of the FITS file containing the lyot stop. |
Definition at line 321 of file lyotCoronagraph.hpp.
References mx::fits::fitsFile< dataT >::read().
void mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::makeFocalMask | ( | realT | rad, |
fpmaskFloatT | trans = 0.0 , |
||
int | sz = 0.0 |
||
) |
Make the focal plane mask.
Definition at line 241 of file lyotCoronagraph.hpp.
References mx::wfp::circularPupil().
void mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC | ( | imageT & | geomPupil, |
realT | fpmRadPix, | ||
imageT & | fpmPhase, | ||
realT | relTol, | ||
realT | absTol, | ||
int | maxIter, | ||
const std::string & | cname | ||
) |
geomPupil | The geometric pupil mask, binary 1/0 transmission. |
fpmRadPix | The radius in pixels of the FPM. |
relTol | Relative tolerance for convergence. |
absTol | Absolute tolerance for convergence. |
maxIter | Maximum number of iterations to allow. |
cname | Name of coronagraph, used as base-name for output files in m_fileDir. |
Definition at line 661 of file lyotCoronagraph.hpp.
References mx::wfp::circularPupil(), and mx::wfp::makeComplexPupil().
void mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC | ( | imageT & | geomPupil, |
realT | fpmRadPix, | ||
realT | relTol, | ||
realT | absTol, | ||
int | maxIter, | ||
const std::string & | cname | ||
) |
Optimize the pupil amplitude apodization and focal-plane mask complex transmission.
Uses the algorithm in Guyon (2014) [8] for optimizing an Apodized-Pupil Lyot Complex Mask Coronagraph (APLCMC).
geomPupil | The geometric pupil mask, binary 1/0 transmission. |
fpmRadPix | The radius in pixels of the FPM. |
relTol | Relative tolerance for convergence. |
absTol | Absolute tolerance for convergence. |
maxIter | Maximum number of iterations to allow. |
cname | Name of coronagraph, used as base-name for output files in m_fileDir. |
Definition at line 494 of file lyotCoronagraph.hpp.
References mx::wfp::circularPupil(), and mx::wfp::makeComplexPupil().
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::propagate | ( | complexFieldT & | pupilPlane | ) |
Propagate the given pupil-plane wavefront through the coronagraph.
pupilPlane | [in.out] The wavefront at the input pupil plane. It is modified by the coronagraph. |
Definition at line 420 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::propagate | ( | imageT & | fpIntensity, |
complexFieldT & | pupilPlane | ||
) |
[out] | fpIntensity | The 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 446 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::propagateNC | ( | complexFieldT & | pupilPlane | ) |
Propagate the given pupil-plane wavefront without the coronagraph.
For a Lyot coronagraph, this applies the pupil apodization and Lyot stop, but not the FPM, to the given pupil-plane wavefront such that the result will produce the non-coronagraphic (off-axis) PSF.
pupilPlane | [in.out] The wavefront at the input pupil plane. It is modified by the coronagraph. |
Definition at line 462 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::propagateNC | ( | imageT & | fpIntensity, |
complexFieldT & | pupilPlane | ||
) |
[out] | fpIntensity | The 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 476 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::wfSz |
Get the wavefront size in pixels.
Definition at line 225 of file lyotCoronagraph.hpp.
void mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::wfSz | ( | int | sz | ) |
Set the wavefront size in pixels.
[in] | sz | is the new size |
Definition at line 231 of file lyotCoronagraph.hpp.
std::string mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_fileDir {"coron"} |
The directory where coronagraph files are stored.
Definition at line 81 of file lyotCoronagraph.hpp.
fpMaskT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_focalMask |
The focal plane mask.
Definition at line 97 of file lyotCoronagraph.hpp.
fraunhoferPropagator<complexFieldT> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_fp |
Fraunhofer propagator.
Definition at line 112 of file lyotCoronagraph.hpp.
imageT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_lyotStop |
Image containing the lyot stop.
Definition at line 100 of file lyotCoronagraph.hpp.
std::string mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskFile |
Name of file from which mask was loaded.
Definition at line 91 of file lyotCoronagraph.hpp.
realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskRad |
Radius of mask if it was constructed.
Definition at line 93 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskSource |
0= read from file, 1 = constructed by makeFocalMask, 2 = trans optimized.
Definition at line 90 of file lyotCoronagraph.hpp.
realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskTrans |
Transmission of mask if it was constructed.
Definition at line 94 of file lyotCoronagraph.hpp.
imageT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_pupilApodizer |
Image containing the pupil apodization.
Definition at line 87 of file lyotCoronagraph.hpp.
int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_wfSz {0} |
The linear size of the wavefront in pixels.
Definition at line 84 of file lyotCoronagraph.hpp.