[1325] | 1 | //#--------------------------------------------------------------------------- |
---|
| 2 | //# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file. |
---|
| 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: PKSFITSreader.h,v 19.11 2006/07/05 04:49:57 mcalabre Exp $ |
---|
| 29 | //#--------------------------------------------------------------------------- |
---|
| 30 | //# This class is basically a wrapper class for reading data from either an |
---|
| 31 | //# MBFITS (single dish variant of RPFITS) or SDFITS file using the relevant |
---|
| 32 | //# lower-level classes. It translates AIPS++isms to/from basic C++. |
---|
| 33 | //# |
---|
| 34 | //# Original: 2000/08/02, Mark Calabretta, ATNF |
---|
| 35 | //#--------------------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | #ifndef ATNF_PKSFITSREADER_H |
---|
| 38 | #define ATNF_PKSFITSREADER_H |
---|
| 39 | |
---|
| 40 | #include <atnf/PKSIO/FITSreader.h> |
---|
| 41 | #include <atnf/PKSIO/PKSreader.h> |
---|
| 42 | |
---|
| 43 | #include <casa/aips.h> |
---|
| 44 | #include <casa/Arrays/Vector.h> |
---|
| 45 | #include <casa/Arrays/Matrix.h> |
---|
| 46 | #include <casa/BasicSL/Complex.h> |
---|
| 47 | #include <casa/BasicSL/String.h> |
---|
| 48 | |
---|
| 49 | // <summary> |
---|
| 50 | // Class to read Parkes Multibeam data from a FITS file. |
---|
| 51 | // </summary> |
---|
| 52 | |
---|
| 53 | #include <casa/namespace.h> |
---|
| 54 | class PKSFITSreader : public PKSreader |
---|
| 55 | { |
---|
| 56 | public: |
---|
| 57 | // Default constructor. |
---|
| 58 | PKSFITSreader( |
---|
| 59 | const String fitsType, |
---|
| 60 | const Int retry = 0, |
---|
| 61 | const Bool interpolate = True); |
---|
| 62 | |
---|
| 63 | // Destructor. |
---|
| 64 | virtual ~PKSFITSreader(); |
---|
| 65 | |
---|
| 66 | // Open the FITS file for reading. |
---|
| 67 | virtual Int open( |
---|
| 68 | const String fitsName, |
---|
| 69 | Vector<Bool> &beams, |
---|
| 70 | Vector<Bool> &IFs, |
---|
| 71 | Vector<uInt> &nChan, |
---|
| 72 | Vector<uInt> &nPol, |
---|
| 73 | Vector<Bool> &haveXPol, |
---|
| 74 | Bool &haveBase, |
---|
| 75 | Bool &haveSpectra); |
---|
| 76 | |
---|
| 77 | // Get parameters describing the data. |
---|
| 78 | virtual Int getHeader( |
---|
| 79 | String &observer, |
---|
| 80 | String &project, |
---|
| 81 | String &antName, |
---|
| 82 | Vector<Double> &antPosition, |
---|
| 83 | String &obsType, |
---|
| 84 | Float &equinox, |
---|
| 85 | String &dopplerFrame, |
---|
| 86 | Double &mjd, |
---|
| 87 | Double &refFreq, |
---|
| 88 | Double &bandwidth); |
---|
| 89 | |
---|
| 90 | // Get frequency parameters for each IF. |
---|
| 91 | virtual Int getFreqInfo( |
---|
| 92 | Vector<Double> &startFreq, |
---|
| 93 | Vector<Double> &endFreq); |
---|
| 94 | |
---|
| 95 | // Set data selection criteria. Channel numbering is 1-relative, zero or |
---|
| 96 | // negative channel numbers are taken to be offsets from the last channel. |
---|
| 97 | virtual uInt select( |
---|
| 98 | const Vector<Bool> beamSel, |
---|
| 99 | const Vector<Bool> IFsel, |
---|
| 100 | const Vector<Int> startChan, |
---|
| 101 | const Vector<Int> endChan, |
---|
| 102 | const Vector<Int> refChan, |
---|
| 103 | const Bool getSpectra = True, |
---|
| 104 | const Bool getXPol = False, |
---|
| 105 | const Bool getFeedPos = False); |
---|
| 106 | |
---|
| 107 | // Find the range of the data selected in time and position. |
---|
| 108 | virtual Int findRange( |
---|
| 109 | Int &nRow, |
---|
| 110 | Int &nSel, |
---|
| 111 | Vector<Double> &timeSpan, |
---|
| 112 | Matrix<Double> &positions); |
---|
| 113 | |
---|
| 114 | // Read the next data record. |
---|
| 115 | virtual Int read( |
---|
| 116 | Int &scanNo, |
---|
| 117 | Int &cycleNo, |
---|
| 118 | Double &mjd, |
---|
| 119 | Double &interval, |
---|
| 120 | String &fieldName, |
---|
| 121 | String &srcName, |
---|
| 122 | Vector<Double> &srcDir, |
---|
| 123 | Vector<Double> &srcPM, |
---|
| 124 | Double &srcVel, |
---|
| 125 | String &obsType, |
---|
| 126 | Int &IFno, |
---|
| 127 | Double &refFreq, |
---|
| 128 | Double &bandwidth, |
---|
| 129 | Double &freqInc, |
---|
| 130 | Double &restFreq, |
---|
| 131 | Vector<Float> &tcal, |
---|
| 132 | String &tcalTime, |
---|
| 133 | Float &azimuth, |
---|
| 134 | Float &elevation, |
---|
| 135 | Float &parAngle, |
---|
| 136 | Float &focusAxi, |
---|
| 137 | Float &focusTan, |
---|
| 138 | Float &focusRot, |
---|
| 139 | Float &temperature, |
---|
| 140 | Float &pressure, |
---|
| 141 | Float &humidity, |
---|
| 142 | Float &windSpeed, |
---|
| 143 | Float &windAz, |
---|
| 144 | Int &refBeam, |
---|
| 145 | Int &beamNo, |
---|
| 146 | Vector<Double> &direction, |
---|
| 147 | Vector<Double> &scanRate, |
---|
| 148 | Vector<Float> &tsys, |
---|
| 149 | Vector<Float> &sigma, |
---|
| 150 | Vector<Float> &calFctr, |
---|
| 151 | Matrix<Float> &baseLin, |
---|
| 152 | Matrix<Float> &baseSub, |
---|
| 153 | Matrix<Float> &spectra, |
---|
| 154 | Matrix<uChar> &flagged, |
---|
| 155 | Complex &xCalFctr, |
---|
| 156 | Vector<Complex> &xPol); |
---|
| 157 | |
---|
| 158 | // Read the next data record, just the basics. |
---|
| 159 | virtual Int read( |
---|
| 160 | Int &IFno, |
---|
| 161 | Vector<Float> &tsys, |
---|
| 162 | Vector<Float> &calFctr, |
---|
| 163 | Matrix<Float> &baseLin, |
---|
| 164 | Matrix<Float> &baseSub, |
---|
| 165 | Matrix<Float> &spectra, |
---|
| 166 | Matrix<uChar> &flagged); |
---|
| 167 | |
---|
| 168 | // Close the FITS file. |
---|
| 169 | virtual void close(); |
---|
| 170 | |
---|
| 171 | private: |
---|
| 172 | Int *cBeams, *cIFs; |
---|
| 173 | uInt cNBeam, cNIF; |
---|
| 174 | PKSMBrecord cMBrec; |
---|
| 175 | FITSreader *cReader; |
---|
| 176 | |
---|
| 177 | Char* trim(char *string); |
---|
| 178 | }; |
---|
| 179 | |
---|
| 180 | #endif |
---|