source: trunk/external/atnf/PKSIO/PKSMS2reader.h@ 1446

Last change on this file since 1446 was 1427, checked in by Malte Marquarding, 16 years ago

sync with livedata/implement/atnf

File size: 5.7 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSMS2reader.h: Class to read Parkes Multibeam data from a v2 MS.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2008
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: PKSMS2reader.h,v 19.14 2008-06-26 02:03:51 cal103 Exp $
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 String &bunit,
82 Float &equinox,
83 String &dopplerFrame,
84 Double &mjd,
85 Double &refFreq,
86 Double &bandwidth);
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(MBrecord &mbrec);
114
115 // Read the next data record, just the basics.
116 virtual Int read(
117 Int &IFno,
118 Vector<Float> &tsys,
119 Vector<Float> &calFctr,
120 Matrix<Float> &baseLin,
121 Matrix<Float> &baseSub,
122 Matrix<Float> &spectra,
123 Matrix<uChar> &flagged);
124
125 // Close the MS.
126 virtual void close(void);
127
128 private:
129 Bool cHaveBaseLin, cHaveCalFctr, cHaveSrcVel, cHaveTsys, cHaveXCalFctr,
130 cMSopen;
131 Int cCycleNo, cIdx, cNRow, cScanNo;
132 Double cTime;
133 Vector<Int> cEndChan, cRefChan, cStartChan;
134 Vector<Bool> cBeams, cIFs;
135 Vector<Slicer> cDataSel;
136 MeasurementSet cPKSMS;
137
138 ROScalarColumn<Int> cScanNoCol;
139 ROScalarColumn<Double> cTimeCol;
140 ROScalarColumn<Double> cIntervalCol;
141 ROScalarColumn<Int> cFieldIdCol;
142 ROScalarColumn<String> cFieldNameCol;
143 ROScalarColumn<Int> cSrcIdCol;
144 ROScalarColumn<String> cSrcNameCol;
145 ROArrayColumn<Double> cSrcDirCol;
146 ROArrayColumn<Double> cSrcPMCol;
147 ROArrayColumn<Double> cSrcVelCol;
148 ROScalarColumn<Int> cStateIdCol;
149 ROScalarColumn<String> cObsModeCol;
150 ROArrayColumn<Double> cSrcRestFrqCol;
151 ROScalarColumn<Int> cDataDescIdCol;
152 ROArrayColumn<Double> cChanFreqCol;
153 ROScalarColumn<Double> cWeatherTimeCol;
154 ROScalarColumn<Float> cTemperatureCol;
155 ROScalarColumn<Float> cPressureCol;
156 ROScalarColumn<Float> cHumidityCol;
157 ROScalarColumn<Int> cBeamNoCol;
158 ROArrayColumn<Double> cPointingCol;
159 ROArrayColumn<Float> cTsysCol;
160 ROArrayColumn<Float> cSigmaCol;
161 ROArrayColumn<Float> cCalFctrCol;
162 ROArrayColumn<Float> cBaseLinCol;
163 ROArrayColumn<Float> cBaseSubCol;
164 ROArrayColumn<Float> cFloatDataCol;
165 ROArrayColumn<Bool> cFlagCol;
166 ROScalarColumn<Complex> cXCalFctrCol;
167 ROArrayColumn<Complex> cDataCol;
168 ROScalarColumn<Int> cNumReceptorCol;
169};
170
171#endif
Note: See TracBrowser for help on using the repository browser.