casa
$Rev:20696$
|
GBTMSSpecWinFiller fills the MSSpectralWindow table for GBT fillers. More...
#include <GBTMSSpecWinFiller.h>
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) |
GBTMSSpecWinFiller fills the MSSpectralWindow table for GBT fillers.
Internal
This class puts GBT data (fills) into the MSSpectralWindow table.
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.
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.
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.
GBTMSSpecWinFiller::GBTMSSpecWinFiller | ( | const GBTMSSpecWinFiller & | other | ) | [private] |
undefined and unavailable
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] |
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.
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.
uInt GBTMSSpecWinFiller::cacheSize_p [private] |
The maximum number of rows in the cache (cache size)
Definition at line 188 of file GBTMSSpecWinFiller.h.
Referenced by getCacheSize().
TableColumn GBTMSSpecWinFiller::freqresCacheCol_p [private] |
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.
uInt GBTMSSpecWinFiller::nextCacheRow_p [private] |
The next row number to get trashed in the cache when a new ID is generated.
Definition at line 185 of file GBTMSSpecWinFiller.h.
Int GBTMSSpecWinFiller::nfreq_p [private] |
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.
TableColumn GBTMSSpecWinFiller::obsfreqCacheCol_p [private] |
Definition at line 172 of file GBTMSSpecWinFiller.h.
TableColumn GBTMSSpecWinFiller::refchanCacheCol_p [private] |
Definition at line 172 of file GBTMSSpecWinFiller.h.
RecordFieldPtr<Double> GBTMSSpecWinFiller::refchanKey_p [private] |
Definition at line 181 of file GBTMSSpecWinFiller.h.
TableColumn GBTMSSpecWinFiller::restFrameCacheCol_p [private] |
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().
Table* GBTMSSpecWinFiller::theCache_p [private] |
the table holding the cache, its temporary
Definition at line 169 of file GBTMSSpecWinFiller.h.