//#--------------------------------------------------------------------------- //# NROReader.h: Base class to read NRO 45m and ASTE data. //#--------------------------------------------------------------------------- //# 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: 2008/10/30, Takeshi Nakazato, NAOJ //#--------------------------------------------------------------------------- #ifndef NRO_READER_H #define NRO_READER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #include #include // // Base class to read NRO 45m and ASTE data. // // // // //
  • NRODataset // // // // // // // NROReader is a base class for all NRO reader classes. // Reader classes have NRODataset object to access // actual data. These classes are a kind of interface for Scantable data filler. // // // // Abstract class that is designed as a base class for NRO reader classes. // // // Open an appropriate NROreader for a NRO 45m and ASTE dataset. class NROReader *getNROReader( const String filename, String &datatype ); // As above, but search a list of directories for it. class NROReader *getNROReader( const String filename, const Vector directories, int &iDir, String &datatype ) ; // // NROReader // class NROReader { public: // Constructor NROReader( string name ) ; // Destructor. virtual ~NROReader() ; // determine whether to import frequency as REST (frequency is same as // NEWSTAR/NOSTAR) or as is (velocity is same as NEWSTAR/NOSTAR) void setFreqRefFromVREF( bool fromVREF ) ; // Read data header virtual Int read() = 0 ; // Get header information virtual int getHeaderInfo( Int &nchan, Int &npol, Int &nif, Int &nbeam, String &observer, String &project, String &obstype, String &antname, Vector &antpos, Float &equinox, String &freqref, Double &reffreq, Double &bw, Double &utc, String &fluxunit, String &epoch, String &poltype ) ; // Get scan information virtual int getScanInfo( int irow, uInt &scanno, uInt &cycleno, uInt &ifno, uInt &beamno, uInt &polno, std::vector &freqs, Vector &restfreq, uInt &refbeamno, Double &scantime, Double &interval, String &srcname, String &fieldname, Vector &spectra, Vector &flagtra, Vector &tsys, Vector &direction, Float &azimuth, Float &elevation, Float ¶ngle, Float &opacity, uInt &tcalid, Int &fitid, uInt &focusid, Float &temperature, Float &pressure, Float &humidity, Float &windvel, Float &winddir, Double &srcvel, Vector &propermotion, Vector &srcdir, Vector &scanrate ) ; // Get scan type virtual string getScanType( int i ) ; // Get dataset virtual NRODataset *getDataset() { return dataset_ ; } ; // Get number of rows virtual Int getRowNum() ; // Get IF settings virtual std::vector getIFs() ; // Get Number of IFs virtual Int getNumIF() = 0 ; // Get Beam settings virtual std::vector getBeams() ; // Get Number of Beams virtual Int getNumBeam() = 0 ; protected: // convert time in character representation to MJD representation virtual double getMJD( char *time ) ; virtual double getMJD( string strStartTime ) ; // Get spectrum virtual std::vector< std::vector > getSpectrum() ; // Get number of polarization virtual Int getPolarizationNum() ; // Get MJD time virtual double getStartTime() ; virtual double getEndTime() ; virtual std::vector getStartIntTime() ; //virtual double getStartIntTime( int i ) ; // Get Antenna Position in ITRF coordinate virtual std::vector getAntennaPosition() = 0 ; // Get SRCDIRECTION in RADEC(J2000) virtual Vector getSourceDirection() ; // Get DIRECTION in RADEC(J2000) virtual Vector getDirection( int i ) ; virtual void initConvert( int icoord, double t, char *epoch ) ; // Shift frequency by given velocity with respect to specified // velocity reference std::vector shiftFrequency( const std::vector &f, const double &v, const string &vref ) ; // filename string filename_ ; // dataset NRODataset *dataset_ ; // source direction Vector srcdir_ ; Vector msrcdir_ ; // for direction conversion CountedPtr converter_ ; CountedPtr mf_ ; MEpoch me_ ; MPosition mp_ ; int coord_ ; bool freqRefFromVREF_ ; // Logger LogIO os_ ; }; #endif /* NRO_READER_H */