casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
GBTMSSpecWinFiller Class Reference

GBTMSSpecWinFiller fills the MSSpectralWindow table for GBT fillers. More...

#include <GBTMSSpecWinFiller.h>

List of all members.

Public Member Functions

 GBTMSSpecWinFiller ()
 The default ctor.
 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, MFrequency::Types restFrame=MFrequency::TOPO, Double tolerance=10.0, const Vector< Int > &exclude=Vector< Int >())
 fill using the indicated frequency axis description returns the SPECTRAL_WINDOW_ID associated with this call to fill.
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

Private Member Functions

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)

Private Attributes

MSSpectralWindow * msSpecWin_p
MSSpWindowColumns * msSpecWinCols_p
Vector< Int > specWinIds_p
 The current Ids.
Int nfreq_p
 from the last fill
Table * theCache_p
 the table holding the cache, its temporary
TableColumn idCacheCol_p
 the columns in the cache
TableColumn nfreqCacheCol_p
TableColumn obsfreqCacheCol_p
TableColumn freqresCacheCol_p
TableColumn refchanCacheCol_p
TableColumn bwCacheCol_p
TableColumn restFrameCacheCol_p
ColumnsIndex * cacheIndx_p
 The ColumnsIndex for the cache.
RecordFieldPtr< Int > nfreqKey_p
 The pointers to the fields in the index key.
RecordFieldPtr< Int > restFrameKey_p
RecordFieldPtr< Double > refchanKey_p
uInt nextCacheRow_p
 The next row number to get trashed in the cache when a new ID is generated.
uInt cacheSize_p
 The maximum number of rows in the cache (cache size)

Detailed Description

GBTMSSpecWinFiller fills the MSSpectralWindow table for GBT fillers.

Intended use:

Internal

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.

Definition at line 99 of file GBTMSSpecWinFiller.h.


Constructor & Destructor Documentation

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::GBTMSSpecWinFiller ( MSSpectralWindow &  msSpecWin)

A filler attached to an MSSpectralWindow table.

undefined and unavailable


Member Function Documentation

void GBTMSSpecWinFiller::attach ( MSSpectralWindow &  msSpecWin)

attach it to an MSSpectralWindow

Int GBTMSSpecWinFiller::fill ( uInt  nfreq,
Double  centerFreq,
Double  centerChan,
Double  chanWidth,
MFrequency::Types  restFrame = MFrequency::TOPO,
Double  tolerance = 10.0,
const Vector< Int > &  exclude = Vector< 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 GBTMSSpecWinFiller::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.

void GBTMSSpecWinFiller::flush ( ) [inline]

flush the underlying MS subtable

Definition at line 156 of file GBTMSSpecWinFiller.h.

References msSpecWin_p.

uInt GBTMSSpecWinFiller::getCacheSize ( ) const [inline]

get the cache size

Definition at line 153 of file GBTMSSpecWinFiller.h.

References cacheSize_p.

void GBTMSSpecWinFiller::init ( MSSpectralWindow &  msSpecWin) [private]

initialize the above for the first time

Int GBTMSSpecWinFiller::newSpecWin ( Int  nfreq,
Double  obsfreq,
Double  freqres,
Double  refchan,
Double  bw,
Int  restframe 
) [private]

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

Int GBTMSSpecWinFiller::nfreq ( ) const [inline]

Definition at line 144 of file GBTMSSpecWinFiller.h.

References nfreq_p.

Int GBTMSSpecWinFiller::nrec ( ) const [inline]

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

Definition at line 142 of file GBTMSSpecWinFiller.h.

References specWinIds_p.

void GBTMSSpecWinFiller::operator= ( const GBTMSSpecWinFiller other) [private]
void GBTMSSpecWinFiller::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.

Int GBTMSSpecWinFiller::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>& GBTMSSpecWinFiller::spectralWindowIds ( ) const [inline]

Return a vector of the spectral window Ids for each receiver.

Definition at line 138 of file GBTMSSpecWinFiller.h.

References specWinIds_p.


Member Data Documentation

TableColumn GBTMSSpecWinFiller::bwCacheCol_p [private]

Definition at line 172 of file GBTMSSpecWinFiller.h.

ColumnsIndex* GBTMSSpecWinFiller::cacheIndx_p [private]

The ColumnsIndex for the cache.

Definition at line 177 of file GBTMSSpecWinFiller.h.

The maximum number of rows in the cache (cache size)

Definition at line 188 of file GBTMSSpecWinFiller.h.

Referenced by getCacheSize().

Definition at line 172 of file GBTMSSpecWinFiller.h.

TableColumn GBTMSSpecWinFiller::idCacheCol_p [private]

the columns in the cache

Definition at line 172 of file GBTMSSpecWinFiller.h.

MSSpectralWindow* GBTMSSpecWinFiller::msSpecWin_p [private]

Definition at line 159 of file GBTMSSpecWinFiller.h.

Referenced by flush().

MSSpWindowColumns* GBTMSSpecWinFiller::msSpecWinCols_p [private]

Definition at line 160 of file GBTMSSpecWinFiller.h.

The next row number to get trashed in the cache when a new ID is generated.

Definition at line 185 of file GBTMSSpecWinFiller.h.

from the last fill

Definition at line 166 of file GBTMSSpecWinFiller.h.

Referenced by nfreq().

TableColumn GBTMSSpecWinFiller::nfreqCacheCol_p [private]

Definition at line 172 of file GBTMSSpecWinFiller.h.

RecordFieldPtr<Int> GBTMSSpecWinFiller::nfreqKey_p [private]

The pointers to the fields in the index key.

Definition at line 180 of file GBTMSSpecWinFiller.h.

Definition at line 172 of file GBTMSSpecWinFiller.h.

Definition at line 172 of file GBTMSSpecWinFiller.h.

RecordFieldPtr<Double> GBTMSSpecWinFiller::refchanKey_p [private]

Definition at line 181 of file GBTMSSpecWinFiller.h.

Definition at line 172 of file GBTMSSpecWinFiller.h.

RecordFieldPtr<Int> GBTMSSpecWinFiller::restFrameKey_p [private]

Definition at line 180 of file GBTMSSpecWinFiller.h.

Vector<Int> GBTMSSpecWinFiller::specWinIds_p [private]

The current Ids.

Definition at line 163 of file GBTMSSpecWinFiller.h.

Referenced by nrec(), and spectralWindowIds().

the table holding the cache, its temporary

Definition at line 169 of file GBTMSSpecWinFiller.h.


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