//#--------------------------------------------------------------------------- //# NROFITSDataset.h: Class for NRO 45m FITS dataset. //#--------------------------------------------------------------------------- //# Copyright (C) 2000-2006 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# $Id$ //#--------------------------------------------------------------------------- //# Original: 2009/02/27, Takeshi Nakazato, NAOJ //#--------------------------------------------------------------------------- #ifndef NRO_FITS_DATASET_H #define NRO_FITS_DATASET_H #define NRO_FITS_ARYMAX 75 #include #include using namespace std ; // // Accessor class for NRO 45m FITS data. // // // //
  • NRO45FITSReader //
  • NRODataset // // // // // // // This class actually accesses data from NRO telescopes. This is specialized class // for NRO 45m telescope with non-OTF observing mode. In contrast to other concrete classes, // both fillHeader and fillRecord methods are implemented here. // This is because that the output of non-OTF observing mode is in FITS format and is // quite different format from that of OTF observing mode. // // // // Although the input data is FITS format, the class does not depend on cfitsio library. // // // // Accessor class for NRO 45m FITS data. // // class NROFITSDataset : public NRODataset { public: // constructor NROFITSDataset( string name ) ; // destructor virtual ~NROFITSDataset() ; // data initialization virtual void initialize() ; // fill header from file virtual int fillHeader() ; // fill data record virtual int fillRecord( int i ) ; // get various parameters virtual vector< vector > getSpectrum() ; virtual vector getSpectrum( int i ) ; virtual int getIndex( int irow ) ; virtual int getPolarizationNum() ; virtual uInt getArrayId( string type ) ; protected: // fill header information int fillHeader( int sameEndian ) ; // Read char data int readHeader( string &v, char *name ) ; int readTable( char *v, char *name ) ; int readTable( char *v, char *name, int clen, int idx ) ; int readTable( vector &v, char *name, int idx ) ; int readColumn( vector &v, char *name ) ; int readColumn( vector &v, char *name, int idx ) ; // Read int data int readHeader( int &v, char *name, int b ) ; int readTable( int &v, char *name, int b ) ; int readTable( int &v, char *name, int b, int idx ) ; int readTable( vector &v, char *name, int b, int idx ) ; int readColumn( vector &v, char *name, int b ) ; int readColumn( vector &v, char *name, int b, int idx ) ; // Read float data int readHeader( float &v, char *name, int b ) ; int readTable( float &v, char *name, int b ) ; int readTable( float &v, char *name, int b, int idx ) ; int readTable( vector &v, char *name, int b, int idx ) ; int readColumn( vector &v, char *name, int b ) ; int readColumn( vector &v, char *name, int b, int idx ) ; // Read double data int readHeader( double &v, char *name, int b ) ; int readTable( double &v, char *name, int b ) ; int readTable( double &v, char *name, int b, int idx ) ; int readTable( vector &v, char *name, int b, int idx ) ; int readColumn( vector &v, char *name, int b ) ; int readColumn( vector &v, char *name, int b, int idx ) ; // read ARRY int readARRY() ; // Convert RA character representation to radian double radRA( string ra ) ; // Convert DEC character representation to radian double radDEC( string dec ) ; // get field parameters for scan header void getField() ; // fill array type void fillARYTP() ; // find data for each ARYTP void findData() ; // get offset bytes for attributes int getOffset( char *name ) ; // number of column for scan header int numField_ ; // number of HDU int numHdu_ ; // array type vector ARYTP ; // reference index vector arrayid_ ; // field names vector forms_ ; // field types vector names_ ; // field units vector units_ ; // spectral data vector JDATA ; } ; #endif /* NRO_FITS_DATASET_H */