SDDIndex.h

Classes

SDDIndexRep -- SDDIndexRep is the individual index field in an SDDIndex (full description)
SDDIndex -- SDDIndex is the index of an SDDFile, a set of SDDIndexReps (full description)

class SDDIndexRep

Interface

Public Members
SDDIndexRep()
SDDIndexRep(const SDDIndexRep& other)
~SDDIndexRep()
SDDIndexRep& operator=(const SDDIndexRep& other)
Bool operator==(const SDDIndexRep& other) const
Bool operator!=(const SDDIndexRep& other) const
Bool hasChanged() const
void clearChangeFlag()
uInt firstRecord() const
void setFirstRecord(uInt recnum)
uInt nRecords() const
void setnRecords(uInt nrecs)
Float hCoord() const
void sethCoord(Float hpos)
Float vCoord() const
void setvCoord(Float vpos)
String coordSys() const
uShort coordCode() const
void setcoordSys(const String& new_coordSys)
void setcoordSys(uShort new_coordCode)
String source() const
void setsource(const String& new_source)
uInt scan() const
void setscan(uInt newScan)
uInt subScan() const
void setsubScan(uInt newSubScan)
Float freqResolution() const
void setfreqResolution(Float new_freqRes)
Float slewRate() const
void setslewRate(Float new_slewRate)
Double restFrequency() const
void setrestFrequency(Double new_restFreq)
Double intTimePerPoint() const
void setintTimePerPoint(Double new_intTime)
Float lst() const
void setlst(float new_lst)
Time utDate() const
void setutDate(const Time& new_utDate)
String mode() const
uShort modeCode() const
void setmode(const String& new_mode)
void setmode(uShort new_modeCode)
Int record() const
void setrecord(Int new_record)
Int intPhase() const
void setintPhase(Int new_intPhase)
Bool isLine() const
void setLine()
void setCont()
Private Members
void init_maps()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Member Description

SDDIndexRep()

construct an empty index entry

SDDIndexRep(const SDDIndexRep& other)

construct one from another

~SDDIndexRep()

SDDIndexRep& operator=(const SDDIndexRep& other)

assinment operator, true copy

Bool operator==(const SDDIndexRep& other) const

operator== returns True if EVERY value of this is the same as other

Bool operator!=(const SDDIndexRep& other) const

operator!= returns False if ANY value of this is not the same as other

Bool hasChanged() const

returns True if this IndexRep has changed remains True until a clearChangeFlag has been called

void clearChangeFlag()

uInt firstRecord() const

these function return the values stored in this index entry The starting record for this scan - 0 relative

void setFirstRecord(uInt recnum)

uInt nRecords() const

The total number of records used for this scan

void setnRecords(uInt nrecs)

Float hCoord() const

the Coordinates of this scan in the indicated coordinate system Units are radians. The coordinate system is the 8 character unipops coordinate string.

void sethCoord(Float hpos)

Float vCoord() const

void setvCoord(Float vpos)

String coordSys() const

uShort coordCode() const

void setcoordSys(const String& new_coordSys)

If there are not exactly 8 chars in the new coordSys or the coordSys string is unrecognized, it is set to the null string

void setcoordSys(uShort new_coordCode)

String source() const

The source name, must be less than 16 characters

void setsource(const String& new_source)

If there are more than 16 characters, they are not used

uInt scan() const

The scan number, must be less than 100000

void setscan(uInt newScan)

If it is out of range, it gets set to zero (unused)

uInt subScan() const

The subscan number, must be between 1 and 99

void setsubScan(uInt newSubScan)

If it is out of range, it and scan are set to zero (unused)

Float freqResolution() const

For LINE scans (isLine() is True) freqResolution and restFrequency are available. For CONT scans (isLine() is False), slewRate and intTimePerPoint are available. If a value is not-available - an IEEE NaN is returned. If an attempt is made to set something that isn't otherwise available, that will switch the type (i.e. setting slewRate while isLine() is True changes isLine() to False). Any values currently stored in the now unavailable locations are lost (i.e. if slewRate is set, any value in freqResolution and restFrequency is permanently lost).

void setfreqResolution(Float new_freqRes)

Float slewRate() const

void setslewRate(Float new_slewRate)

Double restFrequency() const

void setrestFrequency(Double new_restFreq)

Double intTimePerPoint() const

void setintTimePerPoint(Double new_intTime)

Float lst() const

LST in hours

void setlst(float new_lst)

Time utDate() const

UT data as a Time object

void setutDate(const Time& new_utDate)

String mode() const

The 4 character observing mode

uShort modeCode() const

void setmode(const String& new_mode)

If the mode is not recognized it is set to the null string

void setmode(uShort new_modeCode)

Int record() const

For RECORDS data (currently only available for GB data) this returns the record number for the indexed data. A negative number implies that this is not records data and also turns off intPhase (loosing any current value)

void setrecord(Int new_record)

Int intPhase() const

Also for RECORDS data, this returns the integration phase number for the indexed data. It must be less than 64. A negative number implies that this is not records data and also turns off record (loosing any current value) Attempting to set this to an invalid number (>=64) is equivalent to setting it to a negative number.

