casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDObservationHandler.h
Go to the documentation of this file.
1 //# SDObservationFiller.h: fills the OBSERVATION 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_SDOBSERVATIONHANDLER_H
30 #define MS_SDOBSERVATIONHANDLER_H
31 
32 #include <casacore/casa/aips.h>
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 //# Forward Declarations
40 class ColumnsIndex;
41 class MeasurementSet;
42 class MSObservation;
43 class MSObservationColumns;
44 class Record;
45 class String;
46 
47 // <summary>
48 // </summary>
49 
50 // <use visibility=local> or <use visibility=export>
51 
52 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
53 // </reviewed>
54 
55 // <prerequisite>
56 // <li> SomeClass
57 // <li> SomeOtherClass
58 // <li> some concept
59 // </prerequisite>
60 //
61 // <etymology>
62 // </etymology>
63 //
64 // <synopsis>
65 // </synopsis>
66 //
67 // <example>
68 // </example>
69 //
70 // <motivation>
71 // </motivation>
72 //
73 // <templating arg=T>
74 // <li>
75 // <li>
76 // </templating>
77 //
78 // <thrown>
79 // <li>
80 // <li>
81 // </thrown>
82 //
83 // <todo asof="yyyy/mm/dd">
84 // <li> add this feature
85 // <li> fix this bug
86 // <li> start discussion of this possible extension
87 // </todo>
88 
90 {
91 public:
92  // default ctor is not attached to a MS and hence is useless until attached
94 
95  // attach this to a MS, mark the appropriate columns as handled given
96  // the indicated row
97  SDObservationHandler(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
98 
99  // copy ctor
101 
103 
104  // assignment operator, uses copy semantics
106 
107  // attach to a MS, mark the appropriate columns as handled given the row
108  void attach(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
109 
110  // reset internals given indicated row, use the same MS
111  void resetRow(const Record &row);
112 
113  // fill - a new row is added only when necessary
114  void fill(const Record &row, const String &telescopeName, const Vector<Double> &timeRange);
115 
116  // get the current observation ID
118 
119  // update the time range
120  void updateTimeRange(const Vector<Double> &timeRange);
121 private:
126 
129 
131 
133 
134  // pointers to fields in record, only used if attached
139 
140  // cleanup everything
141  void clearAll();
142 
143  // cleanup things which depend on the row description being fixed
144  void clearRow();
145 
146  // initialize everything
147  void initAll(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
148 
149  // initialize the things which depend on the row
150  void initRow(Vector<Bool> &handledCols, const Record &row);
151 
152  // initialize the index
153  void makeIndex();
154 };
155 
156 
157 } //# NAMESPACE CASACORE - END
158 
159 #endif
160 
161 
MSObservationColumns * msObsCols_p
RORecordFieldPtr< Array< Double > > timeRange_p
RORecordFieldPtr< String > observer_p
pointers to fields in record, only used if attached
Index to one or more columns in a table.
Definition: ColumnsIndex.h:227
RecordFieldPtr< Bool > flagRowKey_p
int Int
Definition: aipstype.h:50
RORecordFieldPtr< String > obsid_p
A Table intended to hold a MeasurementSet OBSERVATION table.
Definition: MSObservation.h:78
A class to provide easy access to MSObservation columns.
Definition: MSObsColumns.h:80
void attach(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
attach to a MS, mark the appropriate columns as handled given the row
void clearAll()
cleanup everything
Int observationId()
get the current observation ID
RecordFieldPtr< String > observerKey_p
ScalarColumn< String > nsObsIdCol_p
void initAll(MeasurementSet &ms, Vector< Bool > &handledCols, const Record &row)
initialize everything
RORecordFieldPtr< Double > releaseDate_p
SDObservationHandler & operator=(const SDObservationHandler &other)
assignment operator, uses copy semantics
Access to an individual field in a record.
Definition: RecordField.h:118
RORecordFieldPtr< String > projid_p
RORecordFieldPtr< Bool > flagRow_p
RecordFieldPtr< Double > releaseDateKey_p
void updateTimeRange(const Vector< Double > &timeRange)
update the time range
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void fill(const Record &row, const String &telescopeName, const Vector< Double > &timeRange)
fill - a new row is added only when necessary
RecordFieldPtr< String > projectKey_p
A Table intended to hold astronomical data (a set of Measurements).
RecordFieldPtr< String > ns_obsidKey_p
void clearRow()
cleanup things which depend on the row description being fixed
SDObservationHandler()
default ctor is not attached to a MS and hence is useless until attached
String: the storage and methods of handling collections of characters.
Definition: String.h:225
Access to a scalar table column with arbitrary data type.
Definition: CopyRecord.h:47
RecordFieldPtr< String > telescopeKey_p
void makeIndex()
initialize the index
void initRow(Vector< Bool > &handledCols, const Record &row)
initialize the things which depend on the row
Read-Only access to an individual field from a Record.
Definition: RecordField.h:228
void resetRow(const Record &row)
reset internals given indicated row, use the same MS