[1325] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file.
|
---|
| 3 | //#---------------------------------------------------------------------------
|
---|
[1427] | 4 | //# Copyright (C) 2000-2008
|
---|
[1325] | 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 | //#
|
---|
[1427] | 28 | //# $Id: PKSFITSreader.h,v 19.13 2008-06-26 02:02:43 cal103 Exp $
|
---|
[1325] | 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,
|
---|
[1399] | 84 | String &bunit,
|
---|
[1325] | 85 | Float &equinox,
|
---|
| 86 | String &dopplerFrame,
|
---|
| 87 | Double &mjd,
|
---|
| 88 | Double &refFreq,
|
---|
| 89 | Double &bandwidth);
|
---|
| 90 |
|
---|
| 91 | // Get frequency parameters for each IF.
|
---|
| 92 | virtual Int getFreqInfo(
|
---|
| 93 | Vector<Double> &startFreq,
|
---|
| 94 | Vector<Double> &endFreq);
|
---|
| 95 |
|
---|
| 96 | // Set data selection criteria. Channel numbering is 1-relative, zero or
|
---|
| 97 | // negative channel numbers are taken to be offsets from the last channel.
|
---|
| 98 | virtual uInt select(
|
---|
| 99 | const Vector<Bool> beamSel,
|
---|
| 100 | const Vector<Bool> IFsel,
|
---|
| 101 | const Vector<Int> startChan,
|
---|
| 102 | const Vector<Int> endChan,
|
---|
| 103 | const Vector<Int> refChan,
|
---|
| 104 | const Bool getSpectra = True,
|
---|
| 105 | const Bool getXPol = False,
|
---|
| 106 | const Bool getFeedPos = False);
|
---|
| 107 |
|
---|
| 108 | // Find the range of the data selected in time and position.
|
---|
| 109 | virtual Int findRange(
|
---|
| 110 | Int &nRow,
|
---|
| 111 | Int &nSel,
|
---|
| 112 | Vector<Double> &timeSpan,
|
---|
| 113 | Matrix<Double> &positions);
|
---|
| 114 |
|
---|
| 115 | // Read the next data record.
|
---|
[1427] | 116 | virtual Int read(MBrecord &mbrec);
|
---|
[1325] | 117 |
|
---|
| 118 | // Read the next data record, just the basics.
|
---|
| 119 | virtual Int read(
|
---|
| 120 | Int &IFno,
|
---|
| 121 | Vector<Float> &tsys,
|
---|
| 122 | Vector<Float> &calFctr,
|
---|
| 123 | Matrix<Float> &baseLin,
|
---|
| 124 | Matrix<Float> &baseSub,
|
---|
| 125 | Matrix<Float> &spectra,
|
---|
| 126 | Matrix<uChar> &flagged);
|
---|
| 127 |
|
---|
| 128 | // Close the FITS file.
|
---|
| 129 | virtual void close();
|
---|
| 130 |
|
---|
| 131 | private:
|
---|
| 132 | Int *cBeams, *cIFs;
|
---|
| 133 | uInt cNBeam, cNIF;
|
---|
[1427] | 134 | PKSMBrecord cFITSMBrec;
|
---|
[1325] | 135 | FITSreader *cReader;
|
---|
| 136 |
|
---|
| 137 | Char* trim(char *string);
|
---|
| 138 | };
|
---|
| 139 |
|
---|
| 140 | #endif
|
---|