casacore
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::FITSImgParser Class Reference

More...

#include <FITSImgParser.h>

Public Member Functions

 FITSImgParser (const String &name)
 Construct a parser from the FITS file. More...
 
 FITSImgParser (const FITSImgParser &other)
 Copy constructor (reference semantics). More...
 
 ~FITSImgParser ()
 Destructor, does not much. More...
 
FITSImgParseroperator= (const FITSImgParser &other)
 Assignment (reference semantics). More...
 
String fitsname (Bool stripPath=False) const
 Returns the name of the disk file. More...
 
Int get_index (const FITSExtInfo &extinfo)
 Identify the index of an extension. More...
 
Int find_extension (const String &extname, const Int &extversion=-1)
 Find an extension; return -1 if not found. More...
 
uInt get_firstdata_index (void)
 Get the index of the first extension with data. More...
 
uInt get_numhdu (void)
 Get the number of extensions. More...
 
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. More...
 
Bool has_qualityimg (void)
 Get the flag indicating at least one quality image. More...
 
Bool is_qualityimg (const String &extexpr)
 Check whether the extensions named in the extension expression can be loaded as a quality image. More...
 
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. More...
 

Private Member Functions

void setup (void)
 Setup the object (used by constructors). More...
 
void process_extension (HeaderDataUnit *h, const uInt &extindex)
 Get the information on an extension. More...
 
Bool get_extlist (const String &extexpr, Vector< String > &extlist)
 Extract the list of extensions from the extension expression. More...
 
Int get_dataindex (const Vector< Int > &extindex)
 Get the first extension with HDU type "data" from the list of indices. More...
 
String get_errorext (const Int &ext_index)
 Get the error extension name for the given data extension. More...
 
String get_maskext (const Int &ext_index)
 Get the mask extension name for the given data extension. More...
 
Bool confirm_fix_keywords (const Int &ext_index)
 Check the keywords with fixed values. More...
 
Bool index_is_HDUtype (const Int &ext_index, const String &hdutype)
 Check whether the extension has a certain HDU type. More...
 
Bool find_qualimgs (void)
 Find and store all set of extensions that can be loaded as a quality image. More...
 

Private Attributes

String name_p
 
uInt numhdu_p
 
FITSExtInfoextensions_p
 
Vector< Stringqualimglist_p
 
Bool hasmeasurement_p
 

Static Private Attributes

static const char * storeKwords_p []
 
static const int nKwords_p
 

Detailed Description

Class for handling FITS Image extensions

Intended use:

Public interface

Review Status

Test programs:
tFITSImgParser

Prerequisite

Etymology

This class parses through a FITS image and stores essential information for each extension.

Synopsis

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).

Example

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
FITSImgParser(const String &name)
Construct a parser from the FITS file.
unsigned int uInt
Definition: aipstype.h:51

Motivation

Investigate and select FITS extensions

Definition at line 88 of file FITSImgParser.h.

Constructor & Destructor Documentation

◆ FITSImgParser() [1/2]

casacore::FITSImgParser::FITSImgParser ( const String name)

Construct a parser from the FITS file.

◆ FITSImgParser() [2/2]

casacore::FITSImgParser::FITSImgParser ( const FITSImgParser other)

Copy constructor (reference semantics).

◆ ~FITSImgParser()

casacore::FITSImgParser::~FITSImgParser ( )

Destructor, does not much.

Member Function Documentation

◆ confirm_fix_keywords()

Bool casacore::FITSImgParser::confirm_fix_keywords ( const Int ext_index)
private

Check the keywords with fixed values.

◆ find_extension()

Int casacore::FITSImgParser::find_extension ( const String extname,
const Int extversion = -1 
)

Find an extension; return -1 if not found.

◆ find_qualimgs()

Bool casacore::FITSImgParser::find_qualimgs ( void  )
private

Find and store all set of extensions that can be loaded as a quality image.

◆ fitsname()

String casacore::FITSImgParser::fitsname ( Bool  stripPath = False) const

Returns the name of the disk file.

◆ get_dataindex()

Int casacore::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.

◆ get_errorext()

String casacore::FITSImgParser::get_errorext ( const Int ext_index)
private

Get the error extension name for the given data extension.

◆ get_extlist()

Bool casacore::FITSImgParser::get_extlist ( const String extexpr,
Vector< String > &  extlist 
)
private

Extract the list of extensions from the extension expression.

◆ get_extlist_string()

String casacore::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_firstdata_index()

uInt casacore::FITSImgParser::get_firstdata_index ( void  )

Get the index of the first extension with data.

◆ get_index()

Int casacore::FITSImgParser::get_index ( const FITSExtInfo extinfo)

Identify the index of an extension.

◆ get_maskext()

String casacore::FITSImgParser::get_maskext ( const Int ext_index)
private

Get the mask extension name for the given data extension.

◆ get_numhdu()

uInt casacore::FITSImgParser::get_numhdu ( void  )
inline

Get the number of extensions.

Definition at line 116 of file FITSImgParser.h.

References numhdu_p.

◆ get_quality_data()

Bool casacore::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.

◆ has_qualityimg()

Bool casacore::FITSImgParser::has_qualityimg ( void  )
inline

Get the flag indicating at least one quality image.

Definition at line 123 of file FITSImgParser.h.

References casacore::False, qualimglist_p, and casacore::True.

◆ index_is_HDUtype()

Bool casacore::FITSImgParser::index_is_HDUtype ( const Int ext_index,
const String hdutype 
)
private

Check whether the extension has a certain HDU type.

◆ is_qualityimg()

Bool casacore::FITSImgParser::is_qualityimg ( const String extexpr)

Check whether the extensions named in the extension expression can be loaded as a quality image.

◆ operator=()

FITSImgParser& casacore::FITSImgParser::operator= ( const FITSImgParser other)

Assignment (reference semantics).

◆ process_extension()

void casacore::FITSImgParser::process_extension ( HeaderDataUnit h,
const uInt extindex 
)
private

Get the information on an extension.

◆ setup()

void casacore::FITSImgParser::setup ( void  )
private

Setup the object (used by constructors).

Member Data Documentation

◆ extensions_p

FITSExtInfo* casacore::FITSImgParser::extensions_p
private

Definition at line 138 of file FITSImgParser.h.

◆ hasmeasurement_p

Bool casacore::FITSImgParser::hasmeasurement_p
private

Definition at line 141 of file FITSImgParser.h.

◆ name_p

String casacore::FITSImgParser::name_p
private

Definition at line 135 of file FITSImgParser.h.

◆ nKwords_p

const int casacore::FITSImgParser::nKwords_p
staticprivate

Definition at line 144 of file FITSImgParser.h.

◆ numhdu_p

uInt casacore::FITSImgParser::numhdu_p
private

Definition at line 136 of file FITSImgParser.h.

Referenced by get_numhdu().

◆ qualimglist_p

Vector<String> casacore::FITSImgParser::qualimglist_p
private

Definition at line 139 of file FITSImgParser.h.

Referenced by has_qualityimg().

◆ storeKwords_p

const char* casacore::FITSImgParser::storeKwords_p[]
staticprivate

Definition at line 143 of file FITSImgParser.h.


The documentation for this class was generated from the following file: