casa
$Rev:20696$
|
Class for handling FITS Image extensions. More...
#include <FITSImgParser.h>
Public Member Functions | |
FITSImgParser (const String &name) | |
Construct a parser from the FITS file. | |
FITSImgParser (const FITSImgParser &other) | |
Copy constructor (reference semantics). | |
~FITSImgParser () | |
Destructor, does not much. | |
FITSImgParser & | operator= (const FITSImgParser &other) |
Assignment (reference semantics). | |
String | fitsname (Bool stripPath=False) const |
Returns the name of the disk file. | |
Int | get_index (const FITSExtInfo &extinfo) |
Identify the index of an extension. | |
Int | find_extension (const String &extname, const Int &extversion=-1) |
Find an extension; return -1 if not found. | |
uInt | get_firstdata_index (void) |
Get the index of the first extension with data. | |
uInt | get_numhdu (void) |
Get the number of extensions. | |
String | get_extlist_string (const String &delimiter, const String &qualmarker="", const String &fitsmarker="", const Bool &listall=True) |
Get a string representation of the extension list. | |
Bool | has_qualityimg (void) |
Get the flag indicating at least one quality image. | |
Bool | is_qualityimg (const String &extexpr) |
Check whether the extensions named in the extension expression can be loaded as a quality image. | |
Bool | get_quality_data (const String &extexpr, Int &data_HDU, Int &error_HDU, String &error_type, Int &mask_HDU, String &mask_type, Int &mask_value) |
Find all necessary access information for the extensions to be loaded as a quality image. | |
Private Member Functions | |
void | setup (void) |
Setup the object (used by constructors). | |
void | process_extension (HeaderDataUnit *h, const uInt &extindex) |
Get the information on an extension. | |
Bool | get_extlist (const String &extexpr, Vector< String > &extlist) |
Extract the list of extensions from the extension expression. | |
Int | get_dataindex (const Vector< Int > &extindex) |
Get the first extension with HDU type "data" from the list of indices. | |
String | get_errorext (const Int &ext_index) |
Get the error extension name for the given data extension. | |
String | get_maskext (const Int &ext_index) |
Get the mask extension name for the given data extension. | |
Bool | confirm_fix_keywords (const Int &ext_index) |
Check the keywords with fixed values. | |
Bool | index_is_HDUtype (const Int &ext_index, const String &hdutype) |
Check whether the extension has a certain HDU type. | |
Bool | find_qualimgs (void) |
Find and store all set of extensions that can be loaded as a quality image. | |
Private Attributes | |
String | name_p |
uInt | numhdu_p |
FITSExtInfo * | extensions_p |
Vector< String > | qualimglist_p |
Bool | hasmeasurement_p |
Static Private Attributes | |
static const char * | storeKwords_p [] |
static const int | nKwords_p |
Class for handling FITS Image extensions.
Public interface
This class parses through a FITS image and stores essential information for each extension.
The class parses through a FITS image and extracts information on its extensions, e.g. the extension name and the extension version. It is possible to identify a certain extension and to get the its extension index.
It is also explored whether some of the FITS extensions can be loaded as a quality image (data + error + mask).
FITSImgParser fitsImg("in.fits"); uInt numHDU = fitsImg.get_numhdu(); // get the total number of HDU's uInt firstdata = fitsImg.get_firstdata_index(); // get the first HDU with data String allExts = fitsImg.get_extlist_string(String("\n")); // get a string representation of all extensions String hasQual = fitsImg.has_qualityimg(); // check whether some of the extensions form quality image
Investigate and select FITS extensions
Definition at line 87 of file FITSImgParser.h.
casa::FITSImgParser::FITSImgParser | ( | const String & | name | ) |
Construct a parser from the FITS file.
casa::FITSImgParser::FITSImgParser | ( | const FITSImgParser & | other | ) |
Copy constructor (reference semantics).
Destructor, does not much.
Bool casa::FITSImgParser::confirm_fix_keywords | ( | const Int & | ext_index | ) | [private] |
Check the keywords with fixed values.
Int casa::FITSImgParser::find_extension | ( | const String & | extname, |
const Int & | extversion = -1 |
||
) |
Find an extension; return -1 if not found.
Bool casa::FITSImgParser::find_qualimgs | ( | void | ) | [private] |
Find and store all set of extensions that can be loaded as a quality image.
String casa::FITSImgParser::fitsname | ( | Bool | stripPath = False | ) | const |
Returns the name of the disk file.
Int casa::FITSImgParser::get_dataindex | ( | const Vector< Int > & | extindex | ) | [private] |
Get the first extension with HDU type "data" from the list of indices.
Returns "-1" if there is none.
String casa::FITSImgParser::get_errorext | ( | const Int & | ext_index | ) | [private] |
Get the error extension name for the given data extension.
Bool casa::FITSImgParser::get_extlist | ( | const String & | extexpr, |
Vector< String > & | extlist | ||
) | [private] |
Extract the list of extensions from the extension expression.
String casa::FITSImgParser::get_extlist_string | ( | const String & | delimiter, |
const String & | qualmarker = "" , |
||
const String & | fitsmarker = "" , |
||
const Bool & | listall = True |
||
) |
Get a string representation of the extension list.
Get the index of the first extension with data.
Int casa::FITSImgParser::get_index | ( | const FITSExtInfo & | extinfo | ) |
Identify the index of an extension.
String casa::FITSImgParser::get_maskext | ( | const Int & | ext_index | ) | [private] |
Get the mask extension name for the given data extension.
uInt casa::FITSImgParser::get_numhdu | ( | void | ) | [inline] |
Bool casa::FITSImgParser::get_quality_data | ( | const String & | extexpr, |
Int & | data_HDU, | ||
Int & | error_HDU, | ||
String & | error_type, | ||
Int & | mask_HDU, | ||
String & | mask_type, | ||
Int & | mask_value | ||
) |
Find all necessary access information for the extensions to be loaded as a quality image.
Bool casa::FITSImgParser::has_qualityimg | ( | void | ) | [inline] |
Get the flag indicating at least one quality image.
Definition at line 122 of file FITSImgParser.h.
References casa::False, qualimglist_p, casa::ArrayBase::size(), and casa::True.
Bool casa::FITSImgParser::index_is_HDUtype | ( | const Int & | ext_index, |
const String & | hdutype | ||
) | [private] |
Check whether the extension has a certain HDU type.
Bool casa::FITSImgParser::is_qualityimg | ( | const String & | extexpr | ) |
Check whether the extensions named in the extension expression can be loaded as a quality image.
FITSImgParser& casa::FITSImgParser::operator= | ( | const FITSImgParser & | other | ) |
Assignment (reference semantics).
void casa::FITSImgParser::process_extension | ( | HeaderDataUnit * | h, |
const uInt & | extindex | ||
) | [private] |
Get the information on an extension.
void casa::FITSImgParser::setup | ( | void | ) | [private] |
Setup the object (used by constructors).
FITSExtInfo* casa::FITSImgParser::extensions_p [private] |
Definition at line 137 of file FITSImgParser.h.
Bool casa::FITSImgParser::hasmeasurement_p [private] |
Definition at line 140 of file FITSImgParser.h.
String casa::FITSImgParser::name_p [private] |
Definition at line 134 of file FITSImgParser.h.
const int casa::FITSImgParser::nKwords_p [static, private] |
Definition at line 143 of file FITSImgParser.h.
uInt casa::FITSImgParser::numhdu_p [private] |
Definition at line 135 of file FITSImgParser.h.
Referenced by get_numhdu().
Vector<String> casa::FITSImgParser::qualimglist_p [private] |
Definition at line 138 of file FITSImgParser.h.
Referenced by has_qualityimg().
const char* casa::FITSImgParser::storeKwords_p[] [static, private] |
Definition at line 142 of file FITSImgParser.h.