casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FITSreader.h
Go to the documentation of this file.
00001 //#---------------------------------------------------------------------------
00002 //# FITSreader.h: ATNF single-dish FITS reader.
00003 //#---------------------------------------------------------------------------
00004 //# livedata - processing pipeline for single-dish, multibeam spectral data.
00005 //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
00006 //#
00007 //# This file is part of livedata.
00008 //#
00009 //# livedata is free software: you can redistribute it and/or modify it under
00010 //# the terms of the GNU General Public License as published by the Free
00011 //# Software Foundation, either version 3 of the License, or (at your option)
00012 //# any later version.
00013 //#
00014 //# livedata is distributed in the hope that it will be useful, but WITHOUT
00015 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00016 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00017 //# more details.
00018 //#
00019 //# You should have received a copy of the GNU General Public License along
00020 //# with livedata.  If not, see <http://www.gnu.org/licenses/>.
00021 //#
00022 //# Correspondence concerning livedata may be directed to:
00023 //#        Internet email: mcalabre@atnf.csiro.au
00024 //#        Postal address: Dr. Mark Calabretta
00025 //#                        Australia Telescope National Facility, CSIRO
00026 //#                        PO Box 76
00027 //#                        Epping NSW 1710
00028 //#                        AUSTRALIA
00029 //#
00030 //# http://www.atnf.csiro.au/computing/software/livedata.html
00031 //# $Id: FITSreader.h,v 19.11 2009-09-29 07:33:38 cal103 Exp $
00032 //#---------------------------------------------------------------------------
00033 //# The FITSreader class is an abstract base class for the Parkes Multibeam
00034 //# RPFITS and SDFITS readers.
00035 //#
00036 //# Original: 2000/08/14 Mark Calabretta
00037 //#---------------------------------------------------------------------------
00038 
00039 #ifndef ATNF_FITSREADER_H
00040 #define ATNF_FITSREADER_H
00041 
00042 #include <atnf/PKSIO/MBrecord.h>
00043 
00044 using namespace std;
00045 
00046 
00047 // <summary>
00048 // ATNF single-dish FITS reader.
00049 // </summary>
00050 
00051 //class FITSreader
00052 class FITSreader
00053 {
00054   public:
00055     // Destructor.
00056     virtual ~FITSreader() {};
00057 
00058     // Open the FITS file for reading.  Returns a pointer, beams, to an array
00059     // of length nBeam that indicates which beams are present in the data.
00060     // Beam selection is done by zeroing the unwanted elements of this array.
00061     // Likewise for IF selection (e.g. for frequency-switched data).
00062     virtual int open(
00063         char   *FITSname,
00064         int    &nBeam,
00065         int*   &beams,
00066         int    &nIF,
00067         int*   &IFs,
00068         int*   &nChan,
00069         int*   &nPol,
00070         int*   &haveXPol,
00071         int    &haveBase,
00072         int    &haveSpectra,
00073         int    &extraSysCal) = 0;
00074 
00075     // Get metadata.
00076     virtual int getHeader(
00077         char   observer[32],
00078         char   project[32],
00079         char   telescope[32],
00080         double antPos[3],
00081         char   obsType[32],
00082         char   bunit[32],
00083         float  &equinox,
00084         char   radecsys[32],
00085         char   dopplerFrame[32],
00086         char   datobs[32],
00087         double &utc,
00088         double &refFreq,
00089         double &bandwidth) = 0;
00090 
00091     // Get frequency parameters for each IF.
00092     virtual int getFreqInfo(
00093         int     &nIF,
00094         double* &startFreq,
00095         double* &endFreq) = 0;
00096 
00097     // Set data selection criteria.  Channel numbering is 1-relative, zero or
00098     // negative channel numbers are taken to be offsets from the last channel.
00099     // Coordinate systems are
00100     //   0: equatorial (RA,Dec),
00101     //   1: horizontal (Az,El),
00102     //   2: feed-plane,
00103     //   3: zenithal position angle of feed and elevation, (ZPA,El).
00104     int select(
00105         const int startChan[],
00106         const int endChan[],
00107         const int refChan[],
00108         const int getSpectra = 1,
00109         const int getXPol = 0,
00110         const int getFeedPos = 0,
00111         const int getPointing = 0,
00112         const int coordSys = 0);
00113 
00114 
00115     // Find the range in time and position of the data selected.
00116     virtual int findRange(
00117         int    &nRow,
00118         int    &nSel,
00119         char   dateSpan[2][32],
00120         double utcSpan[2],
00121         double* &positions) = 0;
00122 
00123     // Read the next data record.
00124     virtual int read(
00125 //        PKSMBrecord &record) = 0;
00126         MBrecord &record) = 0;
00127 
00128     // Close the RPFITS file.
00129     virtual void close(void) = 0;
00130 
00131   protected:
00132     int  *cBeams, *cEndChan, cGetFeedPos, cCoordSys, cGetSpectra, cGetXPol, 
00133            cHaveBase, cHaveSpectra, *cHaveXPol, *cIFs, cNBeam, *cNChan, cNIF, 
00134            *cNPol, *cRefChan, *cStartChan;
00135 
00136     // For use in constructing messages.
00137     char cMsg[256];
00138 
00139 };
00140 
00141 #endif