casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDFITSTable.h
Go to the documentation of this file.
1 //# SDFITSTable.h : this defines SDFITSTable, a FITSTable following the SD convention
2 //# Copyright (C) 1997,1999
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef FITS_SDFITSTABLE_H
30 #define FITS_SDFITSTABLE_H
31 
32 
33 #include <casacore/casa/aips.h>
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 // <summary>
40 // SDFITSTable is a FITSTable which follows the Single Dish FITS Convention.
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46 // </reviewed>
47 
48 // <prerequisite>
49 // <li> FITSTable
50 // </prerequisite>
51 //
52 // <etymology>
53 // SDFITSTable is derived from FITSTable. It contains additional
54 // checks and behaviour appropriate to the Single Dish FITS Convention
55 // hence this is a Single Dish FITS Table, or SDFITSTable.
56 // </etymology>
57 //
58 // <synopsis>
59 // This class behaves much like FITSTable. It additionally verifies
60 // that the indicated HDU in the input FITS file follows the SDFITS
61 // convention (it has all of the required columns) and it treats
62 // keywords as virtual columns when appropriate. These virtual
63 // columns will appear as fields in the currentRecord and description
64 // and will NOT appear in the keywords.
65 // </synopsis>
66 //
67 // <example>
68 // </example>
69 //
70 // <motivation>
71 // It was useful to encapsulate this behaviour in a class so that
72 // the checks on a valid SDFITS table and the treatment of keywords
73 // as virtual columns would not need to appear everywhere it might
74 // be used.
75 // </motivation>
76 //
77 // <thrown>
78 // <li>
79 // <li>
80 // </thrown>
81 //
82 // <todo asof="1997/01/14">
83 // <li> everything
84 // </todo>
85 
86 class SDFITSTable : public FITSTable
87 {
88 public:
89  // the core keywords, UNKNOWN is not a core keyword,
90  // NUM_CORE_KEYWORDS is a place holder
93  UNKNOWN=NUM_CORE_KEYWORDS };
94 
95  // construct from a file
96  SDFITSTable(const String &fileName, uInt whichHDU=1);
97 
98  // The destructor
99  ~SDFITSTable();
100 
101  // Attach this SDFITSTable to a new file name, same HDU# as at open time
102  virtual Bool reopen(const String &fileName);
103 
104  // is this a valid SDFITS file
105  virtual Bool isSDFITS() const { return isSDFITS_p;}
106 
107  // translate to/from core keyword names to enumeration
108  static CoreKeyword coreKeyword(const String& name);
110 
111 private:
113 
114  // block of core keyword names
116  // kwNames initialization function
117  static void init_kwNames();
118 
119  // check to see if the named keyword should
120  // be turned into a column, all non-reserved keywords will
121  // always be turned into a column.
122  static Bool isSDFitsColumn(const String& name);
123 
124  // the array of keyword names
125  // the regular FITSTable::reopen does nearly everything fine,
126  // this function moves stuff out of the keywords and into the
127  // output record as appropriate
128  void sdfits_shuffle();
129 
130  // undefined an inaccessible
131  SDFITSTable();
132  SDFITSTable(const SDFITSTable &);
134 };
135 
136 } //# NAMESPACE CASACORE - END
137 
138 #endif
139 
140 
CoreKeyword
the core keywords, UNKNOWN is not a core keyword, NUM_CORE_KEYWORDS is a place holder ...
Definition: SDFITSTable.h:91
virtual const String & name() const
return the name
Definition: FITSTable.h:221
static String coreKeywordName(CoreKeyword kw)
virtual Bool isSDFITS() const
is this a valid SDFITS file
Definition: SDFITSTable.h:105
static Bool isSDFitsColumn(const String &name)
check to see if the named keyword should be turned into a column, all non-reserved keywords will alwa...
SDFITSTable()
undefined an inaccessible
SDFITSTable is a FITSTable which follows the Single Dish FITS Convention.
Definition: SDFITSTable.h:86
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Attach a FITSTabular to a binary or ASCII table.
Definition: FITSTable.h:200
SDFITSTable & operator=(const SDFITSTable &)
void sdfits_shuffle()
the array of keyword names the regular FITSTable::reopen does nearly everything fine, this function moves stuff out of the keywords and into the output record as appropriate
simple 1-D array
Definition: Allocator.h:210
virtual Bool reopen(const String &fileName)
Attach this SDFITSTable to a new file name, same HDU# as at open time.
static CoreKeyword coreKeyword(const String &name)
translate to/from core keyword names to enumeration
~SDFITSTable()
The destructor.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
static Block< String > kwNames
block of core keyword names
Definition: SDFITSTable.h:115
unsigned int uInt
Definition: aipstype.h:51
static void init_kwNames()
kwNames initialization function