Loading...
Searching...
No Matches
SDSpWinHandler.h
Go to the documentation of this file.
//# SDSpWindowFiller.h: fills the SPECTRAL_WINDOW table for the SDFITS filler
//# Copyright (C) 2000,2001,2002
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef MS_SDSPWINHANDLER_H
#define MS_SDSPWINHANDLER_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/Vector.h>
#include <casacore/casa/Containers/RecordField.h>
#include <casacore/tables/Tables/TableColumn.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
//# Forward Declarations
class ColumnsIndex;
class MeasurementSet;
class MSSpectralWindow;
class MSSpWindowColumns;
class Record;
class Table;
// <summary>
// </summary>
// <use visibility=local> or <use visibility=export>
// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> SomeClass
// <li> SomeOtherClass
// <li> some concept
// </prerequisite>
//
// <etymology>
// </etymology>
//
// <synopsis>
// </synopsis>
//
// <example>
// </example>
//
// <motivation>
// </motivation>
//
// <templating arg=T>
// <li>
// <li>
// </templating>
//
// <thrown>
// <li>
// <li>
// </thrown>
//
// <todo asof="yyyy/mm/dd">
// <li> add this feature
// <li> fix this bug
// <li> start discussion of this possible extension
// </todo>
class SDSpWindowHandler
{
public:
// default ctor is not attached to a MS and hence is useless until attached
SDSpWindowHandler();
// attach this to a MS, marking fields in row which are explicitly handled here
SDSpWindowHandler(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
// copy ctor
SDSpWindowHandler(const SDSpWindowHandler &other);
~SDSpWindowHandler() {clearAll();}
// assignment operator, uses copy semantics
SDSpWindowHandler &operator=(const SDSpWindowHandler &other);
// attach to a MS, the handledCols and row arguments are ignored here
void attach(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
// reset internals given indicated row, use the same MS; just resets the id pointer
void resetRow(const Record &);
// fill - a circular buffer of last 100 spectral windows is checked
void fill(const Record &row, const Vector<Double> &frequency, Double refFrequency,
Double originalFreqDelt, Int freqRefType);
// get the current spWindow ID
Int spWindowId() {return rownr_p;}
private:
RecordFieldPtr<Int> nchanKey_p, freqRefTypeKey_p, ifConvChainKey_p,
freqGroupKey_p, netSidebandKey_p;
Vector<Double> fNCache_p, f0Cache_p, bwCache_p;
Double *fNCachePtr_p, *f0CachePtr_p, *bwCachePtr_p;
Bool deleteItFN_p, deleteItF0_p, deleteItBw_p;
RecordFieldPtr<Bool> flagRowKey_p;
// the cache table is the one that is indexed
ColumnsIndex *index_p;
// temporary table to hold the fields we are indexing on, can't index on array column
Table *theCache_p;
MSSpectralWindow *msSpWin_p;
MSSpWindowColumns *msSpWinCols_p;
// the columns in the cache table
TableColumn idCol_p, nchanCol_p, freqRefTypeCol_p,
freqresCol_p, ifConvChainCol_p,
freqGroupCol_p, netSidebandCol_p, flagRowCol_p;
// the next row number to use in the cached
uInt nextCacheRow_p;
// the maximum number of rows in the cache - currently this is 1000
uInt cacheSize_p;
// the current row number in the SPECTRAL_WINDOW table, i.e. the id
Int rownr_p;
// fields possibly mined from the SDFITS row
// floating point fields that we can't be certain of their type
Int bandwidField_p, freqresField_p;
// fields from a previous life as a MS
RORecordFieldPtr<Int> spWinIdField_p, ifConvChainField_p, freqGroupField_p,
netSidebandField_p;
RORecordFieldPtr<Bool> flagRowField_p;
// cleanup everything
void clearAll();
// clean up items related to the row
void clearRow();
// initialize everything
void initAll(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
// initialize the stuff dependent on the row
void initRow(Vector<Bool> &handledCols, const Record &row);
};
} //# NAMESPACE CASACORE - END
#endif
casacore::ColumnsIndex
Definition ColumnsIndex.h:226
casacore::MSSpWindowColumns
Definition MSSpWindowColumns.h:81
casacore::MSSpectralWindow
Definition MSSpectralWindow.h:77
casacore::MeasurementSet
Definition MeasurementSet.h:278
casacore::RORecordFieldPtr
Read-Only access to an individual field from a Record.
Definition RecordField.h:209
casacore::RecordFieldPtr
Definition ColumnsIndex.h:42
casacore::SDSpWindowHandler::deleteItBw_p
Bool deleteItBw_p
Definition SDSpWinHandler.h:120
casacore::SDSpWindowHandler::flagRowKey_p
RecordFieldPtr< Bool > flagRowKey_p
Definition SDSpWinHandler.h:121
casacore::SDSpWindowHandler::msSpWinCols_p
MSSpWindowColumns * msSpWinCols_p
Definition SDSpWinHandler.h:127
casacore::SDSpWindowHandler::~SDSpWindowHandler
~SDSpWindowHandler()
Definition SDSpWinHandler.h:98
casacore::SDSpWindowHandler::nchanCol_p
TableColumn nchanCol_p
Definition SDSpWinHandler.h:130
casacore::SDSpWindowHandler::f0CachePtr_p
Double * f0CachePtr_p
Definition SDSpWinHandler.h:119
casacore::SDSpWindowHandler::theCache_p
Table * theCache_p
temporary table to hold the fields we are indexing on, can't index on array column
Definition SDSpWinHandler.h:125
casacore::SDSpWindowHandler::fNCachePtr_p
Double * fNCachePtr_p
Definition SDSpWinHandler.h:119
casacore::SDSpWindowHandler::netSidebandKey_p
RecordFieldPtr< Int > netSidebandKey_p
Definition SDSpWinHandler.h:117
casacore::SDSpWindowHandler::initAll
void initAll(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
initialize everything
casacore::SDSpWindowHandler::freqresField_p
Int freqresField_p
Definition SDSpWinHandler.h:145
casacore::SDSpWindowHandler::netSidebandCol_p
TableColumn netSidebandCol_p
Definition SDSpWinHandler.h:132
casacore::SDSpWindowHandler::nchanKey_p
RecordFieldPtr< Int > nchanKey_p
Definition SDSpWinHandler.h:116
casacore::SDSpWindowHandler::ifConvChainKey_p
RecordFieldPtr< Int > ifConvChainKey_p
Definition SDSpWinHandler.h:116
casacore::SDSpWindowHandler::deleteItFN_p
Bool deleteItFN_p
Definition SDSpWinHandler.h:120
casacore::SDSpWindowHandler::clearAll
void clearAll()
cleanup everything
casacore::SDSpWindowHandler::SDSpWindowHandler
SDSpWindowHandler()
default ctor is not attached to a MS and hence is useless until attached
casacore::SDSpWindowHandler::ifConvChainField_p
RORecordFieldPtr< Int > ifConvChainField_p
Definition SDSpWinHandler.h:148
casacore::SDSpWindowHandler::f0Cache_p
Vector< Double > f0Cache_p
Definition SDSpWinHandler.h:118
casacore::SDSpWindowHandler::bwCachePtr_p
Double * bwCachePtr_p
Definition SDSpWinHandler.h:119
casacore::SDSpWindowHandler::SDSpWindowHandler
SDSpWindowHandler(const SDSpWindowHandler &other)
copy ctor
casacore::SDSpWindowHandler::freqGroupCol_p
TableColumn freqGroupCol_p
Definition SDSpWinHandler.h:132
casacore::SDSpWindowHandler::flagRowCol_p
TableColumn flagRowCol_p
Definition SDSpWinHandler.h:132
casacore::SDSpWindowHandler::deleteItF0_p
Bool deleteItF0_p
Definition SDSpWinHandler.h:120
casacore::SDSpWindowHandler::initRow
void initRow(Vector< Bool > &handledCols, const Record &row)
initialize the stuff dependent on the row
casacore::SDSpWindowHandler::spWinIdField_p
RORecordFieldPtr< Int > spWinIdField_p
fields from a previous life as a MS
Definition SDSpWinHandler.h:148
casacore::SDSpWindowHandler::resetRow
void resetRow(const Record &)
reset internals given indicated row, use the same MS; just resets the id pointer
casacore::SDSpWindowHandler::nextCacheRow_p
uInt nextCacheRow_p
the next row number to use in the cached
Definition SDSpWinHandler.h:135
casacore::SDSpWindowHandler::attach
void attach(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach to a MS, the handledCols and row arguments are ignored here
casacore::SDSpWindowHandler::msSpWin_p
MSSpectralWindow * msSpWin_p
Definition SDSpWinHandler.h:126
casacore::SDSpWindowHandler::clearRow
void clearRow()
clean up items related to the row
casacore::SDSpWindowHandler::freqRefTypeKey_p
RecordFieldPtr< Int > freqRefTypeKey_p
Definition SDSpWinHandler.h:116
casacore::SDSpWindowHandler::freqGroupKey_p
RecordFieldPtr< Int > freqGroupKey_p
Definition SDSpWinHandler.h:117
casacore::SDSpWindowHandler::idCol_p
TableColumn idCol_p
the columns in the cache table
Definition SDSpWinHandler.h:130
casacore::SDSpWindowHandler::ifConvChainCol_p
TableColumn ifConvChainCol_p
Definition SDSpWinHandler.h:131
casacore::SDSpWindowHandler::fNCache_p
Vector< Double > fNCache_p
Definition SDSpWinHandler.h:118
casacore::SDSpWindowHandler::netSidebandField_p
RORecordFieldPtr< Int > netSidebandField_p
Definition SDSpWinHandler.h:149
casacore::SDSpWindowHandler::freqRefTypeCol_p
TableColumn freqRefTypeCol_p
Definition SDSpWinHandler.h:130
casacore::SDSpWindowHandler::index_p
ColumnsIndex * index_p
the cache table is the one that is indexed
Definition SDSpWinHandler.h:123
casacore::SDSpWindowHandler::flagRowField_p
RORecordFieldPtr< Bool > flagRowField_p
Definition SDSpWinHandler.h:150
casacore::SDSpWindowHandler::spWindowId
Int spWindowId()
get the current spWindow ID
Definition SDSpWinHandler.h:114
casacore::SDSpWindowHandler::fill
void fill(const Record &row, const Vector< Double > &frequency, Double refFrequency, Double originalFreqDelt, Int freqRefType)
fill - a circular buffer of last 100 spectral windows is checked
casacore::SDSpWindowHandler::freqGroupField_p
RORecordFieldPtr< Int > freqGroupField_p
Definition SDSpWinHandler.h:148
casacore::SDSpWindowHandler::cacheSize_p
uInt cacheSize_p
the maximum number of rows in the cache - currently this is 1000
Definition SDSpWinHandler.h:138
casacore::SDSpWindowHandler::SDSpWindowHandler
SDSpWindowHandler(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach this to a MS, marking fields in row which are explicitly handled here
casacore::SDSpWindowHandler::freqresCol_p
TableColumn freqresCol_p
Definition SDSpWinHandler.h:131
casacore::SDSpWindowHandler::rownr_p
Int rownr_p
the current row number in the SPECTRAL_WINDOW table, i.e.
Definition SDSpWinHandler.h:141
casacore::SDSpWindowHandler::operator=
SDSpWindowHandler & operator=(const SDSpWindowHandler &other)
assignment operator, uses copy semantics
casacore::SDSpWindowHandler::bwCache_p
Vector< Double > bwCache_p
Definition SDSpWinHandler.h:118
casacore::SDSpWindowHandler::bandwidField_p
Int bandwidField_p
fields possibly mined from the SDFITS row floating point fields that we can't be certain of their typ...
Definition SDSpWinHandler.h:145
casacore::TableColumn
Definition TableColumn.h:97
casacore::Table
Definition Table.h:157
casacore::Vector
Definition Vector.h:82
casacore::Record
Record()
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::uInt
unsigned int uInt
Definition aipstype.h:49
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::Double
double Double
Definition aipstype.h:53