casacore
Loading...
Searching...
No Matches
FITSTimedTable.h
Go to the documentation of this file.
1// # FITSTimedTable.h: A Table with a time column
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_FITSTIMEDTABLE_H
27#define FITS_FITSTIMEDTABLE_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/fits/FITS/FITSTable.h>
31#include <casacore/casa/Containers/Record.h>
32#include <casacore/casa/Containers/RecordField.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// </summary>
38
39// <use visibility=export>
40
41// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
42// </reviewed>
43
44// <prerequisite>
45// <li>
46// </prerequisite>
47//
48// <etymology>
49// </etymology>
50//
51// <synopsis>
52// FITSTimedTable is used to look at FITS tables which have a time column. In
53// particular, it peeks ahead, and knows the time of the currentRow and of the
54// nextRow.
55//
56// It is constructed with a pointer to any FITSTabular. Presently, no memory
57// management is imposed to ensure that the pointer remains valid.
58// </synopsis>
59//
60// <example>
61// </example>
62//
63// <motivation>
64// </motivation>
65//
66// <todo asof="1995/06/01">
67// <li>
68// </todo>
69
71 public:
72 // This is not connected to any data, isValid always returns True,
73 // keywords and description return the default versions
74 // hasChanged returns False, name returns an empty string
75 // pastEnd returns False and next does nothing.
76 // setTime does nothing, currentRow returns an empty record
77 // and currentTime returns 0.0
78 // and ok returns True and nextTime returns 0.0
80 // Note, originalTable cannot be destructed, reopened, ...,during the
81 // lifetime of this object.
82 FITSTimedTable(FITSTabular *originalTable, uInt whichColumnIsTime = 0);
84
85 virtual Bool isValid() const;
86 virtual const TableRecord &keywords() const;
87 virtual const RecordDesc &description() const;
88 virtual const Record &units() const;
89 virtual const Record &displayFormats() const;
90 virtual const Record &nulls() const;
91
92 virtual Bool hasChanged() const { return hasChanged_p; }
93 virtual void resetChangedFlag() { hasChanged_p = False; }
94 virtual const String &name() const { return table_p->name(); }
95 virtual Bool pastEnd() const;
96 virtual Bool pastEnd();
97 virtual void next();
98 // interpolate to the desired time which must be >= the currentTime()
99 // This uses a linear interpolation between adjacent floating point values.
100 // Non-floating point values are NOT interpolated but have the value of the
101 // most recent actual row. On the last row of the table, not interpolation
102 // is done.
103 virtual void setTime(Double time);
104 virtual const Record &currentRow() const;
105 virtual Record &currentRow();
106
107 // What is the time of the current row?
109
110 // this is True if the last setTime() finished as expected
111 // It is False only if the requested time is before the current time
112 // and the timed table as just been opened
113 Bool ok() const { return ok_p; }
114
115 // What will the time of the next row be? Returns a very large number if
116 // it is past the end of the table.
118
119 private:
136
137 void initNowRecord(const RecordDesc &desc);
138 void initNextRecord(const RecordDesc &desc);
139};
140
141} // namespace casacore
142
143#endif
Double currentTime() const
What is the time of the current row?
virtual void setTime(Double time)
interpolate to the desired time which must be >= the currentTime() This uses a linear interpolation b...
RORecordFieldPtr< Double > time_next_p
FITSTimedTable()
This is not connected to any data, isValid always returns True, keywords and description return the d...
virtual void resetChangedFlag()
reset the changed flag, default do nothing
virtual Bool isValid() const
isValid() returns False if this object isn't a valid Tabular data structure.
virtual const Record & displayFormats() const
Returns any TDISPnnn associated with a column (the field names are the column names,...
virtual const Record & nulls() const
Returns any TNULLnnn associated with a column (the field names are the column names,...
void initNowRecord(const RecordDesc &desc)
Bool ok() const
this is True if the last setTime() finished as expected It is False only if the requested time is bef...
virtual Bool pastEnd()
virtual const TableRecord & keywords() const
Returns keywords which are associated with the underlying FITS files.
virtual const String & name() const
return the name
FITSTimedTable(FITSTabular *originalTable, uInt whichColumnIsTime=0)
Note, originalTable cannot be destructed, reopened,...,during the lifetime of this object.
virtual const RecordDesc & description() const
Returns the description of the underlying FITS table.
virtual const Record & currentRow() const
Return the currentRow.
void initNextRecord(const RecordDesc &desc)
RORecordFieldPtr< Double > time_now_p
Double nextTime()
What will the time of the next row be?
virtual const Record & units() const
Returns any TUNITnnn associated with a column (the field names are the column names,...
virtual Record & currentRow()
virtual Bool pastEnd() const
Returns True if we have advanced past the end of data.
virtual Bool hasChanged() const
Has the description changed since construction, default is False.
virtual void next()
Advance the row if possible (guaranteed harmless if pastEnd() is True.
Read-Only access to an individual field from a Record.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1368
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53