Developer Application Interface (ARC API) v3.6.2
ARC, Inc. GenII/III Application Interface
|
#include <CArcFitsFile.h>
Public Member Functions | |
CArcFitsFile (void) | |
virtual | ~CArcFitsFile (void) |
std::string | getType (void) noexcept |
void | create (const std::filesystem::path &tFileName, const std::uint32_t uiCols, const std::uint32_t uiRows) |
void | create3D (const std::filesystem::path &tFileName, const std::uint32_t uiCols, const std::uint32_t uiRows) |
void | open (const std::filesystem::path &tFileName, arc::gen3::fits::e_ReadMode eMode=arc::gen3::fits::e_ReadMode::READMODE) |
void | close (void) noexcept |
std::unique_ptr< arc::gen3::CArcStringList > | getHeader (void) |
const std::string | getFileName (void) |
arc::gen3::fits::keywordValue_t | readKeyword (const std::string &sKey, arc::gen3::fits::e_Type eType) |
void | writeKeyword (const std::string &sKey, void *pValue, arc::gen3::fits::e_Type eType, const std::string &sComment="") |
void | updateKeyword (const std::string &sKey, void *pValue, arc::gen3::fits::e_Type eType, const std::string &sComment="") |
std::unique_ptr< arc::gen3::fits::CParam > | getParameters (void) |
std::uint32_t | getNumberOfFrames (void) |
std::uint32_t | getRows (void) |
std::uint32_t | getCols (void) |
std::uint32_t | getNAxis (void) |
std::uint32_t | getBitsPerPixel (void) |
void | generateTestData (void) |
void | reOpen (void) |
void | flush (void) |
void | compare (CArcFitsFile< T > &cFitsFile) |
void | reSize (const std::uint32_t uiCols, const std::uint32_t uiRows) |
void | write (T *pBuf) |
void | write (T *pBuf, const std::int64_t i64Bytes, const std::int64_t i64Pixel=1) |
void | writeSubImage (T *pBuf, const arc::gen3::fits::Point &lowerLeftPoint, const arc::gen3::fits::Point &upperRightPoint) |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > | readSubImage (arc::gen3::fits::Point lowerLeftPoint, arc::gen3::fits::Point upperRightPoint) |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > | read (void) |
void | read (T *pBuf, const std::uint32_t uiCols, const std::uint32_t uiRows) |
void | write3D (T *pBuf) |
void | reWrite3D (T *pBuf, const std::uint32_t uiImageNumber) |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > | read3D (const std::uint32_t uiImageNumber) |
fitsfile * | getBaseFile (void) |
std::uint32_t | maxTVal (void) |
![]() | |
virtual | ~CArcBase (void) |
Static Public Member Functions | |
static const std::string | version (void) noexcept |
static const std::string | cfitsioVersion (void) noexcept |
![]() | |
static const std::string | version (void) |
static void | zeroMemory (void *pDest, const std::size_t uiSize) |
static void | copyMemory (void *pDest, void *pSrc, const std::size_t uiSize) |
static void | throwOutOfRange (const std::string &sMethodName, const std::int32_t iLine, const std::uint32_t uiElement, std::pair< std::uint32_t, std::uint32_t > range) |
static void | throwOutOfRange (const std::string &sMethodName, const std::int32_t iLine, const std::string &sElement, const std::size_t uiSize) |
static void | throwNoDeviceError (const std::string &sMethodName, const std::int32_t iLine, const std::string &sMsg="") |
template<typename T = std::runtime_error> | |
static void | throwException (const std::string &sMethodName, const std::int32_t iLine, const std::string &sMsg) |
template<typename T = std::runtime_error> | |
static void | throwException (const std::string &sMethodName, const std::int32_t iLine, const char *pszFmt,...) |
template<typename ErrCode > requires std::is_integral_v<ErrCode> | |
static const std::string | getSystemMessage (ErrCode iCode) |
static std::int32_t | getSystemError (void) noexcept |
static std::unique_ptr< CArcStringList > | splitString (const std::string &sString, const char &zDelim=' ') |
static std::string | formatString (const char *pszFmt,...) |
static std::string | convertWideToAnsi (wchar_t wzString[]) noexcept |
static std::string | convertWideToAnsi (const std::wstring &wsString) |
static std::wstring | convertAnsiToWide (const char *pszString) |
static std::string | cmdToString (const std::uint32_t uiCmd) |
static std::string | cmdToString (const std::uint32_t uiReply, const std::initializer_list< std::uint32_t > &tCmdList) |
static std::string | setDots (std::string_view svText, const std::size_t uiMaxLength, const char szDot='.') |
template<typename T > | |
static std::string | iterToString (T *pBegin, T *pEnd, char zSeperator=' ') |
Additional Inherited Members | |
![]() | |
CArcBase (void)=default | |
CArcBase (const CArcBase &)=delete | |
CArcBase (CArcBase &&)=delete | |
CArcBase & | operator= (const CArcBase &)=delete |
CArcBase & | operator= (CArcBase &&)=delete |
![]() | |
static const std::string | m_sVersion |
ARC FITS file interface class. Utilizes the cfitsio library for all actions.
arc::gen3::CArcFitsFile< T >::CArcFitsFile | ( | void | ) |
Constructor Creates an empty FITS file object.
|
virtual |
Destructor
|
staticnoexcept |
Returns a textual representation of the cfitsio library version.
|
noexcept |
Closes the file.
void arc::gen3::CArcFitsFile< T >::compare | ( | CArcFitsFile< T > & | cFitsFile | ) |
Compares this file image data to another. This method does not check headers, except for size values.
cFitsFile | - A reference to another valid FITS file. |
void arc::gen3::CArcFitsFile< T >::create | ( | const std::filesystem::path & | tFileName, |
const std::uint32_t | uiCols, | ||
const std::uint32_t | uiRows | ||
) |
Creates a new single image file on disk with the specified image dimensions.
tFileName | - The new FITS file name. |
uiCols | - The image column size ( in pixels ). |
uiRows | - The image row size ( in pixels ). |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::create3D | ( | const std::filesystem::path & | tFileName, |
const std::uint32_t | uiCols, | ||
const std::uint32_t | uiRows | ||
) |
Creates a new data cube file on disk with the specified image dimensions.
tFileName | - The new FITS file name. |
uiCols | - The image column size ( in pixels ). |
uiRows | - The image row size ( in pixels ). |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::flush | ( | void | ) |
Causes all internal data buffers to write data to the disk file.
std::runtime_error | on error. |
void arc::gen3::CArcFitsFile< T >::generateTestData | ( | void | ) |
Generates a ramp test pattern image within the file. The size of the image is determined by the image dimensions supplied during the create() method call. This method is only valid for single image files.
std::runtime_error | on error. |
fitsfile * arc::gen3::CArcFitsFile< T >::getBaseFile | ( | void | ) |
Returns the underlying cfitsio file pointer.
std::uint32_t arc::gen3::CArcFitsFile< T >::getBitsPerPixel | ( | void | ) |
Returns the image bits-per-pixel value.
std::runtime_error | on error. |
std::uint32_t arc::gen3::CArcFitsFile< T >::getCols | ( | void | ) |
Returns the number of columns in the image.
std::runtime_error | on error. |
const std::string arc::gen3::CArcFitsFile< T >::getFileName | ( | void | ) |
Returns the file name.
std::runtime_error | on error. |
std::unique_ptr< arc::gen3::CArcStringList > arc::gen3::CArcFitsFile< T >::getHeader | ( | void | ) |
Returns the FITS header as a list of strings.
std::runtime_error | on error. |
std::uint32_t arc::gen3::CArcFitsFile< T >::getNAxis | ( | void | ) |
Returns the number of dimensions in the image.
std::runtime_error | on error. |
std::uint32_t arc::gen3::CArcFitsFile< T >::getNumberOfFrames | ( | void | ) |
Returns the number of frames. A single image file will return a value of 0.
std::runtime_error | on error. |
std::unique_ptr< arc::gen3::fits::CParam > arc::gen3::CArcFitsFile< T >::getParameters | ( | void | ) |
Returns the basic image parameters ( number of cols, rows, frames, dimensions and bits-per-pixel ).
std::runtime_error | on error. |
std::uint32_t arc::gen3::CArcFitsFile< T >::getRows | ( | void | ) |
Returns the number of rows in the image.
std::runtime_error | on error. |
|
noexcept |
Returns the class bits-per-pixel typename.
std::uint32_t arc::gen3::CArcFitsFile< T >::maxTVal | ( | void | ) |
Determines the maximum value for a specific data type. Example, for std::uint16_t: 2^16 = 65536.
void arc::gen3::CArcFitsFile< T >::open | ( | const std::filesystem::path & | tFileName, |
arc::gen3::fits::e_ReadMode | eMode = arc::gen3::fits::e_ReadMode::READMODE |
||
) |
Opens an existing file. Can be used to open a file containing a single image or data cube ( a file with multiple image planes ).
tFileName | - The file name. |
eMode | - The mode with which to open the file ( default = e_ReadMode::READMODE ). |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::read | ( | T * | pBuf, |
const std::uint32_t | uiCols, | ||
const std::uint32_t | uiRows | ||
) |
Read the image from a single image file into the specified user buffer.
pBuf | - The user supplied buffer. |
uiCols | - The buffer column length ( in pixels ). |
uiRows | - The buffer row length ( in pixels ). |
std::runtime_error | |
std::invalid_argument | |
std::length_error |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > arc::gen3::CArcFitsFile< T >::read | ( | void | ) |
Read the image from a single image file.
std::runtime_error | |
std::invalid_argument |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > arc::gen3::CArcFitsFile< T >::read3D | ( | const std::uint32_t | uiImageNumber | ) |
Reads an image from a data cube file.
uiImageNumber | - The image number. |
std::runtime_error | |
std::invalid_argument |
arc::gen3::fits::keywordValue_t arc::gen3::CArcFitsFile< T >::readKeyword | ( | const std::string & | sKey, |
arc::gen3::fits::e_Type | eType | ||
) |
Reads a keyword value from the header.
sKey | - A valid FITS keyword. |
eType | - The keyword value type. |
std::runtime_error | |
std::invalid_argument |
std::unique_ptr< T[], arc::gen3::fits::ArrayDeleter< T > > arc::gen3::CArcFitsFile< T >::readSubImage | ( | arc::gen3::fits::Point | lowerLeftPoint, |
arc::gen3::fits::Point | upperRightPoint | ||
) |
Reads a sub-image from a single image file.
lowerLeftPoint | - The lower left point { col, row } of the sub-image. |
upperRightPoint | - The upper right point { col, row } of the sub-image. |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::reOpen | ( | void | ) |
Effectively closes and re-opens the underlying disk file.
std::runtime_error | on error. |
void arc::gen3::CArcFitsFile< T >::reSize | ( | const std::uint32_t | uiCols, |
const std::uint32_t | uiRows | ||
) |
Resizes a single image file by modifying the NAXES keyword and increasing the image data portion of the file.
uiCols | - The number of cols the new FITS file will have. |
uiRows | - The number of rows the new FITS file will have. |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::reWrite3D | ( | T * | pBuf, |
const std::uint32_t | uiImageNumber | ||
) |
Re-writes an existing image in a data cube file. The image data MUST match in size to the exising images within the data cube.
pBuf | - The image buffer. Buffer access violation results in undefined behavior. |
uiImageNumber | - The number of the data cube image to replace. |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::updateKeyword | ( | const std::string & | sKey, |
void * | pValue, | ||
arc::gen3::fits::e_Type | eType, | ||
const std::string & | sComment = "" |
||
) |
Updates an existng header keyword.
'HIERARCH' keyword NOTE: This text will be prefixed to any keyword by the cfitsio library if the keyword is greater than 8 characters, which is the standard FITS keyword length. See the link below for details:
http://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/f_user/node28.html
sKey | - A valid FITS keyword. |
pValue | - A pointer to the keyword value. The value type is determined by the eType parameter. Must not equal nullptr. |
eType | - The keyword value type. |
sComment | - The optional header comment ( default = " " ). |
std::runtime_error | |
std::invalid_argument |
|
staticnoexcept |
Returns a textual representation of the library version.
void arc::gen3::CArcFitsFile< T >::write | ( | T * | pBuf | ) |
Writes image data to a single image file.
pBuf | - The image buffer to write. Buffer access violation results in undefined behavior. |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::write | ( | T * | pBuf, |
const std::int64_t | i64Bytes, | ||
const std::int64_t | i64Pixel = 1 |
||
) |
Writes the specified number of bytes to a single image file. The start position of the data within the file image can be specified.
pBuf | - The image buffer to write. Buffer access violation results in undefined behavior. |
i64Bytes | - The number of bytes to write. |
i64Pixel | - The start pixel within the file image. ( default = 1 ). |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::write3D | ( | T * | pBuf | ) |
Writes an image to the end of a data cube file.
pBuf | - The image buffer to write. Buffer access violation results in undefined behavior. |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::writeKeyword | ( | const std::string & | sKey, |
void * | pValue, | ||
arc::gen3::fits::e_Type | eType, | ||
const std::string & | sComment = "" |
||
) |
Writes a new keyword to the header.
'HIERARCH' keyword NOTE: This text will be prefixed to any keyword by the cfitsio library if the keyword is greater than 8 characters, which is the standard FITS keyword length. See the link below for details:
http://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/f_user/node28.html
sKey | - A valid FITS keyword. |
pValue | - A pointer to the keyword value. The value type is determined by the eType parameter. Cannot equal nullptr. |
eType | - The keyword value type. |
sComment | - The optional header comment ( default = " " ). |
std::runtime_error | |
std::invalid_argument |
void arc::gen3::CArcFitsFile< T >::writeSubImage | ( | T * | pBuf, |
const arc::gen3::fits::Point & | lowerLeftPoint, | ||
const arc::gen3::fits::Point & | upperRightPoint | ||
) |
Writes a sub-image of the specified buffer to a single image file.
pBuf | - The image buffer to write. Buffer access violation results in undefined behavior. |
lowerLeftPoint | - The lower left point { col, row } of the sub-image. |
upperRightPoint | - The upper right point { col, row } of the sub-image. |
std::runtime_error | |
std::invalid_argument |