casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SDFITSTable.h
Go to the documentation of this file.
00001 //# SDFITSTable.h : this defines SDFITSTable,  a FITSTable following the SD convention
00002 //# Copyright (C) 1997,1999
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 addressed 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: SDFITSTable.h 18093 2004-11-30 17:51:10Z ddebonis $
00028 
00029 #ifndef FITS_SDFITSTABLE_H
00030 #define FITS_SDFITSTABLE_H
00031 
00032 
00033 #include <casa/aips.h>
00034 #include <fits/FITS/FITSTable.h>
00035 #include <casa/Containers/Block.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 // <summary>
00040 // SDFITSTable is a FITSTable which follows the Single Dish FITS Convention.
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00046 // </reviewed>
00047 
00048 // <prerequisite>
00049 //   <li> FITSTable
00050 // </prerequisite>
00051 //
00052 // <etymology>
00053 // SDFITSTable is derived from FITSTable.  It contains additional
00054 // checks and behaviour appropriate to the Single Dish FITS Convention
00055 // hence this is a Single Dish FITS Table, or SDFITSTable.
00056 // </etymology>
00057 //
00058 // <synopsis>
00059 // This class behaves much like FITSTable.  It additionally verifies
00060 // that the indicated HDU in the input FITS file follows the SDFITS
00061 // convention (it has all of the required columns) and it treats
00062 // keywords as virtual columns when appropriate.  These virtual
00063 // columns will appear as fields in the currentRecord and description
00064 // and will NOT appear in the keywords.
00065 // </synopsis>
00066 //
00067 // <example>
00068 // </example>
00069 //
00070 // <motivation>
00071 // It was useful to encapsulate this behaviour in a class so that
00072 // the checks on a valid SDFITS table and the treatment of keywords
00073 // as virtual columns would not need to appear everywhere it might
00074 // be used.
00075 // </motivation>
00076 //
00077 // <thrown>
00078 //    <li>
00079 //    <li>
00080 // </thrown>
00081 //
00082 // <todo asof="1997/01/14">
00083 //   <li> everything
00084 // </todo>
00085 
00086 class SDFITSTable : public FITSTable
00087 {
00088 public:
00089     // the core keywords, UNKNOWN is not a core keyword,
00090     // NUM_CORE_KEYWORDS is a place holder
00091     enum CoreKeyword { OBJECT, TELESCOP, BANDWID, DATEOBS,
00092                        EXPOSURE, TSYS, NUM_CORE_KEYWORDS, 
00093                        UNKNOWN=NUM_CORE_KEYWORDS };
00094 
00095     // construct from a file
00096     SDFITSTable(const String &fileName, uInt whichHDU=1);
00097 
00098     // The destructor
00099     ~SDFITSTable();
00100 
00101     // Attach this SDFITSTable to a new file name, same HDU# as at open time
00102     virtual Bool reopen(const String &fileName);
00103 
00104     // is this a valid SDFITS file
00105     virtual Bool isSDFITS() const { return isSDFITS_p;}
00106 
00107     // translate to/from core keyword names to enumeration
00108     static CoreKeyword coreKeyword(const String& name);
00109     static String coreKeywordName(CoreKeyword kw);
00110 
00111 private:
00112     Bool isSDFITS_p;
00113 
00114     // block of core keyword names
00115     static Block<String> kwNames;
00116     // kwNames initialization function
00117     static void init_kwNames();
00118 
00119     // check to see if the named keyword should
00120     // be turned into a column, all non-reserved keywords will
00121     // always be turned into a column.
00122     static Bool isSDFitsColumn(const String& name);
00123 
00124     // the array of keyword names
00125     // the regular FITSTable::reopen does nearly everything fine,
00126     // this function moves stuff out of the keywords and into the
00127     // output record as appropriate
00128     void sdfits_shuffle();
00129 
00130     // undefined an inaccessible
00131     SDFITSTable();
00132     SDFITSTable(const SDFITSTable &);
00133     SDFITSTable &operator=(const SDFITSTable &);
00134 };
00135 
00136 } //# NAMESPACE CASA - END
00137 
00138 #endif
00139 
00140