casacore
SDSourceHandler.h
Go to the documentation of this file.
1 //# SDSourceFiller.h: fills the SOURCE table for the SDFITS filler
2 //# Copyright (C) 2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef MS_SDSOURCEHANDLER_H
30 #define MS_SDSOURCEHANDLER_H
31 
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Containers/RecordField.h>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 //# Forward Declarations
38 class ColumnsIndex;
39 class MeasurementSet;
40 class MSSource;
41 class MSSourceColumns;
42 class Record;
43 
44 template <class T> class Vector;
45 
46 // <summary>
47 // </summary>
48 
49 // <use visibility=local> or <use visibility=export>
50 
51 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
52 // </reviewed>
53 
54 // <prerequisite>
55 // <li> SomeClass
56 // <li> SomeOtherClass
57 // <li> some concept
58 // </prerequisite>
59 //
60 // <etymology>
61 // </etymology>
62 //
63 // <synopsis>
64 // </synopsis>
65 //
66 // <example>
67 // </example>
68 //
69 // <motivation>
70 // </motivation>
71 //
72 // <templating arg=T>
73 // <li>
74 // <li>
75 // </templating>
76 //
77 // <thrown>
78 // <li>
79 // <li>
80 // </thrown>
81 //
82 // <todo asof="yyyy/mm/dd">
83 // <li> add this feature
84 // <li> fix this bug
85 // <li> start discussion of this possible extension
86 // </todo>
87 
89 {
90 public:
91  // default ctor is not attached to a MS and hence is useless until attached
93 
94  // attach this to a MS, marking fields in row which are explicitly handled here
95  SDSourceHandler(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
96 
97  // copy ctor
98  SDSourceHandler(const SDSourceHandler &other);
99 
101 
102  // assignment operator, uses copy semantics
104 
105  // attach to a MS, the handledCols and row arguments are ignored here
106  void attach(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
107 
108  // reset internals given indicated row, use the same MS; just resets the id pointer
109  void resetRow(const Record &);
110 
111  // fill - a source is unique in source name and code
112  void fill(const Record &row, Int spectralWindowId);
113 
114  // get the current source ID
115  Int sourceId() {return sourceId_p;}
116 private:
121 
122  // the current source ID
124 
125  // the next source ID to use
127 
128  // fields possibly mined from the SDFITS row
129  // floating point fields that we can't be certain of their type
131  // String fields
133 
134  // which optional colums exist
136 
137  // fields which might come from a pre-existin MS
141 
142  // cleanup everything
143  void clearAll();
144 
145  // clean up items related to the row
146  void clearRow();
147 
148  // initialize everything
149  void initAll(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
150 
151  // initialize the stuff dependent on the row
152  void initRow(Vector<Bool> &handledCols, const Record &row);
153 };
154 
155 
156 } //# NAMESPACE CASACORE - END
157 
158 #endif
159 
160 
casacore::SDSourceHandler::fill
void fill(const Record &row, Int spectralWindowId)
fill - a source is unique in source name and code
casacore::SDSourceHandler::SDSourceHandler
SDSourceHandler()
default ctor is not attached to a MS and hence is useless until attached
casacore::RecordFieldPtr
Access to an individual field in a record.
Definition: RecordField.h:118
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::vframe_p
Int vframe_p
Definition: SDSourceHandler.h:130
casacore::SDSourceHandler::obsmode_p
RORecordFieldPtr< String > obsmode_p
Definition: SDSourceHandler.h:132
casacore::SDSourceHandler::codeKey_p
RecordFieldPtr< String > codeKey_p
Definition: SDSourceHandler.h:117
casacore::SDSourceHandler::pulsarIdField_p
RORecordFieldPtr< Int > pulsarIdField_p
Definition: SDSourceHandler.h:138
casacore::SDSourceHandler::~SDSourceHandler
~SDSourceHandler()
Definition: SDSourceHandler.h:100
casacore::SDSourceHandler::initAll
void initAll(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
initialize everything
casacore::SDSourceHandler::properMotionField_p
RORecordFieldPtr< Array< Double > > properMotionField_p
Definition: SDSourceHandler.h:140
casacore::SDSourceHandler::timeField_p
RORecordFieldPtr< Double > timeField_p
Definition: SDSourceHandler.h:139
casacore::SDSourceHandler
Definition: SDSourceHandler.h:88
casacore::ColumnsIndex
Index to one or more columns in a table.
Definition: ColumnsIndex.h:227
casacore::SDSourceHandler::sourceId_p
Int sourceId_p
the current source ID
Definition: SDSourceHandler.h:123
casacore::SDSourceHandler::nextSourceId_p
Int nextSourceId_p
the next source ID to use
Definition: SDSourceHandler.h:126
casacore::SDSourceHandler::resetRow
void resetRow(const Record &)
reset internals given indicated row, use the same MS; just resets the id pointer
casacore::SDSourceHandler::object_p
RORecordFieldPtr< String > object_p
Definition: SDSourceHandler.h:132
casacore::SDSourceHandler::transiti_p
RORecordFieldPtr< String > transiti_p
String fields.
Definition: SDSourceHandler.h:132
casacore::SDSourceHandler::intervalField_p
RORecordFieldPtr< Double > intervalField_p
Definition: SDSourceHandler.h:139
casacore::MSSourceColumns
A class to provide easy access to MSSource columns.
Definition: MSSourceColumns.h:88
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::SDSourceHandler::msSourceCols_p
MSSourceColumns * msSourceCols_p
Definition: SDSourceHandler.h:120
casacore::SDSourceHandler::clearRow
void clearRow()
clean up items related to the row
casacore::SDSourceHandler::positionField_p
RORecordFieldPtr< Array< Double > > positionField_p
Definition: SDSourceHandler.h:140
casacore::SDSourceHandler::calibrationGroupField_p
RORecordFieldPtr< Int > calibrationGroupField_p
fields which might come from a pre-existin MS
Definition: SDSourceHandler.h:138
casacore::SDSourceHandler::molecule_p
RORecordFieldPtr< String > molecule_p
Definition: SDSourceHandler.h:132
casacore::MeasurementSet
A Table intended to hold astronomical data (a set of Measurements).
Definition: MeasurementSet.h:241
casacore::SDSourceHandler::operator=
SDSourceHandler & operator=(const SDSourceHandler &other)
assignment operator, uses copy semantics
casacore::SDSourceHandler::hasSysVel_p
Bool hasSysVel_p
Definition: SDSourceHandler.h:135
casacore::RORecordFieldPtr
Read-Only access to an individual field from a Record.
Definition: RecordField.h:228
casacore::SDSourceHandler::nameKey_p
RecordFieldPtr< String > nameKey_p
Definition: SDSourceHandler.h:117
casacore::SDSourceHandler::index_p
ColumnsIndex * index_p
Definition: SDSourceHandler.h:118
casacore::SDSourceHandler::initRow
void initRow(Vector< Bool > &handledCols, const Record &row)
initialize the stuff dependent on the row
casacore::SDSourceHandler::sourceId
Int sourceId()
get the current source ID
Definition: SDSourceHandler.h:115
casacore::SDSourceHandler::hasTransition_p
Bool hasTransition_p
which optional colums exist
Definition: SDSourceHandler.h:135
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::SDSourceHandler::directionField_p
RORecordFieldPtr< Array< Double > > directionField_p
Definition: SDSourceHandler.h:140
casacore::SDSourceHandler::hasPosition_p
Bool hasPosition_p
Definition: SDSourceHandler.h:135
casacore::SDSourceHandler::msSource_p
MSSource * msSource_p
Definition: SDSourceHandler.h:119
casacore::Record
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::SDSourceHandler::clearAll
void clearAll()
cleanup everything
casacore::Vector< Bool >
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:130
casacore::SDSourceHandler::hasRestFreq_p
Bool hasRestFreq_p
Definition: SDSourceHandler.h:135
casacore::MSSource
A Table intended to hold a MeasurementSet SOURCE table.
Definition: MSSource.h:77