GBTMSSpecWinFiller.h

Classes

GBTMSSpecWinFiller -- GBTMSSpecWinFiller fills the MSSpectralWindow table for GBT fillers (full description)

class GBTMSSpecWinFiller

Interface

Public Members
GBTMSSpecWinFiller()
GBTMSSpecWinFiller(MSSpectralWindow &msSpecWin)
~GBTMSSpecWinFiller()
void attach(MSSpectralWindow &msSpecWin)
Int fill(uInt nfreq, Double centerFreq, Double centerChan, Double chanWidth, centerChan::Types restFrame = centerChan::TOPO, Double tolerance=10.0, const restFrame<Int> &exclude = restFrame<Int>())
void fill(uInt nreceivers, uInt nfreq)
Int spectralWindowId(uInt whichReceiver) const
const Vector<Int> &spectralWindowIds() const
Int nrec() const
Int nfreq() const
void setCacheSize(uInt newCacheSize)
uInt getCacheSize() const
void flush()
Private Members
void init(MSSpectralWindow &msSpecWin)
Int newSpecWin(Int nfreq, Double obsfreq, Double freqres, Double refchan, Double bw, Int restframe)
GBTMSSpecWinFiller(const GBTMSSpecWinFiller &other)
void operator=(const GBTMSSpecWinFiller &other)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class puts GBT data (fills) into the MSSpectralWindow table.

Synopsis

This class puts the appropriate values for the GBT in an MSSpectralWindow table (which has been previously created as part of a MeasurementSet). On each fill() any necessary additions to the MSSpectralWindow are made. This filler keeps a certain number of the most spectral window IDs and the information that makes them unique in a cache. If a new set of information matches that cached information, that ID is reused, otherwise new rows are added to the MSSpectralWindow table.

In principle, the number of spectral window Id may vary with the the number of receivers in the backend (at least, thats the idea so far).

The specWinId is available to be used by other GBTMS*Fillers as other subtables are filled in turn.

Example

Motivation

Writing a filler is a daunting task. There are various dependencies between the subtables. It helps to encapsulate the knowlege and task of filling a specific subtable to separate classes.

Member Description

GBTMSSpecWinFiller()

The default ctor. No MSSpectralWindow table has been attached yet. Calling fill on such a filler will throw an exception. It is present so that this object can be instantiated before an MSSpecWin has been created.

GBTMSSpecWinFiller(MSSpectralWindow &msSpecWin)

A filler attached to an MSSpectralWindow table

~GBTMSSpecWinFiller()

void attach(MSSpectralWindow &msSpecWin)

attach it to an MSSpectralWindow

Int fill(uInt nfreq, Double centerFreq, Double centerChan, Double chanWidth, centerChan::Types restFrame = centerChan::TOPO, Double tolerance=10.0, const restFrame<Int> &exclude = restFrame<Int>())

fill using the indicated frequency axis description returns the SPECTRAL_WINDOW_ID associated with this call to fill. The tolerance is in Hz. If this SW is within tolerance of an already existing SW and the chanWidths are the same, that existing SW will be re-used. SPWs in the exclude vector will not be used (that is used elsewhere to guarantee unique spws even when they would otherwise match an existing spw).

void fill(uInt nreceivers, uInt nfreq)

fill a dummy (no spectral information actually present) row this is necessary until the IF manager is sufficient to supply frequency information for all of the backends.

Int spectralWindowId(uInt whichReceiver) const

What is the spectral window ID associated with the indicated receiver Returns -1 if there is no association yet

const Vector<Int> &spectralWindowIds() const

Return a vector of the spectral window Ids for each receiver

Int nrec() const

The number of receivers which currently have known spectral window Ids from the last fill().

Int nfreq() const

void setCacheSize(uInt newCacheSize)

set the cache size - max number of spectral window IDs and their associate information to keep, this always re-initializes the cache from the SPECTRAL_WINDOW table making it expensive to use.

uInt getCacheSize() const

get the cache size

void flush()

flush the underlying MS subtable

void init(MSSpectralWindow &msSpecWin)

initialize the above for the first time

Int newSpecWin(Int nfreq, Double obsfreq, Double freqres, Double refchan, Double bw, Int restframe)

add a new row to the spectral window table using these value return the new row number

GBTMSSpecWinFiller(const GBTMSSpecWinFiller &other)

undefined and unavailable

void operator=(const GBTMSSpecWinFiller &other)