source: branches/alma/external/atnf/PKSIO/PKSMS2reader.h@ 1721

Last change on this file since 1721 was 1453, checked in by TakTsutsumi, 16 years ago

New Development: No

JIRA Issue: No

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: many

Test Programs: sd.scantable(), sd.scantable.save()

Put in Release Notes: N/A

Description: copied from current casapy code tree


File size: 7.4 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSMS2reader.h: Class to read Parkes Multibeam data from a v2 MS.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2006
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$
29//#---------------------------------------------------------------------------
30//# Original: 2000/08/03, Mark Calabretta, ATNF
31//#---------------------------------------------------------------------------
32
33#ifndef ATNF_PKSMS2READER_H
34#define ATNF_PKSMS2READER_H
35
36#include <atnf/PKSIO/PKSreader.h>
37
38#include <casa/aips.h>
39#include <casa/Arrays/Matrix.h>
40#include <casa/Arrays/Slicer.h>
41#include <casa/Arrays/Vector.h>
42#include <casa/BasicSL/Complex.h>
43#include <casa/BasicSL/String.h>
44#include <ms/MeasurementSets/MeasurementSet.h>
45#include <tables/Tables/ArrayColumn.h>
46#include <tables/Tables/ScalarColumn.h>
47
48// <summary>
49// Class to read Parkes Multibeam data from a v2 MS.
50// </summary>
51
52#include <casa/namespace.h>
53
54class PKSMS2reader : public PKSreader
55{
56 public:
57 // Default constructor.
58 PKSMS2reader();
59
60 // Destructor.
61 virtual ~PKSMS2reader();
62
63 // Open the MS for reading.
64 virtual Int open(
65 const String msName,
66 Vector<Bool> &beams,
67 Vector<Bool> &IFs,
68 Vector<uInt> &nChan,
69 Vector<uInt> &nPol,
70 Vector<Bool> &haveXPol,
71 Bool &haveBase,
72 Bool &haveSpectra);
73
74 // Get parameters describing the data.
75 virtual Int getHeader(
76 String &observer,
77 String &project,
78 String &antName,
79 Vector<Double> &antPosition,
80 String &obsMode,
81 Float &equinox,
82 String &freqRef,
83 Double &mjd,
84 Double &refFreq,
85 Double &bandwidth,
86 String &fluxunit);
87
88 // Get frequency parameters for each IF.
89 virtual Int getFreqInfo(
90 Vector<Double> &startFreq,
91 Vector<Double> &endFreq);
92
93 // Set data selection criteria. Channel numbering is 1-relative, zero or
94 // negative channel numbers are taken to be offsets from the last channel.
95 virtual uInt select(
96 const Vector<Bool> beamSel,
97 const Vector<Bool> IFsel,
98 const Vector<Int> startChan,
99 const Vector<Int> endChan,
100 const Vector<Int> refChan,
101 const Bool getSpectra = True,
102 const Bool getXPol = False,
103 const Bool getFeedPos = False);
104
105 // Find the range of the data selected in time and position.
106 virtual Int findRange(
107 Int &nRow,
108 Int &nSel,
109 Vector<Double> &timeSpan,
110 Matrix<Double> &positions);
111
112 // Read the next data record.
113 virtual Int read(
114 Int &scanNo,
115 Int &cycleNo,
116 Double &mjd,
117 Double &interval,
118 String &fieldName,
119 String &srcName,
120 Vector<Double> &srcDir,
121 Vector<Double> &srcPM,
122 Double &srcVel,
123 String &obsMode,
124 Int &IFno,
125 Double &refFreq,
126 Double &bandwidth,
127 Double &freqInc,
128 Vector<Double> &restFreq,
129 Vector<Float> &tcal,
130 String &tcalTime,
131 Float &azimuth,
132 Float &elevation,
133 Float &parAngle,
134 Float &focusAxi,
135 Float &focusTan,
136 Float &focusRot,
137 Float &temperature,
138 Float &pressure,
139 Float &humidity,
140 Float &windSpeed,
141 Float &windAz,
142 Int &refBeam,
143 Int &beamNo,
144 Vector<Double> &direction,
145 Vector<Double> &scanRate,
146 Vector<Float> &tsys,
147 Vector<Float> &sigma,
148 Vector<Float> &calFctr,
149 Matrix<Float> &baseLin,
150 Matrix<Float> &baseSub,
151 Matrix<Float> &spectra,
152 Matrix<uChar> &flagged,
153 Complex &xCalFctr,
154 Vector<Complex> &xPol);
155
156 // Read the next data record, just the basics.
157 virtual Int read(
158 Int &IFno,
159 Vector<Float> &tsys,
160 Vector<Float> &calFctr,
161 Matrix<Float> &baseLin,
162 Matrix<Float> &baseSub,
163 Matrix<Float> &spectra,
164 Matrix<uChar> &flagged);
165
166 // Close the MS.
167 virtual void close(void);
168
169 private:
170 Bool cHaveBaseLin, cHaveCalFctr, cHaveSrcVel, cHaveTsys, cHaveXCalFctr,
171 cMSopen, cHaveTcal, cHaveDataCol, cATF, cHaveSysCal, cHaveCorrectedDataCol;
172 Int cCycleNo, cIdx, cNRow, cScanNo;
173 Double cTime, lastmjd;
174 Vector<Int> cEndChan, cRefChan, cStartChan;
175 Vector<Bool> cBeams, cIFs;
176 Vector<Slicer> cDataSel;
177 MeasurementSet cPKSMS;
178 Table cSysCalTab, tmptab, tmptab2;
179
180 ROScalarColumn<Int> cScanNoCol;
181 ROScalarColumn<Double> cTimeCol;
182 ROScalarColumn<Double> cIntervalCol;
183 ROScalarColumn<Int> cFieldIdCol;
184 ROScalarColumn<String> cFieldNameCol;
185 ROArrayColumn<Double> cFieldDelayDirCol;
186 ROScalarColumn<Int> cSrcIdCol;
187 ROScalarColumn<Int> cSrcId2Col;
188 ROScalarColumn<String> cSrcNameCol;
189 ROArrayColumn<Double> cSrcDirCol;
190 ROArrayColumn<Double> cSrcPMCol;
191 ROArrayColumn<Double> cSrcVelCol;
192 ROScalarColumn<Int> cStateIdCol;
193 ROScalarColumn<Double> cCalCol;
194 ROScalarColumn<String> cObsModeCol;
195 ROArrayColumn<Double> cSrcRestFrqCol;
196 ROScalarColumn<Int> cDataDescIdCol;
197 ROScalarColumn<Int> cSpWinIdCol;
198 ROArrayColumn<Double> cChanFreqCol;
199 ROScalarColumn<Double> cWeatherTimeCol;
200 ROScalarColumn<Float> cTemperatureCol;
201 ROScalarColumn<Float> cPressureCol;
202 ROScalarColumn<Float> cHumidityCol;
203 ROArrayColumn<Float> cTcalCol;
204 ROScalarColumn<Int> cBeamNoCol;
205 ROArrayColumn<Double> cPointingCol;
206 ROArrayColumn<Float> cTsysCol;
207 ROArrayColumn<Float> cSigmaCol;
208 ROArrayColumn<Float> cCalFctrCol;
209 ROArrayColumn<Float> cBaseLinCol;
210 ROArrayColumn<Float> cBaseSubCol;
211 ROArrayColumn<Float> cFloatDataCol;
212 ROArrayColumn<Bool> cFlagCol;
213 ROScalarColumn<Complex> cXCalFctrCol;
214 ROArrayColumn<Complex> cDataCol;
215 ROArrayColumn<Complex> cCorrectedDataCol;
216 ROScalarColumn<Int> cNumReceptorCol;
217 ROScalarColumn<Bool> cSigStateCol;
218 ROScalarColumn<Bool> cRefStateCol;
219
220};
221
222#endif
Note: See TracBrowser for help on using the repository browser.