Loading...
Searching...
No Matches
SDSourceHandler.h
Go to the documentation of this file.
//# SDSourceFiller.h: fills the SOURCE table for the SDFITS filler
//# Copyright (C) 2000
//# 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_SDSOURCEHANDLER_H
#define MS_SDSOURCEHANDLER_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/ArrayFwd.h>
#include <casacore/casa/Containers/RecordField.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
//# Forward Declarations
class ColumnsIndex;
class MeasurementSet;
class MSSource;
class MSSourceColumns;
class Record;
// <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 SDSourceHandler
{
public:
// default ctor is not attached to a MS and hence is useless until attached
SDSourceHandler();
// attach this to a MS, marking fields in row which are explicitly handled here
SDSourceHandler(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
// copy ctor
SDSourceHandler(const SDSourceHandler &other);
~SDSourceHandler() {clearAll();}
// assignment operator, uses copy semantics
SDSourceHandler &operator=(const SDSourceHandler &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 source is unique in source name and code
void fill(const Record &row, Int spectralWindowId);
// get the current source ID
Int sourceId() {return sourceId_p;}
private:
RecordFieldPtr<String> nameKey_p, codeKey_p;
ColumnsIndex *index_p;
MSSource *msSource_p;
MSSourceColumns *msSourceCols_p;
// the current source ID
Int sourceId_p;
// the next source ID to use
Int nextSourceId_p;
// fields possibly mined from the SDFITS row
// floating point fields that we can't be certain of their type
Int restfreq_p, vframe_p;
// String fields
RORecordFieldPtr<String> transiti_p, molecule_p, object_p, obsmode_p;
// which optional colums exist
Bool hasTransition_p, hasRestFreq_p, hasSysVel_p, hasPosition_p;
// fields which might come from a pre-existin MS
RORecordFieldPtr<Int> calibrationGroupField_p, pulsarIdField_p;
RORecordFieldPtr<Double> timeField_p, intervalField_p;
RORecordFieldPtr<Array<Double> > directionField_p, positionField_p, properMotionField_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::MSSourceColumns
Definition MSSourceColumns.h:87
casacore::MSSource
Definition MSSource.h:76
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::SDSourceHandler::SDSourceHandler
SDSourceHandler(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach this to a MS, marking fields in row which are explicitly handled here
casacore::SDSourceHandler::sourceId_p
Int sourceId_p
the current source ID
Definition SDSourceHandler.h:119
casacore::SDSourceHandler::nextSourceId_p
Int nextSourceId_p
the next source ID to use
Definition SDSourceHandler.h:122
casacore::SDSourceHandler::fill
void fill(const Record &row, Int spectralWindowId)
fill - a source is unique in source name and code
casacore::SDSourceHandler::attach
void attach(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach to a MS, the handledCols and row arguments are ignored here
casacore::SDSourceHandler::codeKey_p
RecordFieldPtr< String > codeKey_p
Definition SDSourceHandler.h:113
casacore::SDSourceHandler::properMotionField_p
RORecordFieldPtr< Array< Double > > properMotionField_p
Definition SDSourceHandler.h:136
casacore::SDSourceHandler::msSource_p
MSSource * msSource_p
Definition SDSourceHandler.h:115
casacore::SDSourceHandler::vframe_p
Int vframe_p
Definition SDSourceHandler.h:126
casacore::SDSourceHandler::hasPosition_p
Bool hasPosition_p
Definition SDSourceHandler.h:131
casacore::SDSourceHandler::initAll
void initAll(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
initialize everything
casacore::SDSourceHandler::sourceId
Int sourceId()
get the current source ID
Definition SDSourceHandler.h:111
casacore::SDSourceHandler::~SDSourceHandler
~SDSourceHandler()
Definition SDSourceHandler.h:96
casacore::SDSourceHandler::SDSourceHandler
SDSourceHandler()
default ctor is not attached to a MS and hence is useless until attached
casacore::SDSourceHandler::object_p
RORecordFieldPtr< String > object_p
Definition SDSourceHandler.h:128
casacore::SDSourceHandler::obsmode_p
RORecordFieldPtr< String > obsmode_p
Definition SDSourceHandler.h:128
casacore::SDSourceHandler::clearAll
void clearAll()
cleanup everything
casacore::SDSourceHandler::molecule_p
RORecordFieldPtr< String > molecule_p
Definition SDSourceHandler.h:128
casacore::SDSourceHandler::nameKey_p
RecordFieldPtr< String > nameKey_p
Definition SDSourceHandler.h:113
casacore::SDSourceHandler::calibrationGroupField_p
RORecordFieldPtr< Int > calibrationGroupField_p
fields which might come from a pre-existin MS
Definition SDSourceHandler.h:134
casacore::SDSourceHandler::operator=
SDSourceHandler & operator=(const SDSourceHandler &other)
assignment operator, uses copy semantics
casacore::SDSourceHandler::msSourceCols_p
MSSourceColumns * msSourceCols_p
Definition SDSourceHandler.h:116
casacore::SDSourceHandler::index_p
ColumnsIndex * index_p
Definition SDSourceHandler.h:114
casacore::SDSourceHandler::directionField_p
RORecordFieldPtr< Array< Double > > directionField_p
Definition SDSourceHandler.h:136
casacore::SDSourceHandler::positionField_p
RORecordFieldPtr< Array< Double > > positionField_p
Definition SDSourceHandler.h:136
casacore::SDSourceHandler::transiti_p
RORecordFieldPtr< String > transiti_p
String fields.
Definition SDSourceHandler.h:128
casacore::SDSourceHandler::clearRow
void clearRow()
clean up items related to the row
casacore::SDSourceHandler::intervalField_p
RORecordFieldPtr< Double > intervalField_p
Definition SDSourceHandler.h:135
casacore::SDSourceHandler::resetRow
void resetRow(const Record &)
reset internals given indicated row, use the same MS; just resets the id pointer
casacore::SDSourceHandler::initRow
void initRow(Vector< Bool > &handledCols, const Record &row)
initialize the stuff dependent on the row
casacore::SDSourceHandler::timeField_p
RORecordFieldPtr< Double > timeField_p
Definition SDSourceHandler.h:135
casacore::SDSourceHandler::hasRestFreq_p
Bool hasRestFreq_p
Definition SDSourceHandler.h:131
casacore::SDSourceHandler::SDSourceHandler
SDSourceHandler(const SDSourceHandler &other)
copy ctor
casacore::SDSourceHandler::hasSysVel_p
Bool hasSysVel_p
Definition SDSourceHandler.h:131
casacore::SDSourceHandler::pulsarIdField_p
RORecordFieldPtr< Int > pulsarIdField_p
Definition SDSourceHandler.h:134
casacore::SDSourceHandler::restfreq_p
Int restfreq_p
fields possibly mined from the SDFITS row floating point fields that we can't be certain of their typ...
Definition SDSourceHandler.h:126
casacore::SDSourceHandler::hasTransition_p
Bool hasTransition_p
which optional colums exist
Definition SDSourceHandler.h:131
casacore::Vector
Definition Vector.h:82
casacore::Record
Record()
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40