source: trunk/external/atnf/PKSIO/PKSMS2writer.h@ 1449

Last change on this file since 1449 was 1399, checked in by Malte Marquarding, 17 years ago

Mark C added brightness unit to getHeader()

File size: 8.0 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSMS2writer.h: Class to write Parkes Multibeam data to a measurementset.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2007
5//# Associated Universities, Inc. Washington DC, USA.
6//#
7//# This library is free software; you can redistribute it and/or modify it
8//# under the terms of the GNU Library General Public License as published by
9//# the Free Software Foundation; either version 2 of the License, or (at your
10//# option) any later version.
11//#
12//# This library is distributed in the hope that it will be useful, but WITHOUT
13//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15//# License for more details.
16//#
17//# You should have received a copy of the GNU Library General Public License
18//# along with this library; if not, write to the Free Software Foundation,
19//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
20//#
21//# Correspondence concerning AIPS++ should be addressed as follows:
22//# Internet email: aips2-request@nrao.edu.
23//# Postal address: AIPS++ Project Office
24//# National Radio Astronomy Observatory
25//# 520 Edgemont Road
26//# Charlottesville, VA 22903-2475 USA
27//#
28//# $Id: PKSMS2writer.h,v 19.12 2007/11/12 03:37:56 cal103 Exp $
29//#---------------------------------------------------------------------------
30
31#ifndef ATNF_PKSMS2WRITER_H
32#define ATNF_PKSMS2WRITER_H
33
34#include <atnf/PKSIO/PKSwriter.h>
35
36#include <casa/aips.h>
37#include <casa/Arrays/Matrix.h>
38#include <casa/Arrays/Vector.h>
39#include <casa/BasicSL/Complex.h>
40#include <ms/MeasurementSets/MeasurementSet.h>
41#include <ms/MeasurementSets/MSColumns.h>
42#include <casa/BasicSL/String.h>
43
44// <summary>
45// Class to write Parkes Multibeam data to a measurementset.
46// </summary>
47
48#include <casa/namespace.h>
49class PKSMS2writer : public PKSwriter
50{
51 public:
52 // Default constructor.
53 PKSMS2writer();
54
55 // Destructor.
56 virtual ~PKSMS2writer();
57
58 // Create the output MS and write static data.
59 virtual Int create(
60 const String msName,
61 const String observer,
62 const String project,
63 const String antName,
64 const Vector<Double> antPosition,
65 const String obsMode,
66 const String bunit,
67 const Float equinox,
68 const String dopplerFrame,
69 const Vector<uInt> nChan,
70 const Vector<uInt> nPol,
71 const Vector<Bool> haveXPol,
72 const Bool haveBase);
73
74 // Write the next data record.
75 virtual Int write(
76 const Int scanNo,
77 const Int cycleNo,
78 const Double mjd,
79 const Double interval,
80 const String fieldName,
81 const String srcName,
82 const Vector<Double> srcDir,
83 const Vector<Double> srcPM,
84 const Double srcVel,
85 const String obsMode,
86 const Int IFno,
87 const Double refFreq,
88 const Double bandwidth,
89 const Double freqInc,
90 const Double restFreq,
91 const Vector<Float> tcal,
92 const String tcalTime,
93 const Float azimuth,
94 const Float elevation,
95 const Float parAngle,
96 const Float focusAxi,
97 const Float focusTan,
98 const Float focusRot,
99 const Float temperature,
100 const Float pressure,
101 const Float humidity,
102 const Float windSpeed,
103 const Float windAz,
104 const Int refBeam,
105 const Int beamNo,
106 const Vector<Double> direction,
107 const Vector<Double> scanRate,
108 const Vector<Float> tsys,
109 const Vector<Float> sigma,
110 const Vector<Float> calFctr,
111 const Matrix<Float> baseLin,
112 const Matrix<Float> baseSub,
113 const Matrix<Float> &spectra,
114 const Matrix<uChar> &flagged,
115 const Complex xCalFctr,
116 const Vector<Complex> &xPol);
117
118 // Close the MS, flushing all associated Tables.
119 virtual void close();
120
121 private:
122 MFrequency::Types cDopplerFrame;
123
124 // Measurementset main table and subtables.
125 MeasurementSet *cPKSMS;
126 MSAntenna cAntenna;
127 MSDataDescription cDataDescription;
128 MSDoppler cDoppler;
129 MSFeed cFeed;
130 MSField cField;
131 MSFlagCmd cFlagCmd;
132 MSHistory cHistory;
133 MSObservation cObservation;
134 MSPointing cPointing;
135 MSPolarization cPolarization;
136 MSProcessor cProcessor;
137 MSSource cSource;
138 MSSpectralWindow cSpectralWindow;
139 MSState cState;
140 MSSysCal cSysCal;
141 MSWeather cWeather;
142
143 // Access to measurementset table columns; we are forced to use pointers
144 // here since none of these classes have default constructors.
145 MSColumns *cMSCols;
146 MSAntennaColumns *cAntennaCols;
147 MSDataDescColumns *cDataDescCols;
148 MSDopplerColumns *cDopplerCols;
149 MSFeedColumns *cFeedCols;
150 MSFieldColumns *cFieldCols;
151 MSFlagCmdColumns *cFlagCmdCols;
152 MSHistoryColumns *cHistoryCols;
153 MSObservationColumns *cObservationCols;
154 MSPointingColumns *cPointingCols;
155 MSPolarizationColumns *cPolarizationCols;
156 MSProcessorColumns *cProcessorCols;
157 MSSourceColumns *cSourceCols;
158 MSSpWindowColumns *cSpWindowCols;
159 MSStateColumns *cStateCols;
160 MSSysCalColumns *cSysCalCols;
161 MSWeatherColumns *cWeatherCols;
162
163 ArrayColumn<Float> *cCalFctrCol;
164 ArrayColumn<Float> *cBaseLinCol;
165 ArrayColumn<Float> *cBaseSubCol;
166 ScalarColumn<Complex> *cXCalFctrCol;
167
168
169 // Add an entry to the ANTENNA subtable.
170 Int addAntennaEntry(
171 const String antName,
172 const Vector<Double> &antPosition);
173
174 // Add an entry to the DATA_DESCRIPTION subtable.
175 Int addDataDescriptionEntry(
176 const Int iIF);
177
178 // Add an entry to the DOPPLER subtable.
179 Int addDopplerEntry();
180
181 // Add an entry to the FEED subtable.
182 Int addFeedEntry();
183
184 // Add an entry to the FIELD subtable.
185 Int addFieldEntry(
186 const String fieldName,
187 const Double mjd,
188 const Vector<Double> direction,
189 const Vector<Double> scanRate,
190 const Int srcId);
191
192 // Skip FLAG_CMD subtable.
193
194 // Skip FREQ_OFFSET subtable.
195
196 // Skip HISTORY subtable.
197
198 // Add an entry to the OBSERVATION subtable.
199 Int addObservationEntry(
200 const String observer,
201 const String project);
202
203 // Add an entry to the POINTING subtable.
204 Int addPointingEntry(
205 const Double mjd,
206 const Double interval,
207 const String fieldName,
208 const Vector<Double> direction,
209 const Vector<Double> scanRate);
210
211 // Add an entry to the POLARIZATION subtable.
212 Int addPolarizationEntry(
213 const Int iIF,
214 const Int nPol);
215
216 // Add an entry to the PROCESSOR subtable.
217 Int addProcessorEntry();
218
219 // Add an entry to the SOURCE subtable.
220 Int addSourceEntry(
221 const String name,
222 const Vector<Double> direction,
223 const Vector<Double> properMotion,
224 const Double restFreq,
225 const Double radialVelocity);
226
227 // Add an entry to the SPECTRAL_WINDOW subtable.
228 Int addSpectralWindowEntry(
229 const Int iIF,
230 const Int nChan,
231 const Double refFreq,
232 const Double bandwidth,
233 const Double freqInc);
234
235 // Add an entry to the STATE subtable.
236 Int addStateEntry(
237 const String obsMode);
238
239 // Add an entry to the SYSCAL subtable.
240 Int addSysCalEntry(
241 const Int beamNo,
242 const Int spWinId,
243 const Double mjd,
244 const Double interval,
245 const Vector<Float> Tcal,
246 const Vector<Float> Tsys);
247
248 // Add an entry to the WEATHER subtable.
249 Int addWeatherEntry(
250 const Double mjd,
251 const Double interval,
252 const Double pressure,
253 const Double humidity,
254 const Double temperature);
255};
256
257#endif
Note: See TracBrowser for help on using the repository browser.