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{
72public:
73 // This is not connected to any data, isValid always returns True,
74 // keywords and description return the default versions
75 // hasChanged returns False, name returns an empty string
76 // pastEnd returns False and next does nothing.
77 // setTime does nothing, currentRow returns an empty record
78 // and currentTime returns 0.0
79 // and ok returns True and nextTime returns 0.0
81 // Note, originalTable cannot be destructed, reopened, ...,during the
82 // lifetime of this object.
83 FITSTimedTable(FITSTabular *originalTable, uInt whichColumnIsTime=0);
85
86 virtual Bool isValid() const;
87 virtual const TableRecord &keywords() const;
88 virtual const RecordDesc &description() const;
89 virtual const Record &units() const;
90 virtual const Record &displayFormats() const;
91 virtual const Record &nulls() const;
92
93 virtual Bool hasChanged() const { return hasChanged_p;}
94 virtual void resetChangedFlag() { hasChanged_p = False; }
95 virtual const String &name() const { return table_p->name(); }
96 virtual Bool pastEnd() const;
97 virtual Bool pastEnd();
98 virtual void next();
99 // interpolate to the desired time which must be >= the currentTime()
100 // This uses a linear interpolation between adjacent floating point values.
101 // Non-floating point values are NOT interpolated but have the value of the
102 // most recent actual row. On the last row of the table, not interpolation
103 // is done.
104 virtual void setTime(Double time);
105 virtual const Record &currentRow() const;
106 virtual Record &currentRow();
107
108 // What is the time of the current row?
110
111 // this is True if the last setTime() finished as expected
112 // It is False only if the requested time is before the current time
113 // and the timed table as just been opened
114 Bool ok() const { return ok_p;}
115
116 // What will the time of the next row be? Returns a very large number if
117 // it is past the end of the table.
119private:
136
137 void initNowRecord(const RecordDesc& desc);
138 void initNextRecord(const RecordDesc& desc);
139};
140
141} //# NAMESPACE CASACORE - END
142
143#endif
virtual const String & name() const =0
return the name
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? Returns a very large number if it is past the end of the table...
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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1584
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