[1325] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# FITSreader.h: ATNF single-dish FITS reader.
|
---|
| 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
|
---|
[1325] | 28 | //# AUSTRALIA
|
---|
| 29 | //#
|
---|
[1720] | 30 | //# http://www.atnf.csiro.au/computing/software/livedata.html
|
---|
| 31 | //# $Id: FITSreader.h,v 19.11 2009-09-29 07:33:38 cal103 Exp $
|
---|
[1325] | 32 | //#---------------------------------------------------------------------------
|
---|
| 33 | //# The FITSreader class is an abstract base class for the Parkes Multibeam
|
---|
| 34 | //# RPFITS and SDFITS readers.
|
---|
| 35 | //#
|
---|
| 36 | //# Original: 2000/08/14 Mark Calabretta
|
---|
| 37 | //#---------------------------------------------------------------------------
|
---|
| 38 |
|
---|
| 39 | #ifndef ATNF_FITSREADER_H
|
---|
| 40 | #define ATNF_FITSREADER_H
|
---|
| 41 |
|
---|
[1452] | 42 | #include <atnf/PKSIO/MBrecord.h>
|
---|
| 43 | #include <atnf/PKSIO/PKSmsg.h>
|
---|
[1325] | 44 |
|
---|
[1452] | 45 | using namespace std;
|
---|
| 46 |
|
---|
[1325] | 47 | // <summary>
|
---|
| 48 | // ATNF single-dish FITS reader.
|
---|
| 49 | // </summary>
|
---|
| 50 |
|
---|
[1452] | 51 | class FITSreader : public PKSmsg
|
---|
[1325] | 52 | {
|
---|
| 53 | public:
|
---|
| 54 | // Destructor.
|
---|
| 55 | virtual ~FITSreader() {};
|
---|
| 56 |
|
---|
| 57 | // Open the FITS file for reading. Returns a pointer, beams, to an array
|
---|
| 58 | // of length nBeam that indicates which beams are present in the data.
|
---|
| 59 | // Beam selection is done by zeroing the unwanted elements of this array.
|
---|
| 60 | // Likewise for IF selection (e.g. for frequency-switched data).
|
---|
| 61 | virtual int open(
|
---|
| 62 | char *FITSname,
|
---|
| 63 | int &nBeam,
|
---|
| 64 | int* &beams,
|
---|
| 65 | int &nIF,
|
---|
| 66 | int* &IFs,
|
---|
| 67 | int* &nChan,
|
---|
| 68 | int* &nPol,
|
---|
| 69 | int* &haveXPol,
|
---|
| 70 | int &haveBase,
|
---|
| 71 | int &haveSpectra,
|
---|
| 72 | int &extraSysCal) = 0;
|
---|
| 73 |
|
---|
| 74 | // Get metadata.
|
---|
| 75 | virtual int getHeader(
|
---|
| 76 | char observer[32],
|
---|
| 77 | char project[32],
|
---|
| 78 | char telescope[32],
|
---|
| 79 | double antPos[3],
|
---|
| 80 | char obsType[32],
|
---|
[1399] | 81 | char bunit[32],
|
---|
[1325] | 82 | float &equinox,
|
---|
| 83 | char radecsys[32],
|
---|
| 84 | char dopplerFrame[32],
|
---|
| 85 | char datobs[32],
|
---|
| 86 | double &utc,
|
---|
| 87 | double &refFreq,
|
---|
| 88 | double &bandwidth) = 0;
|
---|
| 89 |
|
---|
| 90 | // Get frequency parameters for each IF.
|
---|
| 91 | virtual int getFreqInfo(
|
---|
| 92 | int &nIF,
|
---|
| 93 | double* &startFreq,
|
---|
| 94 | double* &endFreq) = 0;
|
---|
| 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.
|
---|
[1452] | 98 | // Coordinate systems are
|
---|
| 99 | // 0: equatorial (RA,Dec),
|
---|
[1635] | 100 | // 1: horizontal (Az,El),
|
---|
| 101 | // 2: feed-plane,
|
---|
| 102 | // 3: zenithal position angle of feed and elevation, (ZPA,El).
|
---|
[1325] | 103 | int select(
|
---|
| 104 | const int startChan[],
|
---|
| 105 | const int endChan[],
|
---|
| 106 | const int refChan[],
|
---|
| 107 | const int getSpectra = 1,
|
---|
[1452] | 108 | const int getXPol = 0,
|
---|
| 109 | const int coordSys = 0);
|
---|
[1325] | 110 |
|
---|
| 111 | // Find the range in time and position of the data selected.
|
---|
| 112 | virtual int findRange(
|
---|
| 113 | int &nRow,
|
---|
| 114 | int &nSel,
|
---|
| 115 | char dateSpan[2][32],
|
---|
| 116 | double utcSpan[2],
|
---|
| 117 | double* &positions) = 0;
|
---|
| 118 |
|
---|
| 119 | // Read the next data record.
|
---|
| 120 | virtual int read(
|
---|
[1452] | 121 | MBrecord &record) = 0;
|
---|
[1325] | 122 |
|
---|
| 123 | // Close the RPFITS file.
|
---|
| 124 | virtual void close(void) = 0;
|
---|
| 125 |
|
---|
| 126 | protected:
|
---|
[1452] | 127 | int *cBeams, *cEndChan, cCoordSys, cGetSpectra, cGetXPol, cHaveBase,
|
---|
| 128 | cHaveSpectra, *cHaveXPol, *cIFs, cNBeam, *cNChan, cNIF, *cNPol,
|
---|
| 129 | *cRefChan, *cStartChan;
|
---|
| 130 |
|
---|
| 131 | // For use in constructing messages.
|
---|
| 132 | char cMsg[256];
|
---|
[1325] | 133 | };
|
---|
| 134 |
|
---|
| 135 | #endif
|
---|