|
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 58 of file lyotCoronagraph.hpp.
#include <wfp/lyotCoronagraph.hpp>
Public Types | |
| typedef _realT | realT |
| The real floating point type. | |
| typedef _fpmaskFloatT | fpmaskFloatT |
| The real floating point type for mask calculations. | |
| typedef std::complex< realT > | complexT |
| The complex floating point type. | |
| typedef mx::wfp::imagingArray< std::complex< realT >, fftwAllocator< std::complex< realT > >, 0 > | complexFieldT |
| The wavefront complex field type. | |
| typedef Eigen::Array< std::complex< fpmaskFloatT >, Eigen::Dynamic, Eigen::Dynamic > | fpMaskT |
| The focal plane mask type. | |
| typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic > | imageT |
| The image type. | |
Public Member Functions | |
| lyotCoronagraph () | |
| Default c'tor. | |
| int | wfSz () |
| Get the wavefront size in pixels. | |
| void | wfSz (int sz) |
| Set the wavefront size in pixels. | |
| void | makeFocalMask (realT rad, fpmaskFloatT trans=0.0, int sz=0.0) |
| Make the focal plane mask. | |
| int | loadApodizer (const std::string &apodName) |
| Load the apodizer from a FITS file. | |
| int | loadFocalMask (const std::string &fpmName) |
| Load the focal plane mask from a FITS file. | |
| int | loadLyotStop (const std::string &lyotName) |
| Load the Lyot stop from a FITS file. | |
| int | loadCoronagraph (const std::string &apodName, const std::string &fpmName, const std::string &lyotName) |
| Load the components of the coronagraph from FITS files. | |
| int | loadCoronagraph (const std::string &cName) |
| Load the components of the coronagraph based in its base name. | |
| int | propagate (complexFieldT &pupilPlane) |
| Propagate the given pupil-plane wavefront through the coronagraph. | |
| int | propagate (imageT &fpIntensity, complexFieldT &pupilPlane) |
| int | propagateNC (complexFieldT &pupilPlane) |
| Propagate the given pupil-plane wavefront without the coronagraph. | |
| 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. | |
| 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. | |
| int | m_wfSz { 0 } |
| The linear size of the wavefront in pixels. | |
| imageT | m_pupilApodizer |
| Image containing the pupil apodization. | |
| int | m_maskSource |
| 0= read from file, 1 = constructed by makeFocalMask, 2 = trans optimized. | |
| std::string | m_maskFile |
| Name of file from which mask was loaded. | |
| realT | m_maskRad |
| Radius of mask if it was constructed. | |
| realT | m_maskTrans |
| Transmission of mask if it was constructed. | |
| fpMaskT | m_focalMask |
| The focal plane mask. | |
| imageT | m_lyotStop |
| Image containing the lyot stop. | |
| fraunhoferPropagator< complexFieldT > | m_fp |
| Fraunhofer propagator. | |
| 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 71 of file lyotCoronagraph.hpp.
| typedef std::complex<realT> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::complexT |
The complex floating point type.
Definition at line 68 of file lyotCoronagraph.hpp.
| typedef _fpmaskFloatT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::fpmaskFloatT |
The real floating point type for mask calculations.
Definition at line 65 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 74 of file lyotCoronagraph.hpp.
| typedef Eigen::Array<realT, Eigen::Dynamic, Eigen::Dynamic> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::imageT |
The image type.
Definition at line 77 of file lyotCoronagraph.hpp.
| typedef _realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::realT |
The real floating point type.
Definition at line 62 of file lyotCoronagraph.hpp.
| mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::lyotCoronagraph | ( | ) |
Default c'tor.
Definition at line 228 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 281 of file lyotCoronagraph.hpp.
References m_pupilApodizer, and mx::fits::fitsFile< dataT, verboseT >::read().
Referenced by loadCoronagraph().
| 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 343 of file lyotCoronagraph.hpp.
References loadApodizer(), loadFocalMask(), and loadLyotStop().
Referenced by loadCoronagraph().
| 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 358 of file lyotCoronagraph.hpp.
References loadCoronagraph(), m_fileDir, MXE_PARAMNOTSET, and mxError.
| 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 292 of file lyotCoronagraph.hpp.
References mx::improc::eigenCube< dataT >::image(), m_focalMask, m_maskFile, m_maskRad, m_maskSource, m_maskTrans, and mx::fits::fitsFile< dataT, verboseT >::read().
Referenced by loadCoronagraph().
| 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 332 of file lyotCoronagraph.hpp.
References m_lyotStop, and mx::fits::fitsFile< dataT, verboseT >::read().
Referenced by loadCoronagraph().
| 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 248 of file lyotCoronagraph.hpp.
References mx::wfp::circularPupil(), m_focalMask, m_maskFile, m_maskRad, m_maskSource, and m_maskTrans.
Referenced by optimizeAPLCMC(), and optimizeAPLCMC().
| 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 679 of file lyotCoronagraph.hpp.
References mx::fits::fitsHeader< verboseT >::append(), mx::wfp::circularPupil(), m_focalMask, m_fp, m_lyotStop, m_maskSource, m_pupilApodizer, m_wfSz, mx::wfp::makeComplexPupil(), makeFocalMask(), and mx::fits::fitsFile< dataT, verboseT >::write().
| 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) [13] 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 506 of file lyotCoronagraph.hpp.
References mx::fits::fitsHeader< verboseT >::append(), mx::wfp::circularPupil(), m_focalMask, m_fp, m_lyotStop, m_maskSource, m_pupilApodizer, m_wfSz, mx::wfp::makeComplexPupil(), makeFocalMask(), and mx::fits::fitsFile< dataT, verboseT >::write().
| 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 437 of file lyotCoronagraph.hpp.
References m_fp.
Referenced by propagate().
| 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 463 of file lyotCoronagraph.hpp.
References m_fp, m_wfSz, and propagate().
| 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 477 of file lyotCoronagraph.hpp.
References m_fp.
Referenced by propagateNC().
| 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 491 of file lyotCoronagraph.hpp.
References m_fp, m_wfSz, and propagateNC().
| int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::wfSz | ( | ) |
Get the wavefront size in pixels.
Definition at line 233 of file lyotCoronagraph.hpp.
References m_wfSz.
| void mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::wfSz | ( | int | sz | ) |
Set the wavefront size in pixels.
| [in] | sz | is the new size |
Definition at line 239 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.
Referenced by loadCoronagraph().
| fpMaskT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_focalMask |
The focal plane mask.
Definition at line 96 of file lyotCoronagraph.hpp.
Referenced by loadFocalMask(), makeFocalMask(), optimizeAPLCMC(), and optimizeAPLCMC().
| fraunhoferPropagator<complexFieldT> mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_fp |
Fraunhofer propagator.
Definition at line 110 of file lyotCoronagraph.hpp.
Referenced by optimizeAPLCMC(), optimizeAPLCMC(), propagate(), propagate(), propagateNC(), propagateNC(), and wfSz().
| imageT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_lyotStop |
Image containing the lyot stop.
Definition at line 99 of file lyotCoronagraph.hpp.
Referenced by loadLyotStop(), optimizeAPLCMC(), and optimizeAPLCMC().
| std::string mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskFile |
Name of file from which mask was loaded.
Definition at line 90 of file lyotCoronagraph.hpp.
Referenced by loadFocalMask(), and makeFocalMask().
| realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskRad |
Radius of mask if it was constructed.
Definition at line 92 of file lyotCoronagraph.hpp.
Referenced by loadFocalMask(), and makeFocalMask().
| int mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskSource |
0= read from file, 1 = constructed by makeFocalMask, 2 = trans optimized.
Definition at line 89 of file lyotCoronagraph.hpp.
Referenced by loadFocalMask(), makeFocalMask(), optimizeAPLCMC(), and optimizeAPLCMC().
| realT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_maskTrans |
Transmission of mask if it was constructed.
Definition at line 93 of file lyotCoronagraph.hpp.
Referenced by loadFocalMask(), and makeFocalMask().
| imageT mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::m_pupilApodizer |
Image containing the pupil apodization.
Definition at line 87 of file lyotCoronagraph.hpp.
Referenced by loadApodizer(), optimizeAPLCMC(), and optimizeAPLCMC().
| 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.
Referenced by optimizeAPLCMC(), optimizeAPLCMC(), propagate(), propagateNC(), wfSz(), and wfSz().