GBTFITSBase.h

Classes

GBTFITSBase -- A base class for GBT FITS files - primary keywords. (full description)

class GBTFITSBase

Interface

Public Members
GBTFITSBase()
GBTFITSBase(const GBTFITSBase &other)
virtual ~GBTFITSBase()
GBTFITSBase &operator=(const GBTFITSBase &other)
virtual Bool attach(const String &fitsFile) = 0
virtual Bool isAttached() const
virtual const String &file() const = 0
virtual Bool setPrimaryKeys(const Record &keys, Bool scanlog = False)
virtual const Record &primaryKeys() const
virtual const Vector<Bool> &usedPrimaryKeys() const
virtual Bool markAsUsed(const String &keywordName)
virtual Record unusedPrimaryKeys() const
virtual const String &origin() const
virtual const String &instrume() const
virtual const String &mcVersion() const
virtual const String &fitsVers() const
virtual Int baseVersion() const
virtual Int deviceVersion() const
virtual const String &datebld() const
virtual Bool simulate() const
virtual const MEpoch &dateObs() const
virtual const String &telescop() const
virtual const String &object() const
virtual const String &projid() const
virtual const String &obsid() const
virtual Int scan() const
static Int stringToInt(const String &str)
static Double stringToDouble(const String &str)
static Table *tableFromFITS(FITSTable &fits)
Private Members
void init()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

GBT FITS files have several required keywords common to all of them. This class provides access to those fields and provides default values for older FITS files where the required keywords were not present. Specific classes for specific types of GBT FITS files are derived from this class. Only the record of keywords from the primary HDU are decoded here.

Thrown Exceptions

To Do

Member Description

GBTFITSBase()

This constructs a GBTFITSBase that has no primary keywords.

GBTFITSBase(const GBTFITSBase &other)

Copy constructor.

virtual ~GBTFITSBase()

GBTFITSBase &operator=(const GBTFITSBase &other)

Assignment operator, copy semantics.

virtual Bool attach(const String &fitsFile) = 0

attach this object to a new FITS file. If there are problems with the file, the return value is False and appropriate warnings are sent to the logger. The resulting object is not attached to any file.

virtual Bool isAttached() const

Is this object attached to a FITS file. This base class is never attached to a file.

virtual const String &file() const = 0

The name of the attached FITS file. Returns an empty string if it is not attached.

virtual Bool setPrimaryKeys(const Record &keys, Bool scanlog = False)

Attach this base class to a new primary keyword record. This resets all of the internals (including usedPrimaryKeys()). Usually, a derived classes implementation of attach() will invoke this function at some point. Returns false if any of the expected keywords for this FITSVER were not found. If scanlog is True, then the more limited set of keywords for the scanlog will be expected.

virtual const Record &primaryKeys() const

The record containing the primary keywords.

virtual const Vector<Bool> &usedPrimaryKeys() const

A vector indicating which keywords in primaryKeys() have been used so (either by this base class or by a derived class). The index here is the fieldNumber of the desired key. If that element is True, its value has been used. Standard keywords required by the FITS standard (e.g. SIMPLE, BITPIX, NAXIS, EXTEND, and END) are always marked as used.

virtual Bool markAsUsed(const String &keywordName)

Mark the indicated keyword as being used. Returns False if the keyword is not found.

virtual Record unusedPrimaryKeys() const

Returns a record containing just the unused keywords.

virtual const String &origin() const

ORIGIN - where this file originated. Default value: "NRAO Green Bank"

virtual const String &instrume() const

INSTRUME - device or program of origin. Default value: empty string.

virtual const String &mcVersion() const

GBTMCVER - telescope control software release Default value: empty string.

virtual const String &fitsVers() const

FITSVER - FITS definition version for this device. Default value: "0.0"

virtual Int baseVersion() const

Leading integer (before decimal) in FITSVER - version of base class.

virtual Int deviceVersion() const

Trailing integer (after decimal) in FITS - version of device.

virtual const String &datebld() const

DATEBLD - time program was linked Default value: empty string.

virtual Bool simulate() const

SIMULATE - is the instrument in simulate mode? Default value: F

virtual const MEpoch &dateObs() const

DATE-OBS - Manager parameter startTime Default value: MEpoch(0, MEpoch::Ref(MEpoch::UTC)) This also uses the TIMESYS keyword when present (UTC is assumed if not)

virtual const String &telescop() const

TELESCOP - green bank telescope Default value: GBT. The string NRAO_GBT is changed to GBT for use within AIPS++.

virtual const String &object() const

OBJECT - source Default value: empty string.

virtual const String &projid() const

PROJID - project ID Default value: empty string.

virtual const String &obsid() const

OBSID - scan id Default value: empty string.

virtual Int scan() const

SCAN - scan number Default value: -1

static Int stringToInt(const String &str)

utility method to convert strings to integers

static Double stringToDouble(const String &str)

utility method to convert strings to doubles

static Table *tableFromFITS(FITSTable &fits)

utility to construct a scratch table from a FITSTable. It is the responsibility of the calling entity to delete the returned pointer.

void init()

fill in the default values, clean up internals