casacore
Loading...
Searching...
No Matches
FITSMultiTable.h
Go to the documentation of this file.
1//# FITSMultiTable.h: View multiple FITS files as a single table
2//# Copyright (C) 1995,1996,1997
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: casa-feedback@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#ifndef FITS_FITSMULTITABLE_H
27#define FITS_FITSMULTITABLE_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/fits/FITS/FITSTable.h>
31#include <casacore/casa/OS/Time.h>
32#include <casacore/casa/BasicSL/String.h>
33#include <casacore/casa/Arrays/Vector.h>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37// <summary>
38// View multiple FITS files as a single table
39// </summary>
40
41// <use visibility=local>
42
43// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
44// </reviewed>
45
46// <synopsis>
47// A FITSMultiTable is used to view a collection of FITS files on disk as a
48// single Table. That is, when next() is called, when one Table ends the next
49// is reopened until all files are exhausted. The FITS files must all have the
50// same description. Something clever should be done about the keywords.
51// </synopsis>
52//
53// <example>
54// </example>
55//
56// <motivation>
57// </motivation>
58//
59// <todo asof="yyyy/mm/dd">
60// </todo>
61
63{
64public:
65 // The FITS files associated with the fileNames must all have the same
66 // description, the second argument is a function to generate the
67 // FITSTabular If not specified, a generic FITSTable is assumed.
68 // The returned pointer IS controlled by this object.
70 FITSTabular* (*tabMaker)(const String &) = 0);
72
73 virtual Bool isValid() const;
74 virtual const TableRecord &keywords() const;
75 virtual const RecordDesc &description() const;
76 virtual const Record &units() const;
77 virtual const Record &displayFormats() const;
78 virtual const Record &nulls() const;
79
80 virtual const String &name() const { return table_p->name(); }
81
82 // Only returns True when all files are exhausted.
83 virtual Bool pastEnd() const;
84 // When end of data is hit on the current file, the next file is opened
85 // automatically.
86 virtual void next();
87 virtual const Record &currentRow() const;
88
89 // get the list of file names
90 const Vector<String>& fileNames() const { return file_names_p;}
91
92 // Has the descriptor changed from when the file was opened
93 virtual Bool hasChanged() const { return hasChanged_p;}
94
95 // set hasChanged to False - used after hasChanged has been checked
97
98 // A helper function to generate a list of fileNames. This function returns
99 // all the files in "directoryName" which have the form
100 // yyyy_mm_dd_hh:mm:ss_*.fits and which are (even partially)
101 // in the time range specified by startTime and endTime. It is used to
102 // generate a set of file names for use in the FITSMultiTable constructor.
103 // If verboseStatus is True, some status messages appear on cout.
104 // If verboseErrors is True improperly named files names (not matching the above
105 // pattern) are named on cerrt.
106 static Vector<String> filesInTimeRange(const String &directoryName,
107 const Time &startTime, const Time &endTime,
108 Bool verboseErrors = False,
109 Bool verboseStatus = False);
110 // return the time as found in the given string using the form given above
111 // There are no sanity checks in this subroutine
112 static Time timeFromFile(const String &fileName);
113
114private:
115 // Undefined and inaccessible
119
121
126
128
129 FITSTabular* defaultMaker(const String& fileName);
130};
131
132
133} //# NAMESPACE CASACORE - END
134
135#endif
FITSMultiTable()
Undefined and inaccessible.
FITSMultiTable & operator=(const FITSMultiTable &other)
virtual Bool isValid() const
isValid() returns False if this object isn't a valid Tabular data structure.
static Time timeFromFile(const String &fileName)
return the time as found in the given string using the form given above There are no sanity checks in...
FITSMultiTable(const Vector< String > &fileNames, FITSTabular *(*tabMaker)(const String &)=0)
The FITS files associated with the fileNames must all have the same description, the second argument ...
Vector< String > file_names_p
virtual const Record & displayFormats() const
Returns any TDISPnnn associated with a column (the field names are the column names,...
virtual Bool pastEnd() const
Only returns True when all files are exhausted.
const Vector< String > & fileNames() const
get the list of file names
virtual const TableRecord & keywords() const
Returns keywords which are associated with the underlying FITS files.
FITSMultiTable(const FITSMultiTable &other)
virtual const Record & nulls() const
Returns any TNULLnnn associated with a column (the field names are the column names,...
FITSTabular * defaultMaker(const String &fileName)
virtual const String & name() const
return the name
virtual Bool hasChanged() const
Has the descriptor changed from when the file was opened.
virtual const Record & units() const
Returns any TUNITnnn associated with a column (the field names are the column names,...
virtual void next()
When end of data is hit on the current file, the next file is opened automatically.
void resetChangedFlag()
set hasChanged to False - used after hasChanged has been checked
virtual const RecordDesc & description() const
Returns the description of the underlying FITS table.
virtual const Record & currentRow() const
Return the currentRow.
static Vector< String > filesInTimeRange(const String &directoryName, const Time &startTime, const Time &endTime, Bool verboseErrors=False, Bool verboseStatus=False)
A helper function to generate a list of fileNames.
virtual const String & name() const =0
return the name
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40