[1325] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# PKSMS2reader.h: Class to read Parkes Multibeam data from a v2 MS.
|
---|
| 3 | //#---------------------------------------------------------------------------
|
---|
[1757] | 4 | //# livedata - processing pipeline for single-dish, multibeam spectral data.
|
---|
| 5 | //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
|
---|
[1325] | 6 | //#
|
---|
[1757] | 7 | //# This file is part of livedata.
|
---|
[1325] | 8 | //#
|
---|
[1757] | 9 | //# livedata is free software: you can redistribute it and/or modify it under
|
---|
| 10 | //# the terms of the GNU General Public License as published by the Free
|
---|
| 11 | //# Software Foundation, either version 3 of the License, or (at your option)
|
---|
| 12 | //# any later version.
|
---|
| 13 | //#
|
---|
| 14 | //# livedata is distributed in the hope that it will be useful, but WITHOUT
|
---|
[1325] | 15 | //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
[1757] | 16 | //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
---|
| 17 | //# more details.
|
---|
[1325] | 18 | //#
|
---|
[1757] | 19 | //# You should have received a copy of the GNU General Public License along
|
---|
| 20 | //# with livedata. If not, see <http://www.gnu.org/licenses/>.
|
---|
[1325] | 21 | //#
|
---|
[1757] | 22 | //# Correspondence concerning livedata may be directed to:
|
---|
| 23 | //# Internet email: mcalabre@atnf.csiro.au
|
---|
| 24 | //# Postal address: Dr. Mark Calabretta
|
---|
| 25 | //# Australia Telescope National Facility, CSIRO
|
---|
| 26 | //# PO Box 76
|
---|
| 27 | //# Epping NSW 1710
|
---|
| 28 | //# AUSTRALIA
|
---|
[1325] | 29 | //#
|
---|
[1757] | 30 | //# http://www.atnf.csiro.au/computing/software/livedata.html
|
---|
| 31 | //# $Id: PKSMS2reader.h,v 19.18 2009-09-29 07:33:38 cal103 Exp $
|
---|
[1325] | 32 | //#---------------------------------------------------------------------------
|
---|
| 33 | //# Original: 2000/08/03, Mark Calabretta, ATNF
|
---|
| 34 | //#---------------------------------------------------------------------------
|
---|
| 35 |
|
---|
| 36 | #ifndef ATNF_PKSMS2READER_H
|
---|
| 37 | #define ATNF_PKSMS2READER_H
|
---|
| 38 |
|
---|
| 39 | #include <atnf/PKSIO/PKSreader.h>
|
---|
[1757] | 40 | #include <atnf/PKSIO/PKSrecord.h>
|
---|
[1325] | 41 |
|
---|
| 42 | #include <casa/aips.h>
|
---|
| 43 | #include <casa/Arrays/Matrix.h>
|
---|
| 44 | #include <casa/Arrays/Slicer.h>
|
---|
| 45 | #include <casa/Arrays/Vector.h>
|
---|
| 46 | #include <casa/BasicSL/Complex.h>
|
---|
| 47 | #include <casa/BasicSL/String.h>
|
---|
| 48 | #include <ms/MeasurementSets/MeasurementSet.h>
|
---|
| 49 | #include <tables/Tables/ArrayColumn.h>
|
---|
| 50 | #include <tables/Tables/ScalarColumn.h>
|
---|
| 51 |
|
---|
[1757] | 52 | #include <casa/namespace.h>
|
---|
| 53 |
|
---|
[1325] | 54 | // <summary>
|
---|
| 55 | // Class to read Parkes Multibeam data from a v2 MS.
|
---|
| 56 | // </summary>
|
---|
| 57 |
|
---|
| 58 | class PKSMS2reader : public PKSreader
|
---|
| 59 | {
|
---|
| 60 | public:
|
---|
| 61 | // Default constructor.
|
---|
| 62 | PKSMS2reader();
|
---|
| 63 |
|
---|
| 64 | // Destructor.
|
---|
| 65 | virtual ~PKSMS2reader();
|
---|
| 66 |
|
---|
| 67 | // Open the MS for reading.
|
---|
| 68 | virtual Int open(
|
---|
| 69 | const String msName,
|
---|
[1757] | 70 | const String antenna,
|
---|
[1325] | 71 | Vector<Bool> &beams,
|
---|
| 72 | Vector<Bool> &IFs,
|
---|
| 73 | Vector<uInt> &nChan,
|
---|
| 74 | Vector<uInt> &nPol,
|
---|
| 75 | Vector<Bool> &haveXPol,
|
---|
| 76 | Bool &haveBase,
|
---|
| 77 | Bool &haveSpectra);
|
---|
| 78 |
|
---|
| 79 | // Get parameters describing the data.
|
---|
| 80 | virtual Int getHeader(
|
---|
| 81 | String &observer,
|
---|
| 82 | String &project,
|
---|
| 83 | String &antName,
|
---|
| 84 | Vector<Double> &antPosition,
|
---|
| 85 | String &obsMode,
|
---|
[1757] | 86 | String &bunit,
|
---|
[1325] | 87 | Float &equinox,
|
---|
[1757] | 88 | //String &freqRef,
|
---|
| 89 | String &dopplerFrame,
|
---|
[1325] | 90 | Double &mjd,
|
---|
| 91 | Double &refFreq,
|
---|
[1757] | 92 | Double &bandwidth);
|
---|
[1325] | 93 |
|
---|
| 94 | // Get frequency parameters for each IF.
|
---|
| 95 | virtual Int getFreqInfo(
|
---|
| 96 | Vector<Double> &startFreq,
|
---|
| 97 | Vector<Double> &endFreq);
|
---|
| 98 |
|
---|
| 99 | // Set data selection criteria. Channel numbering is 1-relative, zero or
|
---|
| 100 | // negative channel numbers are taken to be offsets from the last channel.
|
---|
| 101 | virtual uInt select(
|
---|
| 102 | const Vector<Bool> beamSel,
|
---|
| 103 | const Vector<Bool> IFsel,
|
---|
| 104 | const Vector<Int> startChan,
|
---|
| 105 | const Vector<Int> endChan,
|
---|
| 106 | const Vector<Int> refChan,
|
---|
| 107 | const Bool getSpectra = True,
|
---|
| 108 | const Bool getXPol = False,
|
---|
[1757] | 109 | const Bool getFeedPos = False,
|
---|
| 110 | const Bool getPointing = False,
|
---|
| 111 | const Int coordSys = 0);
|
---|
[1325] | 112 |
|
---|
[1757] | 113 |
|
---|
[1325] | 114 | // Find the range of the data selected in time and position.
|
---|
| 115 | virtual Int findRange(
|
---|
| 116 | Int &nRow,
|
---|
| 117 | Int &nSel,
|
---|
| 118 | Vector<Double> &timeSpan,
|
---|
| 119 | Matrix<Double> &positions);
|
---|
| 120 |
|
---|
| 121 | // Read the next data record.
|
---|
[1757] | 122 | /**
|
---|
[1325] | 123 | virtual Int read(
|
---|
| 124 | Int &scanNo,
|
---|
| 125 | Int &cycleNo,
|
---|
| 126 | Double &mjd,
|
---|
| 127 | Double &interval,
|
---|
| 128 | String &fieldName,
|
---|
| 129 | String &srcName,
|
---|
| 130 | Vector<Double> &srcDir,
|
---|
| 131 | Vector<Double> &srcPM,
|
---|
| 132 | Double &srcVel,
|
---|
| 133 | String &obsMode,
|
---|
| 134 | Int &IFno,
|
---|
| 135 | Double &refFreq,
|
---|
| 136 | Double &bandwidth,
|
---|
| 137 | Double &freqInc,
|
---|
[1453] | 138 | Vector<Double> &restFreq,
|
---|
[1325] | 139 | Vector<Float> &tcal,
|
---|
| 140 | String &tcalTime,
|
---|
| 141 | Float &azimuth,
|
---|
| 142 | Float &elevation,
|
---|
| 143 | Float &parAngle,
|
---|
| 144 | Float &focusAxi,
|
---|
| 145 | Float &focusTan,
|
---|
| 146 | Float &focusRot,
|
---|
| 147 | Float &temperature,
|
---|
| 148 | Float &pressure,
|
---|
| 149 | Float &humidity,
|
---|
| 150 | Float &windSpeed,
|
---|
| 151 | Float &windAz,
|
---|
| 152 | Int &refBeam,
|
---|
| 153 | Int &beamNo,
|
---|
| 154 | Vector<Double> &direction,
|
---|
| 155 | Vector<Double> &scanRate,
|
---|
| 156 | Vector<Float> &tsys,
|
---|
| 157 | Vector<Float> &sigma,
|
---|
| 158 | Vector<Float> &calFctr,
|
---|
| 159 | Matrix<Float> &baseLin,
|
---|
| 160 | Matrix<Float> &baseSub,
|
---|
| 161 | Matrix<Float> &spectra,
|
---|
| 162 | Matrix<uChar> &flagged,
|
---|
| 163 | Complex &xCalFctr,
|
---|
| 164 | Vector<Complex> &xPol);
|
---|
[1757] | 165 | **/
|
---|
| 166 | virtual Int read(PKSrecord &pksrec);
|
---|
[1325] | 167 |
|
---|
[1757] | 168 |
|
---|
[1325] | 169 | // Read the next data record, just the basics.
|
---|
| 170 | virtual Int read(
|
---|
| 171 | Int &IFno,
|
---|
| 172 | Vector<Float> &tsys,
|
---|
| 173 | Vector<Float> &calFctr,
|
---|
| 174 | Matrix<Float> &baseLin,
|
---|
| 175 | Matrix<Float> &baseSub,
|
---|
| 176 | Matrix<Float> &spectra,
|
---|
| 177 | Matrix<uChar> &flagged);
|
---|
| 178 |
|
---|
| 179 | // Close the MS.
|
---|
| 180 | virtual void close(void);
|
---|
| 181 |
|
---|
| 182 | private:
|
---|
[1757] | 183 | Vector<String> splitAntennaSelectionString( const String s );
|
---|
| 184 | void setupAntennaList( const String s ) ;
|
---|
| 185 |
|
---|
[1325] | 186 | Bool cHaveBaseLin, cHaveCalFctr, cHaveSrcVel, cHaveTsys, cHaveXCalFctr,
|
---|
[1757] | 187 | cMSopen, cHaveTcal, cHaveDataCol, cALMA, cHaveSysCal, cHaveCorrectedDataCol;
|
---|
[1325] | 188 | Int cCycleNo, cIdx, cNRow, cScanNo;
|
---|
[1393] | 189 | Double cTime, lastmjd;
|
---|
[1325] | 190 | Vector<Int> cEndChan, cRefChan, cStartChan;
|
---|
| 191 | Vector<Bool> cBeams, cIFs;
|
---|
| 192 | Vector<Slicer> cDataSel;
|
---|
[1757] | 193 | String cDirRef, cTelName;
|
---|
[1325] | 194 | MeasurementSet cPKSMS;
|
---|
[1393] | 195 | Table cSysCalTab, tmptab, tmptab2;
|
---|
[1325] | 196 |
|
---|
[1757] | 197 | //Vector<String> cAntenna;
|
---|
| 198 | Vector<Int> cAntId;
|
---|
| 199 |
|
---|
[1325] | 200 | ROScalarColumn<Int> cScanNoCol;
|
---|
| 201 | ROScalarColumn<Double> cTimeCol;
|
---|
| 202 | ROScalarColumn<Double> cIntervalCol;
|
---|
| 203 | ROScalarColumn<Int> cFieldIdCol;
|
---|
| 204 | ROScalarColumn<String> cFieldNameCol;
|
---|
[1393] | 205 | ROArrayColumn<Double> cFieldDelayDirCol;
|
---|
[1325] | 206 | ROScalarColumn<Int> cSrcIdCol;
|
---|
[1393] | 207 | ROScalarColumn<Int> cSrcId2Col;
|
---|
[1325] | 208 | ROScalarColumn<String> cSrcNameCol;
|
---|
| 209 | ROArrayColumn<Double> cSrcDirCol;
|
---|
| 210 | ROArrayColumn<Double> cSrcPMCol;
|
---|
| 211 | ROArrayColumn<Double> cSrcVelCol;
|
---|
| 212 | ROScalarColumn<Int> cStateIdCol;
|
---|
[1393] | 213 | ROScalarColumn<Double> cCalCol;
|
---|
[1325] | 214 | ROScalarColumn<String> cObsModeCol;
|
---|
| 215 | ROArrayColumn<Double> cSrcRestFrqCol;
|
---|
| 216 | ROScalarColumn<Int> cDataDescIdCol;
|
---|
[1393] | 217 | ROScalarColumn<Int> cSpWinIdCol;
|
---|
[1325] | 218 | ROArrayColumn<Double> cChanFreqCol;
|
---|
[1757] | 219 | ROScalarColumn<Double> cTotBWCol;
|
---|
[1325] | 220 | ROScalarColumn<Double> cWeatherTimeCol;
|
---|
| 221 | ROScalarColumn<Float> cTemperatureCol;
|
---|
| 222 | ROScalarColumn<Float> cPressureCol;
|
---|
| 223 | ROScalarColumn<Float> cHumidityCol;
|
---|
[1393] | 224 | ROArrayColumn<Float> cTcalCol;
|
---|
[1325] | 225 | ROScalarColumn<Int> cBeamNoCol;
|
---|
| 226 | ROArrayColumn<Double> cPointingCol;
|
---|
[1757] | 227 | ROScalarColumn<Double> cPointingTimeCol;
|
---|
[1325] | 228 | ROArrayColumn<Float> cTsysCol;
|
---|
| 229 | ROArrayColumn<Float> cSigmaCol;
|
---|
| 230 | ROArrayColumn<Float> cCalFctrCol;
|
---|
| 231 | ROArrayColumn<Float> cBaseLinCol;
|
---|
| 232 | ROArrayColumn<Float> cBaseSubCol;
|
---|
| 233 | ROArrayColumn<Float> cFloatDataCol;
|
---|
| 234 | ROArrayColumn<Bool> cFlagCol;
|
---|
[1757] | 235 | ROScalarColumn<Bool> cFlagRowCol;
|
---|
[1325] | 236 | ROScalarColumn<Complex> cXCalFctrCol;
|
---|
| 237 | ROArrayColumn<Complex> cDataCol;
|
---|
[1453] | 238 | ROArrayColumn<Complex> cCorrectedDataCol;
|
---|
[1325] | 239 | ROScalarColumn<Int> cNumReceptorCol;
|
---|
[1393] | 240 | ROScalarColumn<Bool> cSigStateCol;
|
---|
| 241 | ROScalarColumn<Bool> cRefStateCol;
|
---|
| 242 |
|
---|
[1325] | 243 | };
|
---|
| 244 |
|
---|
| 245 | #endif
|
---|