[1325] | 1 | //#--------------------------------------------------------------------------- |
---|
| 2 | //# PKSreader.h: Class to read Parkes multibeam data. |
---|
| 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: PKSreader.h,v 19.24 2009-09-29 07:33:39 cal103 Exp $ |
---|
[1325] | 32 | //#--------------------------------------------------------------------------- |
---|
| 33 | //# Original: 2000/08/02, Mark Calabretta, ATNF |
---|
| 34 | //#--------------------------------------------------------------------------- |
---|
| 35 | |
---|
| 36 | #ifndef ATNF_PKSREADER_H |
---|
| 37 | #define ATNF_PKSREADER_H |
---|
| 38 | |
---|
[1757] | 39 | #include <atnf/PKSIO/PKSrecord.h> |
---|
| 40 | #include <atnf/PKSIO/SrcType.h> |
---|
| 41 | |
---|
[1325] | 42 | #include <casa/aips.h> |
---|
| 43 | #include <casa/Arrays/Matrix.h> |
---|
| 44 | #include <casa/Arrays/Vector.h> |
---|
| 45 | #include <casa/BasicSL/Complex.h> |
---|
| 46 | #include <casa/BasicSL/String.h> |
---|
| 47 | |
---|
[1757] | 48 | #include <casa/namespace.h> |
---|
| 49 | |
---|
[1325] | 50 | // <summary> |
---|
| 51 | // Class to read Parkes multibeam data. |
---|
| 52 | // </summary> |
---|
| 53 | |
---|
[1757] | 54 | // Return an appropriate PKSreader for a Parkes Multibeam dataset. |
---|
| 55 | class PKSreader* getPKSreader( |
---|
| 56 | const String name, |
---|
| 57 | const Int retry, |
---|
| 58 | const Int interpolate, |
---|
| 59 | String &format); |
---|
[1325] | 60 | |
---|
[1757] | 61 | // As above, but search a list of directories for it. |
---|
| 62 | class PKSreader* getPKSreader( |
---|
| 63 | const String name, |
---|
| 64 | const Vector<String> directories, |
---|
| 65 | const Int retry, |
---|
| 66 | const Int interpolate, |
---|
| 67 | Int &iDir, |
---|
| 68 | String &format); |
---|
| 69 | |
---|
[1325] | 70 | // Open an appropriate PKSreader for a Parkes Multibeam dataset. |
---|
| 71 | class PKSreader* getPKSreader( |
---|
| 72 | const String name, |
---|
[1757] | 73 | const String antenna, |
---|
[1325] | 74 | const Int retry, |
---|
| 75 | const Int interpolate, |
---|
| 76 | String &format, |
---|
| 77 | Vector<Bool> &beams, |
---|
| 78 | Vector<Bool> &IFs, |
---|
| 79 | Vector<uInt> &nChan, |
---|
| 80 | Vector<uInt> &nPol, |
---|
| 81 | Vector<Bool> &haveXPol, |
---|
| 82 | Bool &haveBase, |
---|
| 83 | Bool &haveSpectra); |
---|
| 84 | |
---|
| 85 | // As above, but search a list of directories for it. |
---|
| 86 | class PKSreader* getPKSreader( |
---|
| 87 | const String name, |
---|
[1757] | 88 | const String antenna, |
---|
[1325] | 89 | const Vector<String> directories, |
---|
| 90 | const Int retry, |
---|
| 91 | const Int interpolate, |
---|
| 92 | Int &iDir, |
---|
| 93 | String &format, |
---|
| 94 | Vector<Bool> &beams, |
---|
| 95 | Vector<Bool> &IFs, |
---|
| 96 | Vector<uInt> &nChan, |
---|
| 97 | Vector<uInt> &nPol, |
---|
| 98 | Vector<Bool> &haveXPol, |
---|
| 99 | Bool &haveBase, |
---|
| 100 | Bool &haveSpectra); |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | class PKSreader |
---|
| 104 | { |
---|
| 105 | public: |
---|
| 106 | // Destructor. |
---|
| 107 | virtual ~PKSreader() {}; |
---|
| 108 | |
---|
| 109 | // Open the dataset. |
---|
| 110 | virtual Int open( |
---|
| 111 | const String inName, |
---|
[1757] | 112 | const String antenna, |
---|
[1325] | 113 | Vector<Bool> &beams, |
---|
| 114 | Vector<Bool> &IFs, |
---|
| 115 | Vector<uInt> &nChan, |
---|
| 116 | Vector<uInt> &nPol, |
---|
| 117 | Vector<Bool> &haveXPol, |
---|
| 118 | Bool &haveBase, |
---|
| 119 | Bool &haveSpectra) = 0; |
---|
| 120 | |
---|
| 121 | // Get parameters describing the data. |
---|
| 122 | virtual Int getHeader( |
---|
| 123 | String &observer, |
---|
| 124 | String &project, |
---|
| 125 | String &antName, |
---|
| 126 | Vector<Double> &antPosition, |
---|
| 127 | String &obsType, |
---|
[1757] | 128 | String &bunit, |
---|
[1325] | 129 | Float &equinox, |
---|
| 130 | String &dopplerFrame, |
---|
| 131 | Double &mjd, |
---|
| 132 | Double &refFreq, |
---|
[1757] | 133 | Double &bandwidth) = 0; |
---|
[1325] | 134 | |
---|
| 135 | // Get frequency parameters for each IF. |
---|
| 136 | virtual Int getFreqInfo( |
---|
| 137 | Vector<Double> &startFreq, |
---|
| 138 | Vector<Double> &endFreq) = 0; |
---|
| 139 | |
---|
| 140 | // Set data selection criteria. Channel numbering is 1-relative, zero or |
---|
| 141 | // negative channel numbers are taken to be offsets from the last channel. |
---|
[1757] | 142 | // Coordinate system selection (only supported for SDFITS input): |
---|
| 143 | // 0: equatorial (RA,Dec), |
---|
| 144 | // 1: horizontal (Az,El), |
---|
| 145 | // 2: feed-plane, |
---|
| 146 | // 3: zenithal position angle of feed and elevation, (ZPA,El). |
---|
[1325] | 147 | virtual uInt select( |
---|
| 148 | const Vector<Bool> beamSel, |
---|
| 149 | const Vector<Bool> IFsel, |
---|
| 150 | const Vector<Int> startChan, |
---|
| 151 | const Vector<Int> endChan, |
---|
| 152 | const Vector<Int> refChan, |
---|
| 153 | const Bool getSpectra = True, |
---|
| 154 | const Bool getXPol = False, |
---|
[1757] | 155 | const Bool getFeedPos = False, |
---|
| 156 | const Bool getPointing = False, |
---|
| 157 | const Int coordSys = 0) = 0; |
---|
[1325] | 158 | |
---|
[1757] | 159 | |
---|
[1325] | 160 | // Find the range of the data selected in time and position. |
---|
| 161 | virtual Int findRange( |
---|
| 162 | Int &nRow, |
---|
| 163 | Int &nSel, |
---|
| 164 | Vector<Double> &timeSpan, |
---|
| 165 | Matrix<Double> &positions) = 0; |
---|
| 166 | |
---|
[1757] | 167 | // Read the next data record. |
---|
| 168 | /** |
---|
[1325] | 169 | virtual Int read( |
---|
| 170 | Int &scanNo, |
---|
| 171 | Int &cycleNo, |
---|
| 172 | Double &mjd, |
---|
| 173 | Double &interval, |
---|
| 174 | String &fieldName, |
---|
| 175 | String &srcName, |
---|
| 176 | Vector<Double> &srcDir, |
---|
| 177 | Vector<Double> &srcPM, |
---|
| 178 | Double &srcVel, |
---|
| 179 | String &obsType, |
---|
| 180 | Int &IFno, |
---|
| 181 | Double &refFreq, |
---|
| 182 | Double &bandwidth, |
---|
| 183 | Double &freqInc, |
---|
[1453] | 184 | Vector<Double> &restFreq, |
---|
[1325] | 185 | Vector<Float> &tcal, |
---|
| 186 | String &tcalTime, |
---|
| 187 | Float &azimuth, |
---|
| 188 | Float &elevation, |
---|
| 189 | Float &parAngle, |
---|
| 190 | Float &focusAxi, |
---|
| 191 | Float &focusTan, |
---|
| 192 | Float &focusRot, |
---|
| 193 | Float &temperature, |
---|
| 194 | Float &pressure, |
---|
| 195 | Float &humidity, |
---|
| 196 | Float &windSpeed, |
---|
| 197 | Float &windAz, |
---|
| 198 | Int &refBeam, |
---|
| 199 | Int &beamNo, |
---|
| 200 | Vector<Double> &direction, |
---|
| 201 | Vector<Double> &scanRate, |
---|
| 202 | Vector<Float> &tsys, |
---|
| 203 | Vector<Float> &sigma, |
---|
| 204 | Vector<Float> &calFctr, |
---|
| 205 | Matrix<Float> &baseLin, |
---|
| 206 | Matrix<Float> &baseSub, |
---|
| 207 | Matrix<Float> &spectra, |
---|
| 208 | Matrix<uChar> &flagged, |
---|
| 209 | Complex &xCalFctr, |
---|
| 210 | Vector<Complex> &xPol) = 0; |
---|
[1757] | 211 | **/ |
---|
| 212 | /** |
---|
[1325] | 213 | // Read the next data record, just the basics. |
---|
| 214 | virtual Int read( |
---|
| 215 | Int &IFno, |
---|
| 216 | Vector<Float> &tsys, |
---|
| 217 | Vector<Float> &calFctr, |
---|
| 218 | Matrix<Float> &baseLin, |
---|
| 219 | Matrix<Float> &baseSub, |
---|
| 220 | Matrix<Float> &spectra, |
---|
| 221 | Matrix<uChar> &flagged) = 0; |
---|
[1757] | 222 | **/ |
---|
| 223 | virtual Int read(PKSrecord &pksrec) = 0; |
---|
[1325] | 224 | |
---|
| 225 | // Close the input file. |
---|
| 226 | virtual void close() = 0; |
---|
| 227 | |
---|
| 228 | protected: |
---|
[1757] | 229 | Bool cGetFeedPos, cGetSpectra, cGetXPol, cGetPointing; |
---|
| 230 | Int cCoordSys; |
---|
[1325] | 231 | |
---|
| 232 | Vector<uInt> cNChan, cNPol; |
---|
| 233 | Vector<Bool> cHaveXPol; |
---|
| 234 | }; |
---|
| 235 | |
---|
| 236 | #endif |
---|