|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Class to manage interactions with a FITS file.
This class wraps the functionality of cfitsio.
| dataT | is the datatype to use for in-memory storage of the image. This does not have to match the data type stored on disk for reading, but will be the type used for writing. |
Definition at line 83 of file fitsFile.hpp.
#include <ioutils/fits/fitsFile.hpp>
Public Member Functions | |
| fitsFile () | |
| Default constructor. | |
| fitsFile (error_t &errc) | |
| Default constructor with error code. | |
| fitsFile (const std::string &fname, error_t &errc) | |
| Constructor with file name and error code. | |
| fitsFile (const std::string &fname, bool doopen=true) | |
| Constructor with file name, and option to open. | |
| fitsFile (const std::string &fname, bool doopen, error_t &errc) | |
| Constructor with file name, option to open, and error code. | |
| ~fitsFile () | |
| Destructor. | |
| std::string | fileName () |
| Get the current value of m_fileName. | |
| error_t | fileName (const std::string &fname, bool doopen=true) |
| Set the file path, and optionally open the file. | |
| int | naxis () |
| Get the current value of m_naxis. | |
| long | naxes (int dim) |
| Get the current value of m_naxes for the specified dimension. | |
| error_t | open () |
| Open the file and gets its dimensions. | |
| error_t | open (const std::string &fname) |
| Open the file, first setting the file path. | |
| error_t | close () |
| Close the file. | |
| int | getDimensions (error_t &errc) |
| Get the number of dimensions (i.e. m_naxis). | |
| long | getSize (error_t &errc) |
| Get the total size. | |
| long | getSize (size_t axis, error_t &errc) |
| Get the size of a specific dimension. | |
Reading Eigen Arrays | |
These methods read FITS data into array types with an Eigen-like interface. | |
| template<typename arrT> | |
| error_t | read (arrT &data) |
| Read the contents of the FITS file into an Eigen array type (not a simple pointer). | |
| template<typename arrT> | |
| error_t | read (arrT &data, fitsHeader< verboseT > &head) |
| Read the contents of the FITS file into an Eigen array type (not a simple pointer). | |
| template<typename arrT> | |
| error_t | read (arrT &data, const std::string &fname) |
| Read the contents of the FITS file into an Eigen array type (not a simple pointer). | |
| template<typename arrT> | |
| error_t | read (arrT &data, fitsHeader< verboseT > &head, const std::string &fname) |
| Read the contents of the FITS file into an Eigen array type (not a simple pointer). | |
| template<typename cubeT> | |
| error_t | read (cubeT &cube, const std::vector< std::string > &flist, std::vector< fitsHeader< verboseT > > *heads=0) |
| Read data from a vector list of files into an image cube. | |
| template<typename cubeT> | |
| error_t | read (cubeT &cube, std::vector< fitsHeader< verboseT > > &heads, const std::vector< std::string > &flist) |
| Read data from a vector of files into an image cube with individual headers. | |
Reading Headers | |
| error_t | readHeader (fitsHeader< verboseT > &head) |
| Read the header from the fits file. | |
| error_t | readHeader (fitsHeader< verboseT > &head, const std::string &fname) |
| Read the header from the fits file. | |
| error_t | readHeader (std::vector< fitsHeader< verboseT > > &heads, const std::vector< std::string > &flist) |
| Read the headers from a list of FITS files. | |
Writing Basic Arrays | |
These methods write basic arrays specified by a pointer to FITS. | |
| error_t | write (const dataT *im, int d1, int d2, int d3, fitsHeader< verboseT > *head) |
| Write the contents of a raw array to the FITS file. | |
| error_t | write (const dataT *im, int d1, int d2, int d3) |
| Write the contents of a raw array to the FITS file. | |
| error_t | write (const dataT *im, int d1, int d2, int d3, fitsHeader< verboseT > &head) |
| Write the contents of a raw array to the FITS file. | |
| error_t | write (const std::string &fname, const dataT *im, int d1, int d2, int d3) |
| Write the contents of a raw array to the FITS file. | |
| error_t | write (const std::string &fname, const dataT *im, int d1, int d2, int d3, fitsHeader< verboseT > &head) |
| Write the contents of a raw array to the FITS file. | |
Writing Eigen Arrays | |
These methods write array types with an Eigen-like interface. | |
| template<typename arrT> | |
| error_t | write (const std::string &fname, const arrT &im) |
| Write the contents of an Eigen-type array to a FITS file. | |
| template<typename arrT> | |
| error_t | write (const std::string &fname, const arrT &im, fitsHeader< verboseT > &head) |
| Write the contents of an Eigen-type array to a FITS file. | |
Reading Subsets | |
It is often desirable to read only a subset of an image or images into memory. These methods allow you to specify this. | |
| void | setReadSize () |
| Set to read all the pixels in the file. | |
| void | setReadSize (long x0, long y0, long xpix, long ypix) |
| Set to read only a subset of the pixels in the file. | |
| void | setCubeReadSize () |
| Set to read all frames from a cube. | |
| void | setCubeReadSize (long z0, long zframes) |
| Set the number of frames to read from a cube. | |
Protected Member Functions | |
| void | construct () |
| One time initialization common to all constructors. | |
Protected Attributes | |
| std::string | m_fileName |
| The path to the file. | |
| fitsfile * | m_fptr { nullptr } |
| The cfitsio data structure. | |
| int | m_naxis { 0 } |
| The dimensions of the image (1D, 2D, or 3D). | |
| long | m_naxes [3] |
| The size of each dimension. | |
| bool | m_isOpen { false } |
| Flag indicating whether the file is open or not. | |
| dataT | m_nulval { 0 } |
| The value to replace null values with. | |
| int | m_anynul { 0 } |
| Records whether any null values were replaced. | |
| int | m_noComment { 0 } |
| Flag to control whether the comment string is read. | |
| long | m_x0 { -1 } |
| The starting x-pixel to read from. | |
| long | m_y0 { -1 } |
| The starting y-pixel to read from. | |
| long | m_xpix { -1 } |
| The number of x-pixels to read. | |
| long | m_ypix { -1 } |
| The number of y-pixels to read. | |
| long | m_z0 { -1 } |
| The starting frame to read from a cube. | |
| long | m_zframes { -1 } |
| The number of frames to read from a cube. | |
Reading Basic Arrays | |
These methods read FITS data into basic or raw arrays specified by a pointer. | |
| error_t | calcPixarrs (pixarrT &pixarr) |
| Fill in the read-size arrays for reading a subset (always used). | |
| error_t | read (dataT *data) |
| Read the contents of the FITS file into an array. | |
| error_t | read (dataT *data, fitsHeader< verboseT > &head) |
| Read the contents of the FITS file into an array. | |
| error_t | read (dataT *data, const std::string &fname) |
| Read the contents of the FITS file into an array. | |
| error_t | read (dataT *data, fitsHeader< verboseT > &head, const std::string &fname) |
| Read the contents of the FITS file into an array and read the header. | |
| error_t | read (dataT *im, const std::vector< std::string > &flist) |
| Read data from a vector list of files into an image cube. | |
| error_t | read (dataT *im, std::vector< fitsHeader< verboseT > > &heads, const std::vector< std::string > &flist) |
| Read data from a vector of files into an image cube with individual headers. | |
| mx::fits::fitsFile< dataT, verboseT >::fitsFile | ( | ) |
Default constructor.
Definition at line 712 of file fitsFile.hpp.
| mx::fits::fitsFile< dataT, verboseT >::fitsFile | ( | error_t & | errc | ) |
Default constructor with error code.
| [out] | errc | error_t code indicating success or error |
Definition at line 717 of file fitsFile.hpp.
References mx::noerror.
| mx::fits::fitsFile< dataT, verboseT >::fitsFile | ( | const std::string & | fname, |
| error_t & | errc ) |
Constructor with file name and error code.
The file is not opened.
| [in] | fname | File name to set on construction |
| [out] | errc | error_t code indicating success or error |
Definition at line 723 of file fitsFile.hpp.
References fileName(), and mx::internal::mxlib_error_report().
| mx::fits::fitsFile< dataT, verboseT >::fitsFile | ( | const std::string & | fname, |
| bool | doopen = true ) |
Constructor with file name, and option to open.
| [in] | fname | File name to set on construction |
| [in] | doopen | [optional] If true, then the file is opened (the default). |
Definition at line 730 of file fitsFile.hpp.
References fileName(), and mx::internal::mxlib_error_report().
| mx::fits::fitsFile< dataT, verboseT >::fitsFile | ( | const std::string & | fname, |
| bool | doopen, | ||
| error_t & | errc ) |
Constructor with file name, option to open, and error code.
| fname | File name to set on construction | |
| doopen | If true, then the file is opened (the default). | |
| [out] | errc | error_t code indicating success or error |
Definition at line 738 of file fitsFile.hpp.
References fileName(), and mx::internal::mxlib_error_report().
| mx::fits::fitsFile< dataT, verboseT >::~fitsFile | ( | ) |
Destructor.
Definition at line 746 of file fitsFile.hpp.
References close(), m_isOpen, and mx::internal::mxlib_error_report().
|
protected |
Fill in the read-size arrays for reading a subset (always used).
| [out] | pixarr | Populated with the allocated read-size arrays |
Definition at line 956 of file fitsFile.hpp.
References m_naxes, m_naxis, m_x0, m_xpix, m_y0, m_ypix, m_z0, m_zframes, mx::internal::mxlib_error_report(), and mx::noerror.
Referenced by read(), read(), read(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| error_t mx::fits::fitsFile< dataT, verboseT >::close | ( | ) |
Close the file.
Definition at line 851 of file fitsFile.hpp.
References mx::fits_status2error_t(), m_fileName, m_fptr, m_isOpen, mx::internal::mxlib_error_report(), and mx::noerror.
Referenced by ~fitsFile(), fileName(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and write().
|
protected |
One time initialization common to all constructors.
| std::string mx::fits::fitsFile< dataT, verboseT >::fileName | ( | ) |
Get the current value of m_fileName.
Definition at line 755 of file fitsFile.hpp.
References m_fileName.
Referenced by fitsFile(), fitsFile(), fitsFile(), open(), read(), read(), read(), read(), read(), read(), read(), readHeader(), readHeader(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), write(), and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::fileName | ( | const std::string & | fname, |
| bool | doopen = true ) |
Set the file path, and optionally open the file.
| fname | The new file name. |
| doopen | If true, then the file is opened (the default). |
Definition at line 761 of file fitsFile.hpp.
References close(), m_fileName, m_isOpen, mxlib_error_check, mx::noerror, and open().
| int mx::fits::fitsFile< dataT, verboseT >::getDimensions | ( | error_t & | errc | ) |
Get the number of dimensions (i.e. m_naxis).
Definition at line 873 of file fitsFile.hpp.
References mx::invalidconfig, m_isOpen, and m_naxis.
Referenced by mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| long mx::fits::fitsFile< dataT, verboseT >::getSize | ( | error_t & | errc | ) |
Get the total size.
Definition at line 885 of file fitsFile.hpp.
References mx::invalidconfig, m_isOpen, m_naxes, m_naxis, m_x0, m_xpix, m_y0, m_ypix, and mx::noerror.
Referenced by read(), read(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| long mx::fits::fitsFile< dataT, verboseT >::getSize | ( | size_t | axis, |
| error_t & | errc ) |
Get the size of a specific dimension.
Definition at line 921 of file fitsFile.hpp.
References mx::invalidarg, mx::invalidconfig, m_isOpen, m_naxes, m_naxis, m_x0, m_xpix, m_y0, m_ypix, and mx::noerror.
| long mx::fits::fitsFile< dataT, verboseT >::naxes | ( | int | dim | ) |
Get the current value of m_naxes for the specified dimension.
| [in] | dim | the dimension |
Definition at line 785 of file fitsFile.hpp.
References m_naxes, and m_naxis.
Referenced by mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| int mx::fits::fitsFile< dataT, verboseT >::naxis | ( | ) |
Get the current value of m_naxis.
Definition at line 779 of file fitsFile.hpp.
References m_naxis.
Referenced by mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| error_t mx::fits::fitsFile< dataT, verboseT >::open | ( | ) |
Open the file and gets its dimensions.
File name needs to already have been set. If the file has already been opened, this returns immediately with no re-open.
Definition at line 796 of file fitsFile.hpp.
References mx::fits_status2error_t(), mx::invalidconfig, m_fileName, m_fptr, m_isOpen, m_naxes, m_naxis, mx::internal::mxlib_error_report(), and mx::noerror.
Referenced by fileName(), read(), read(), readHeader(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| error_t mx::fits::fitsFile< dataT, verboseT >::open | ( | const std::string & | fname | ) |
Open the file, first setting the file path.
| fname | The name of the file to open. |
Definition at line 845 of file fitsFile.hpp.
References fileName(), and mxlib_error_return.
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | arrT & | data | ) |
Read the contents of the FITS file into an Eigen array type (not a simple pointer).
The type arrT can be any type with the following members defined:
| arrT | is the type of array, see requirements above. |
| [out] | data | is the array, which will be resized as necessary using its resize(int, int) member |
Definition at line 1264 of file fitsFile.hpp.
References calcPixarrs(), mx::fits_status2error_t(), mx::fits::fitsType(), m_anynul, m_fileName, m_fptr, m_isOpen, m_naxis, m_nulval, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, and open().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | arrT & | data, |
| const std::string & | fname ) |
Read the contents of the FITS file into an Eigen array type (not a simple pointer).
The type arrT can be any type with the following members defined:
| arrT | is the type of array, see requirements above. |
| [out] | data | is the array, which will be resized as necessary using its resize(int, int) member |
| [in] | fname | is the file path, which is passed to fileName |
Definition at line 1337 of file fitsFile.hpp.
References fileName(), mx::internal::mxlib_error_report(), mx::noerror, and read().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | arrT & | data, |
| fitsHeader< verboseT > & | head ) |
Read the contents of the FITS file into an Eigen array type (not a simple pointer).
The type arrT can be any type with the following members defined:
| arrT | is the type of array, see requirements above. |
| [out] | data | is the array, which will be resized as necessary using its resize(int, int) member |
| [out] | head | is a fitsHeader object which is passed to readHeader |
Definition at line 1317 of file fitsFile.hpp.
References mx::internal::mxlib_error_report(), mx::noerror, read(), and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | arrT & | data, |
| fitsHeader< verboseT > & | head, | ||
| const std::string & | fname ) |
Read the contents of the FITS file into an Eigen array type (not a simple pointer).
The type arrT can be any type with the following members defined:
| arrT | is the type of array, see requirements above. |
| [out] | data | the array, which will be resized as necessary using its resize(int, int) member |
| [out] | head | a fitsHeader object which is passed to readHeader |
| [in] | fname | the file path, which is passed to fileName |
Definition at line 1356 of file fitsFile.hpp.
References fileName(), mx::internal::mxlib_error_report(), mx::noerror, read(), and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | cubeT & | cube, |
| const std::vector< std::string > & | flist, | ||
| std::vector< fitsHeader< verboseT > > * | heads = 0 ) |
Read data from a vector list of files into an image cube.
The type cubeT can be any type with the following members defined:
| cubeT | is the type of array, see requirements above. |
| [out] | cube | A cube which will be resized using its resize(int, int, int) member. |
| [in] | flist | The list of files to read. |
| [out] | heads | [optional] A vector of fits headers, allocated to contain one per image. |
Definition at line 1382 of file fitsFile.hpp.
References calcPixarrs(), fileName(), mx::fits_status2error_t(), mx::fits::fitsType(), mx::invalidarg, m_anynul, m_fileName, m_fptr, m_nulval, mx::internal::mxlib_error_report(), mx::noerror, and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | cubeT & | cube, |
| std::vector< fitsHeader< verboseT > > & | heads, | ||
| const std::vector< std::string > & | flist ) |
Read data from a vector of files into an image cube with individual headers.
The type cubeT can be any type with the following members defined:
| cubeT | is the type of array, see requirements above. |
| [out] | cube | A cube which will be resized using its resize(int, int, int) member. |
| [out] | heads | The vector of fits headers, allocated to contain one per image. |
| [in] | flist | The list of files to read. |
Definition at line 1484 of file fitsFile.hpp.
References mxlib_error_return, and read().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | data | ) |
Read the contents of the FITS file into an array.
The array pointed to by data must have been allocated.
| [out] | data | an allocated arrray large enough to hold the entire image |
Definition at line 1045 of file fitsFile.hpp.
References calcPixarrs(), mx::fits_status2error_t(), mx::fits::fitsType(), m_anynul, m_fileName, m_fptr, m_isOpen, m_nulval, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, and open().
Referenced by mx::AO::applyPupil2Basis(), mx::AO::analysis::calculatedWFS< realT, iosT >::beta_p(), mx::AO::analysis::calculatedWFS< realT, iosT >::beta_r(), mx::AO::sim::pywfsSlopeReconstructor< _floatT >::calcMask(), mx::AO::sim::turbAtmosphere< _aoSystemT, _verboseT >::genLayers(), mx::AO::ifPInv(), mx::AO::sim::simulatedAOSystem< _realT, _wfsT, _reconT, _filterT, _dmT, _turbSeqT, _coronT >::initSystem(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::intensityPSD(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadApodizer(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadFocalMask(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadLyotStop(), mx::wfp::idealCoronagraph< _realT >::loadPupil(), mx::AO::sim::directPhaseReconstructor< realT >::loadRecon(), mx::AO::sim::pywfsSlopeReconstructor< _floatT >::loadRecon(), mx::AO::m2cMatrix(), mx::AO::makeZernikeBasis(), mx::AO::modalDMM2cMatrix(), mx::AO::modesOnDM(), mx::AO::orthogonalizeBasis(), read(), read(), read(), read(), read(), read(), read(), read(), read(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | data, |
| const std::string & | fname ) |
Read the contents of the FITS file into an array.
The array pointed to by data must have been allocated.
| [out] | data | is an allocated arrray large enough to hold the entire image |
| [in] | fname | is the file path, which is passed to fileName |
Definition at line 1088 of file fitsFile.hpp.
References fileName(), mxlib_error_check, mxlib_error_return, and read().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | data, |
| fitsHeader< verboseT > & | head ) |
Read the contents of the FITS file into an array.
The array pointed to by data must have been allocated.
| [out] | data | an allocated arrray large enough to hold the entire image |
| [out] | head | a fitsHeader object which is passed to readHeader |
Definition at line 1080 of file fitsFile.hpp.
References mxlib_error_check, mxlib_error_return, read(), and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | data, |
| fitsHeader< verboseT > & | head, | ||
| const std::string & | fname ) |
Read the contents of the FITS file into an array and read the header.
The array pointed to by data must have been allocated.
| [out] | data | an allocated arrray large enough to hold the entire image |
| [out] | head | a fitsHeader object which is passed to readHeader |
| [in] | fname | the file path, which is passed to fileName |
Definition at line 1096 of file fitsFile.hpp.
References fileName(), mxlib_error_check, mxlib_error_return, read(), and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | im, |
| const std::vector< std::string > & | flist ) |
Read data from a vector list of files into an image cube.
| [out] | im | An allocated array large enough to hold all the images |
| [in] | flist | The list of files to read. |
Definition at line 1106 of file fitsFile.hpp.
References fileName(), getSize(), mx::invalidarg, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, and read().
| error_t mx::fits::fitsFile< dataT, verboseT >::read | ( | dataT * | im, |
| std::vector< fitsHeader< verboseT > > & | heads, | ||
| const std::vector< std::string > & | flist ) |
Read data from a vector of files into an image cube with individual headers.
| [out] | im | An allocated array large enough to hold all the images |
| heads | [in/out] The vector of fits headers, allocated to contain one per image. | |
| [in] | flist | The list of files to read. |
Definition at line 1133 of file fitsFile.hpp.
References fileName(), getSize(), mx::invalidarg, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, read(), and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::readHeader | ( | fitsHeader< verboseT > & | head | ) |
Read the header from the fits file.
If head is not empty, then only the keywords already in head are updated. Otherwise the complete header is read.
| [out] | head | a fitsHeader object |
Definition at line 1492 of file fitsFile.hpp.
References mx::fits::fitsHeader< verboseT >::append(), mx::fits::fitsHeader< verboseT >::begin(), mx::fits::fitsHeader< verboseT >::end(), mx::fits::fitsHeader< verboseT >::erase(), mx::fits_status2error_t(), m_fileName, m_fptr, m_isOpen, m_noComment, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, open(), and mx::fits::fitsHeader< verboseT >::size().
Referenced by read(), read(), read(), read(), read(), read(), readHeader(), readHeader(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| error_t mx::fits::fitsFile< dataT, verboseT >::readHeader | ( | fitsHeader< verboseT > & | head, |
| const std::string & | fname ) |
Read the header from the fits file.
If head is not empty, then only the keywords already in head are updated. Otherwise the complete header is read.
| [out] | head | a fitsHeader object |
| [in] | fname | the file path, which is passed to fileName |
Definition at line 1605 of file fitsFile.hpp.
References fileName(), mxlib_error_check, mx::noerror, and readHeader().
| error_t mx::fits::fitsFile< dataT, verboseT >::readHeader | ( | std::vector< fitsHeader< verboseT > > & | heads, |
| const std::vector< std::string > & | flist ) |
Read the headers from a list of FITS files.
In each case, if the header is not empty then only the keywords already in head are updated. Otherwise the complete header is read.
| flist | A vector of fitsHeader objects to read into. [in] A list of files, each of which is passed to fileName |
Definition at line 1614 of file fitsFile.hpp.
References fileName(), mx::invalidarg, mxlib_error_check, mx::internal::mxlib_error_report(), mx::noerror, and readHeader().
| void mx::fits::fitsFile< dataT, verboseT >::setCubeReadSize | ( | ) |
Set to read all frames from a cube.
Definition at line 1792 of file fitsFile.hpp.
References m_z0, and m_zframes.
Referenced by mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| void mx::fits::fitsFile< dataT, verboseT >::setCubeReadSize | ( | long | z0, |
| long | zframes ) |
Set the number of frames to read from a cube.
| z0 | is the starting frame to read |
| zframes | is the number of frames to read |
Definition at line 1799 of file fitsFile.hpp.
| void mx::fits::fitsFile< dataT, verboseT >::setReadSize | ( | ) |
Set to read all the pixels in the file.
Definition at line 1774 of file fitsFile.hpp.
References m_x0, m_xpix, m_y0, and m_ypix.
Referenced by mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsFileTest::TEST_CASE().
| void mx::fits::fitsFile< dataT, verboseT >::setReadSize | ( | long | x0, |
| long | y0, | ||
| long | xpix, | ||
| long | ypix ) |
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const dataT * | im, |
| int | d1, | ||
| int | d2, | ||
| int | d3 ) |
Write the contents of a raw array to the FITS file.
| [in] | im | is the array |
| [in] | d1 | is the first dimension |
| [in] | d2 | is the second dimension |
| [in] | d3 | is the third dimenesion (minimum value is 1) |
Definition at line 1727 of file fitsFile.hpp.
References mxlib_error_return, and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const dataT * | im, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| fitsHeader< verboseT > & | head ) |
Write the contents of a raw array to the FITS file.
Note: the type of the array must match dataT
| [in] | im | is the array |
| [in] | d1 | is the first dimension |
| [in] | d2 | is the second dimension |
| [in] | d3 | is the third dimenesion (minimum value is 1) |
| [in] | head | is the header |
Definition at line 1733 of file fitsFile.hpp.
References mxlib_error_return, and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const dataT * | im, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| fitsHeader< verboseT > * | head ) |
Write the contents of a raw array to the FITS file.
| [in] | im | is the array |
| [in] | d1 | is the first dimension |
| [in] | d2 | is the second dimension |
| [in] | d3 | is the third dimenesion (minimum value is 1) |
| [in] | head | a pointer to the header. Set to 0 if not used. |
Definition at line 1640 of file fitsFile.hpp.
References mx::fits::fitsHeader< verboseT >::begin(), close(), mx::fits::fitsHeader< verboseT >::end(), mx::fits_status2error_t(), mx::fits::fitsBITPIX(), mx::fits::fitsType(), m_fileName, m_fptr, m_isOpen, m_naxes, m_naxis, mxlib_error_check, mx::internal::mxlib_error_report(), mxlib_error_return, and mx::noerror.
Referenced by mx::AO::sim::simulatedAOSystem< _realT, _wfsT, _reconT, _filterT, _dmT, _turbSeqT, _coronT >::~simulatedAOSystem(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), mx::AO::sim::pywfsSlopeReconstructor< _floatT >::calcMask(), mx::AO::circularApodizedPupil(), mx::AO::circularPupil(), mx::AO::analysis::fourierCovarMap(), mx::AO::sim::turbAtmosphere< _aoSystemT, _verboseT >::genLayers(), mx::AO::ifPInv(), mx::AO::influenceFunctionsGaussian(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::intensityPSD(), mx::AO::m2cMatrix(), mx::AO::makeModfBasis(), mx::AO::makeZernikeBasis(), mx::AO::modalDMM2cMatrix(), mx::AO::modesOnDM(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC(), mx::AO::orthogonalizeBasis(), mx::AO::sim::directPhaseReconstructor< realT >::saveRMat(), mx::AO::sim::pywfsSlopeReconstructor< _floatT >::saveRMat(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), mx::unitTest::fitsTest::fitsFileTest::TEST_CASE(), unitTest::ao_sim_pywfsSlopeReconstructor_test::TEST_CASE(), write(), write(), write(), write(), write(), and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const std::string & | fname, |
| const arrT & | im ) |
Write the contents of an Eigen-type array to a FITS file.
The type arrT can be any type with the following members defined:
Note: as with all write methods, the Scalar type of the array must match dataT
| arrT | is the type of array, see requirements above. |
| [in] | fname | is the name of the file. |
| [in] | im | is the array |
Definition at line 1757 of file fitsFile.hpp.
References mxlib_error_return, and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const std::string & | fname, |
| const arrT & | im, | ||
| fitsHeader< verboseT > & | head ) |
Write the contents of an Eigen-type array to a FITS file.
The type arrT can be any type with the following members defined:
Note: as with all write methods, the Scalar type of the array must match dataT
| arrT | is the type of array, see requirements above. |
| [in] | fname | is the file path, which is passed to fileName |
| [in] | im | is the array |
| [in] | head | is a fitsHeader object which is passed to readHeader |
Definition at line 1766 of file fitsFile.hpp.
References write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const std::string & | fname, |
| const dataT * | im, | ||
| int | d1, | ||
| int | d2, | ||
| int | d3 ) |
Write the contents of a raw array to the FITS file.
| [in] | fname | is the name of the file. |
| [in] | im | is the array |
| [in] | d1 | is the first dimension |
| [in] | d2 | is the second dimension |
| [in] | d3 | is the third dimenesion (minimum value is 1) |
Definition at line 1739 of file fitsFile.hpp.
References fileName(), mxlib_error_check, mxlib_error_return, and write().
| error_t mx::fits::fitsFile< dataT, verboseT >::write | ( | const std::string & | fname, |
| const dataT * | im, | ||
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| fitsHeader< verboseT > & | head ) |
Write the contents of a raw array to the FITS file.
| [in] | fname | is the name of the file. |
| [in] | im | is the array |
| [in] | d1 | is the first dimension |
| [in] | d2 | is the second dimension |
| [in] | d3 | is the third dimenesion (minimum value is 1) |
| [in] | head | is the header |
Definition at line 1747 of file fitsFile.hpp.
References fileName(), mxlib_error_check, mxlib_error_return, and write().
|
protected |
Records whether any null values were replaced.
Definition at line 111 of file fitsFile.hpp.
|
protected |
The path to the file.
Definition at line 93 of file fitsFile.hpp.
Referenced by close(), fileName(), fileName(), open(), read(), read(), read(), readHeader(), and write().
|
protected |
The cfitsio data structure.
Definition at line 96 of file fitsFile.hpp.
Referenced by close(), open(), read(), read(), read(), readHeader(), and write().
|
protected |
Flag indicating whether the file is open or not.
Definition at line 105 of file fitsFile.hpp.
Referenced by ~fitsFile(), close(), fileName(), getDimensions(), getSize(), getSize(), open(), read(), read(), readHeader(), and write().
|
protected |
The size of each dimension.
Definition at line 102 of file fitsFile.hpp.
Referenced by calcPixarrs(), getSize(), getSize(), naxes(), open(), and write().
|
protected |
The dimensions of the image (1D, 2D, or 3D).
Definition at line 99 of file fitsFile.hpp.
Referenced by calcPixarrs(), getDimensions(), getSize(), getSize(), naxes(), naxis(), open(), read(), and write().
|
protected |
Flag to control whether the comment string is read.
Definition at line 114 of file fitsFile.hpp.
Referenced by readHeader().
|
protected |
The value to replace null values with.
Definition at line 108 of file fitsFile.hpp.
|
protected |
The starting x-pixel to read from.
Definition at line 117 of file fitsFile.hpp.
Referenced by calcPixarrs(), getSize(), getSize(), setReadSize(), and setReadSize().
|
protected |
The number of x-pixels to read.
Definition at line 123 of file fitsFile.hpp.
Referenced by calcPixarrs(), getSize(), getSize(), setReadSize(), and setReadSize().
|
protected |
The starting y-pixel to read from.
Definition at line 120 of file fitsFile.hpp.
Referenced by calcPixarrs(), getSize(), getSize(), setReadSize(), and setReadSize().
|
protected |
The number of y-pixels to read.
Definition at line 126 of file fitsFile.hpp.
Referenced by calcPixarrs(), getSize(), getSize(), setReadSize(), and setReadSize().
|
protected |
The starting frame to read from a cube.
Definition at line 129 of file fitsFile.hpp.
Referenced by calcPixarrs(), setCubeReadSize(), and setCubeReadSize().
|
protected |
The number of frames to read from a cube.
Definition at line 132 of file fitsFile.hpp.
Referenced by calcPixarrs(), setCubeReadSize(), and setCubeReadSize().