[1325] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file.
|
---|
| 3 | //#---------------------------------------------------------------------------
|
---|
[1720] | 4 | //# livedata - processing pipeline for single-dish, multibeam spectral data.
|
---|
| 5 | //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
|
---|
[1325] | 6 | //#
|
---|
[1720] | 7 | //# This file is part of livedata.
|
---|
[1325] | 8 | //#
|
---|
[1720] | 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
|
---|
[1720] | 16 | //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
---|
| 17 | //# more details.
|
---|
[1325] | 18 | //#
|
---|
[1720] | 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 | //#
|
---|
[1720] | 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 | //#
|
---|
[1720] | 30 | //# http://www.atnf.csiro.au/computing/software/livedata.html
|
---|
| 31 | //# $Id: PKSFITSreader.h,v 19.18 2009-09-29 07:33:38 cal103 Exp $
|
---|
[1325] | 32 | //#---------------------------------------------------------------------------
|
---|
| 33 | //# This class is basically a wrapper class for reading data from either an
|
---|
| 34 | //# MBFITS (single dish variant of RPFITS) or SDFITS file using the relevant
|
---|
| 35 | //# lower-level classes. It translates AIPS++isms to/from basic C++.
|
---|
| 36 | //#
|
---|
| 37 | //# Original: 2000/08/02, Mark Calabretta, ATNF
|
---|
| 38 | //#---------------------------------------------------------------------------
|
---|
| 39 |
|
---|
| 40 | #ifndef ATNF_PKSFITSREADER_H
|
---|
| 41 | #define ATNF_PKSFITSREADER_H
|
---|
| 42 |
|
---|
| 43 | #include <atnf/PKSIO/FITSreader.h>
|
---|
[1452] | 44 | #include <atnf/PKSIO/PKSrecord.h>
|
---|
[1325] | 45 | #include <atnf/PKSIO/PKSreader.h>
|
---|
| 46 |
|
---|
| 47 | #include <casa/aips.h>
|
---|
[1452] | 48 | #include <casa/stdio.h>
|
---|
[1325] | 49 | #include <casa/Arrays/Vector.h>
|
---|
| 50 | #include <casa/Arrays/Matrix.h>
|
---|
| 51 | #include <casa/BasicSL/Complex.h>
|
---|
| 52 | #include <casa/BasicSL/String.h>
|
---|
| 53 |
|
---|
[1452] | 54 | #include <casa/namespace.h>
|
---|
| 55 |
|
---|
[1325] | 56 | // <summary>
|
---|
| 57 | // Class to read Parkes Multibeam data from a FITS file.
|
---|
| 58 | // </summary>
|
---|
| 59 |
|
---|
| 60 | class PKSFITSreader : public PKSreader
|
---|
| 61 | {
|
---|
| 62 | public:
|
---|
| 63 | // Default constructor.
|
---|
| 64 | PKSFITSreader(
|
---|
| 65 | const String fitsType,
|
---|
| 66 | const Int retry = 0,
|
---|
| 67 | const Bool interpolate = True);
|
---|
| 68 |
|
---|
| 69 | // Destructor.
|
---|
| 70 | virtual ~PKSFITSreader();
|
---|
| 71 |
|
---|
[1452] | 72 | // Set message disposition.
|
---|
| 73 | virtual Int setMsg(
|
---|
| 74 | FILE *fd = 0x0);
|
---|
| 75 |
|
---|
[1325] | 76 | // Open the FITS file for reading.
|
---|
| 77 | virtual Int open(
|
---|
| 78 | const String fitsName,
|
---|
| 79 | Vector<Bool> &beams,
|
---|
| 80 | Vector<Bool> &IFs,
|
---|
| 81 | Vector<uInt> &nChan,
|
---|
| 82 | Vector<uInt> &nPol,
|
---|
| 83 | Vector<Bool> &haveXPol,
|
---|
| 84 | Bool &haveBase,
|
---|
| 85 | Bool &haveSpectra);
|
---|
| 86 |
|
---|
| 87 | // Get parameters describing the data.
|
---|
| 88 | virtual Int getHeader(
|
---|
| 89 | String &observer,
|
---|
| 90 | String &project,
|
---|
| 91 | String &antName,
|
---|
| 92 | Vector<Double> &antPosition,
|
---|
| 93 | String &obsType,
|
---|
[1399] | 94 | String &bunit,
|
---|
[1325] | 95 | Float &equinox,
|
---|
| 96 | String &dopplerFrame,
|
---|
| 97 | Double &mjd,
|
---|
| 98 | Double &refFreq,
|
---|
| 99 | Double &bandwidth);
|
---|
| 100 |
|
---|
| 101 | // Get frequency parameters for each IF.
|
---|
| 102 | virtual Int getFreqInfo(
|
---|
| 103 | Vector<Double> &startFreq,
|
---|
| 104 | Vector<Double> &endFreq);
|
---|
| 105 |
|
---|
| 106 | // Set data selection criteria. Channel numbering is 1-relative, zero or
|
---|
| 107 | // negative channel numbers are taken to be offsets from the last channel.
|
---|
| 108 | virtual uInt select(
|
---|
| 109 | const Vector<Bool> beamSel,
|
---|
| 110 | const Vector<Bool> IFsel,
|
---|
| 111 | const Vector<Int> startChan,
|
---|
| 112 | const Vector<Int> endChan,
|
---|
| 113 | const Vector<Int> refChan,
|
---|
| 114 | const Bool getSpectra = True,
|
---|
| 115 | const Bool getXPol = False,
|
---|
[1452] | 116 | const Int coordSys = 0);
|
---|
[1325] | 117 |
|
---|
| 118 | // Find the range of the data selected in time and position.
|
---|
| 119 | virtual Int findRange(
|
---|
| 120 | Int &nRow,
|
---|
| 121 | Int &nSel,
|
---|
| 122 | Vector<Double> &timeSpan,
|
---|
| 123 | Matrix<Double> &positions);
|
---|
| 124 |
|
---|
| 125 | // Read the next data record.
|
---|
[1452] | 126 | virtual Int read(PKSrecord &pksrec);
|
---|
[1325] | 127 |
|
---|
| 128 | // Close the FITS file.
|
---|
| 129 | virtual void close();
|
---|
| 130 |
|
---|
| 131 | private:
|
---|
| 132 | Int *cBeams, *cIFs;
|
---|
| 133 | uInt cNBeam, cNIF;
|
---|
[1452] | 134 | MBrecord cMBrec;
|
---|
[1325] | 135 | FITSreader *cReader;
|
---|
| 136 |
|
---|
| 137 | Char* trim(char *string);
|
---|
| 138 | };
|
---|
| 139 |
|
---|
| 140 | #endif
|
---|