void setintPhase(Int new_intPhase)

Bool isLine() const

Returns TRUE if this indexes spectral line data otherwise False

void setLine()

change this entry to be a spectral line entry This looses any current value of slewRate or intTimePerPoint

void setCont()

change this entry to be a continuum entry This looses any current value of freqResolution or restFrequency

void init_maps()


class SDDIndex

Types

enum ShortFields

OLD_FIRST = 0
OLD_LAST = 1
OLD_MAGIC = 2
OLD_POSCODE = 3
not used
OBSMODE = 28
RECORD_PHASE = 29
NEW_POSCODE = 30

enum IntFields

NEW_FIRST = 0
NEW_LAST = 1

enum FloatFields

HCOORD = 2
VCOORD = 3
SCAN_NUMBER = 8
FRES_SLEWRATE = 9
LST = 12
UTDATE = 13

enum DoubleFields

RESTF_INTTIME = 5

enum CharFields

SOURCE = 16

Interface

Public Members
SDDIndex(const SDDBootStrap& bs)
SDDIndex(const SDDIndex& other)
~SDDIndex()
SDDIndex& operator=(const SDDIndex& other)
Bool fullUpdate()
Bool incrementalUpdate()
void attach(const SDDBootStrap& bs)
void write()
void write(uInt firstEntry, uInt nEntries = 1)
SDDIndexRep& operator()(uInt entry)
const SDDIndexRep& operator()(uInt entry) const
const SDDBootStrap& bootstrap() const
SDDBootStrap& bootstrap()
Fallible<uInt> maxEntryInUse() const
uInt nrEntry() const
Bool inUse(uInt entry) const
void clear(uInt entry)
void setVersion(SDDBootStrap::SDD_VERSION newVersion)
Private Members
void flush()
void readEntry(SDDIndexRep& rep, uInt entry)
void writeEntry(SDDIndexRep& rep, uInt entry)
Char& valueRef(CharFields field, uInt entry, uInt position)
const Char& valueRef(CharFields field, uInt entry, uInt position) const
Short& valueRef(ShortFields field, uInt entry)
const Short& valueRef(ShortFields field, uInt entry) const
Int& valueRef(IntFields field, uInt entry)
const Int& valueRef(IntFields field, uInt entry) const
float& valueRef(FloatFields field, uInt entry)
const float& valueRef(FloatFields field, uInt entry) const
double& valueRef(DoubleFields field, uInt entry)
const double& valueRef(DoubleFields field, uInt entry) const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Member Description

SDDIndex(const SDDBootStrap& bs)

construct index from an SDDbootStrap - reads from file if present

SDDIndex(const SDDIndex& other)

copy constructor

~SDDIndex()

clean up the pointers

SDDIndex& operator=(const SDDIndex& other)

assignment operator, true copy

Bool fullUpdate()

For both types of update, if the boostrap block is the same, nothing actually changes in the index. Each returns True if an actual update occured and false if things remain the same. do a full update from the disk file

Bool incrementalUpdate()

do an incremental update : assumes that the file has mearly grown Attempts to verify that assumption by checking the values of the last 8 known index entries with their counterparts on disk and verifying that they are still the same. Return True if incremental was the correct model (or nothing has changed) Returns False if incremental was NOT the correct model, a fullUpdate could then be tried if desirable

void attach(const SDDBootStrap& bs)

attach to a new file via an SDDBooStrap

void write()

write the full index to the attached file

void write(uInt firstEntry, uInt nEntries = 1)

write nEntries entries starting with firstEntry

SDDIndexRep& operator()(uInt entry)

Return a reference to SDDIndexRep

const SDDIndexRep& operator()(uInt entry) const

const SDDBootStrap& bootstrap() const

Return a reference to the Bootstrap

SDDBootStrap& bootstrap()

Fallible<uInt> maxEntryInUse() const

max entry in use, invalid if non in use

uInt nrEntry() const

number of available entries

Bool inUse(uInt entry) const

check if an entry is in use (non-zero scan number)

void clear(uInt entry)

set everything in an entry to 0

void setVersion(SDDBootStrap::SDD_VERSION newVersion)

switch version

enum ShortFields

enum IntFields

enum FloatFields

enum DoubleFields

enum CharFields

void flush()

void readEntry(SDDIndexRep& rep, uInt entry)

void writeEntry(SDDIndexRep& rep, uInt entry)

Char& valueRef(CharFields field, uInt entry, uInt position)

const Char& valueRef(CharFields field, uInt entry, uInt position) const

Short& valueRef(ShortFields field, uInt entry)

const Short& valueRef(ShortFields field, uInt entry) const

Int& valueRef(IntFields field, uInt entry)

const Int& valueRef(IntFields field, uInt entry) const

float& valueRef(FloatFields field, uInt entry)

const float& valueRef(FloatFields field, uInt entry) const

double& valueRef(DoubleFields field, uInt entry)

const double& valueRef(DoubleFields field, uInt entry) const