casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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 
Index to one or more columns in a table.
Definition: ColumnsIndex.h:227
int Int
Definition: aipstype.h:50
Int restfreq_p
fields possibly mined from the SDFITS row floating point fields that we can&#39;t be certain of their typ...
std::vector< double > Vector
Definition: ds9context.h:24
RORecordFieldPtr< String > molecule_p
SDSourceHandler & operator=(const SDSourceHandler &other)
assignment operator, uses copy semantics
RecordFieldPtr< String > codeKey_p
Bool hasTransition_p
which optional colums exist
Int sourceId_p
the current source ID
SDSourceHandler()
default ctor is not attached to a MS and hence is useless until attached
RORecordFieldPtr< Array< Double > > directionField_p
void clearRow()
clean up items related to the row
void attach(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach to a MS, the handledCols and row arguments are ignored here
RORecordFieldPtr< String > transiti_p
String fields.
void initAll(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
initialize everything
RORecordFieldPtr< String > object_p
MSSourceColumns * msSourceCols_p
RORecordFieldPtr< Double > timeField_p
RORecordFieldPtr< Array< Double > > positionField_p
void clearAll()
cleanup everything
A class to provide easy read-write access to MSSource columns.
RORecordFieldPtr< Double > intervalField_p
A Table intended to hold a MeasurementSet SOURCE table.
Definition: MSSource.h:77
Access to an individual field in a record.
Definition: ColumnsIndex.h:44
RORecordFieldPtr< Int > calibrationGroupField_p
fields which might come from a pre-existin MS
RORecordFieldPtr< Array< Double > > properMotionField_p
Int sourceId()
get the current source ID
void fill(const Record &row, Int spectralWindowId)
fill - a source is unique in source name and code
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
RORecordFieldPtr< String > obsmode_p
RecordFieldPtr< String > nameKey_p
Int nextSourceId_p
the next source ID to use
A Table intended to hold astronomical data (a set of Measurements).
RORecordFieldPtr< Int > pulsarIdField_p
void resetRow(const Record &)
reset internals given indicated row, use the same MS; just resets the id pointer
void initRow(Vector< Bool > &handledCols, const Record &row)
initialize the stuff dependent on the row
Read-Only access to an individual field from a Record.
Definition: RecordField.h:228
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42