casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSFitsIDI.h
Go to the documentation of this file.
00001 //# MSFitsIDI.h: Convert FITS-IDI data to MS format
00002 //# Copyright (C) 1996,1997,1998,1999,2001
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be adressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id: MSFitsIDI.h 21069 2011-05-06 13:59:44Z gervandiepen $
00028 
00029 #ifndef MS_MSFITSIDI_H
00030 #define MS_MSFITSIDI_H
00031 
00032 #include <casa/aips.h>
00033 #include <fits/FITS/fits.h>
00034 #include <casa/BasicSL/String.h>
00035 #include <ms/MeasurementSets/MeasurementSet.h>
00036 #include <casa/OS/Path.h>
00037 #include <casa/Arrays/Vector.h>
00038 
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 
00041 // <summary> 
00042 // MSFitsIDI: Convert FITS-IDI data to MS format
00043 // </summary>
00044 
00045 // <use visibility=export>
00046 
00047 // <reviewed reviewer="" date="" tests="" demos="">
00048 
00049 // <prerequisite>
00050 //   <li> <linkto class="MeasurementSet">MeasurementSet</linkto> module
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // From "MS" and "FITS-IDI
00055 // </etymology>
00056 //
00057 // <synopsis>
00058 // The MSFitsIDI class converts FITS-IDI data, on tape or disk,
00059 // to MeasurementSet (MS) format.
00060 // </etymology>
00061 //
00062 // <example>
00063 // <srcblock>
00064 // </srcblock>
00065 // </example>
00066 //
00067 // <motivation>
00068 // Encapsulate all FITS-IDI to MS conversion capabilities.
00069 // </motivation>
00070 //
00071 // <todo asof="01/03/15">
00072 // (i) General input filtering.
00073 // (ii) VLBA digital correlator corrections
00074 // (iii) Convert all sub-tables
00075 // </todo>
00076 
00077 class MSFitsIDI
00078 {
00079  public:
00080   // Construct from a tape device name and MS output file name
00081   MSFitsIDI(const Path& tapeDevice, const String& msOut, 
00082             const Bool& overWrite, const Int& obsType=0);
00083 
00084   // Construct from an input file name and an MS output file name
00085   MSFitsIDI(const String& inFile, const String& msOut, 
00086             const Bool& overWrite, const Int& obsType=0);
00087 
00088   // Destructor
00089   ~MSFitsIDI();
00090   
00091   // Set which files are selected (1-rel; for tape-based data)
00092   void selectFiles(const Vector<Int>& files);
00093 
00094   // Convert the FITS-IDI data to MS format
00095   Bool fillMS();
00096 
00097  protected:
00098   // Initialization (called by all constructors)
00099   void init(const String& dataSource, const FITS::FitsDevice& deviceType,
00100             const String& msOut, const Bool& overWrite, const Int& obsType);
00101 
00102   // Read and process a FITS-IDI file
00103   void readFITSFile(Bool& atEnd);
00104 
00105  private:
00106   // Data source and device type
00107   String itsDataSource;
00108   FITS::FitsDevice itsDeviceType;
00109 
00110   // MS, status and write options
00111   String itsMSOut;
00112   Bool itsMSExists;
00113   Int itsObsType;  // 0=standard, 1=fastmosaic, requiring small tiles in the measurement set
00114 
00115   // Selected file numbers (1-relative)
00116   Vector<Int> itsSelectedFiles;
00117   Bool itsAllFilesSelected;
00118 
00119 };
00120 
00121 
00122 } //# NAMESPACE CASA - END
00123 
00124 #endif
00125