casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
casa::MeasIERS Class Reference

Interface to IERS tables. More...

#include <MeasIERS.h>

List of all members.

Public Types

enum  Types {
  MJD,
  X,
  Y,
  dUT1,
  LOD,
  dPsi,
  dEps,
  DX,
  DY,
  DdUT1,
  DLOD,
  DdPsi,
  DdEps,
  N_Types
}
 Types of known data. More...
enum  Files {
  MEASURED,
  PREDICTED,
  N_Files,
  DEFAULT
}
 Types of files. More...
typedef void(* CLOSEFUN )()
 Define the function pointer to be called to close files.

Static Public Member Functions

static Bool get (Double &returnValue, MeasIERS::Files file, MeasIERS::Types type, Double date)
 Get the value from an IERS table, interpolated for date(in MJD).
static Bool getTable (Table &table, TableRecord &kws, ROTableRow &row, RORecordFieldPtr< Double > rfp[], String &vs, Double &dt, Int N, const String rfn[], const String &name, const String &rc, const String &dir, const Table *tabin=0)
 Find and open table tab, using the rc variable, the dir and the name.
static Bool getTable (Table &table, TableRecord &kws, ROTableRow &row, Vector< RORecordFieldPtr< Double > > &rfp, String &vs, Double &dt, const Vector< String > &reqcols, Vector< String > &optcols, const String &name, const String &rc, const String &dir, const Table *tabin=0)
 Find and open table tab, using the rc variable, the dir and the name.
static Bool findTab (Table &tab, const Table *tabin, const String &rc, const String &dir, const String &name)
 A helper function for getTable() which is conceivably usable outside it, for finding a table in the same way, but not requiring it to fit the IERS mold.
static void openNote (CLOSEFUN fun)
 Notify that a table has successfully been opened with getTable()
static void closeTables ()
 Make sure all static tables are closed that were opened with getTable (like JPL, IERS).
static void closeMeas ()
 Close the set of IERS tables only.

Static Public Attributes

static const Double INTV

Private Member Functions

 MeasIERS ()
 Default constructor, NOT defined.
MeasIERSoperator= (const MeasIERS &other)
 Copy assign, NOT defined.

Static Private Member Functions

static Bool initMeas (MeasIERS::Files which)
 Destructor, NOT defined and not declared to stop warning ~MeasIERS();.
static Bool fillMeas (MeasIERS::Files which, Double utf)
 Fill Table lines.
static Bool handle_keywords (Double &dt, String &vs, const TableRecord &ks, const Table &tab)
 A helper function for getTable() which is not likely usable outside it.

Static Private Attributes

static volatile Bool measFlag [N_Files]
 Measured data read.
static Double dateNow
 Current date.
static Table t [N_Files]
 Open tables.
static ROTableRow row [N_Files]
 Row descriptions.
static RORecordFieldPtr< Doublerfp [N_Files][MeasIERS::N_Types]
 Field pointers.
static Int mjd0 [N_Files]
 First (-1) MJD in list.
static Int mjdl [N_Files]
 Last MJD in list.
static Double ldat [2 *N_Files][N_Types]
 Last read data (measlow - predictlow - meashigh - predicthigh)
static Bool msgDone
 Message given.
static const String tp [N_Files]
 File names.
static uInt predicttime_reg
 Check prediction interval.
static uInt notable_reg
 Use no table.
static uInt forcepredict_reg
 Force prediction.
static uInt sizeNote
 Size of close notification list.
static CLOSEFUNtoclose
 Tables notifying that they should be closed.
static uInt nNote
 Number of close notifications.
static Mutex theirMutex
 Mutex for thread-safety.

Detailed Description

Interface to IERS tables.

Intended use:

Internal

 <h3>Review Status</h3><dl><dt>Reviewed By:<dd>UNKNOWN<dt>Date Reviewed:<dd>before2004/08/25<dt>Test programs:<dd>tMeasMath</dl> 

Prerequisite

Etymology

From Measure and IERS

Synopsis

MeasIERS is the interface class to the IERS data. It has only static memebers.
It has a member (getTable()) to open and check IERS (and other Measures related Tables) type tables. Tables are found using the aipsrc (using measures.<table>.directory, or measures.directory) mechanism. If not provided they are assumed to reside in standard places (i.e. they are looked for in (udir in following normally given by program as ephemerides or geodetic) '.', './data', '~/aips++/data/udir', '$AIPSROOT/data/udir', '~/aips++/code/trial/apps/measures', '$AIPSROOT/data/udir' (last two only ad interim)). They are also looked for in data/{ephemerides,geodetic} (root and user aips++).

If an explicit Table object is given the lookup is bypassed, and the Table provided is used. The table should still be named.

Tables are assumed to have the VS_VERSION, VS_DATE, VS_CREATE and VS_TYPE keywords, and be of type IERS, else an exception will be thrown.
The get() method will obtain data from measured and predicted Earth Orientation Parameters IERS tables (i.e. the IERSeop97 and the IERSpredict tables. If not forced, the data is taken from the measured table if possible. Only if forced (see below), or if data is not (yet) available in measured the predicted values are used. A warning message is (once) issued if values are not available at all.

MeasIERS looks at some Aipsrc values to determine actions:

These values can be set in aipsrc as well as using AipsrcValue set() methods.
Note: A message is Logged (once) if an IERS table cannot be found; A message is logged (once) if a date outside the range in the Tables is asked for;

Thrown Exceptions

Example

See the dUTC() method in MeasTable for an example of the getTable method; and the polarMotion() method for an example of get().

Motivation

To use the IERS data for time and nutation calculations

Definition at line 122 of file MeasIERS.h.


Member Typedef Documentation

typedef void(* casa::MeasIERS::CLOSEFUN)()

Define the function pointer to be called to close files.

Definition at line 127 of file MeasIERS.h.


Member Enumeration Documentation

Types of files.

Enumerator:
MEASURED 

Measured EOP values.

PREDICTED 

Predicted EOP values.

N_Files 

of known types

DEFAULT 

Default.

Definition at line 165 of file MeasIERS.h.

Types of known data.

Enumerator:
MJD 

MJD (must be first in list)

X 

Polar motion x.

Y 

Polar motion y.

dUT1 

UT1-UTC.

LOD 

Length of Day.

dPsi 

dPsi

dEps 

dEpsilon

DX 

Polar motion x error.

DY 

Polar motion y error.

DdUT1 

UT1-UTC error.

DLOD 

Length of Day error.

DdPsi 

dPsi error

DdEps 

dEpsilon error

N_Types 

Number of types.

Definition at line 134 of file MeasIERS.h.


Constructor & Destructor Documentation

casa::MeasIERS::MeasIERS ( ) [private]

Default constructor, NOT defined.


Member Function Documentation

static void casa::MeasIERS::closeMeas ( ) [static]

Close the set of IERS tables only.

static void casa::MeasIERS::closeTables ( ) [static]

Make sure all static tables are closed that were opened with getTable (like JPL, IERS).

This is the preferred way to close the Measures related data tables.

static Bool casa::MeasIERS::fillMeas ( MeasIERS::Files  which,
Double  utf 
) [static, private]

Fill Table lines.

static Bool casa::MeasIERS::findTab ( Table tab,
const Table tabin,
const String rc,
const String dir,
const String name 
) [static]

A helper function for getTable() which is conceivably usable outside it, for finding a table in the same way, but not requiring it to fit the IERS mold.

Finds a Table for tab, by looking in tabin, rc, dir, and name. Returns whether or not it was successful.

static Bool casa::MeasIERS::get ( Double returnValue,
MeasIERS::Files  file,
MeasIERS::Types  type,
Double  date 
) [static]

Get the value from an IERS table, interpolated for date(in MJD).

The file can be PREDICTED or MEASURED, the type as given in enum.

static Bool casa::MeasIERS::getTable ( Table table,
TableRecord kws,
ROTableRow row,
RORecordFieldPtr< Double rfp[],
String vs,
Double dt,
Int  N,
const String  rfn[],
const String name,
const String rc,
const String dir,
const Table tabin = 0 
) [static]

Find and open table tab, using the rc variable, the dir and the name.

An rfn list gives the N row field names to be used Returned are an open table, the table keywordset (kws), a row record, pointers (rfp) to row data, the table version (vs), dt, and, directly, whether or not it was successful. Lookup for name is bypassed if the Table address tabin is provided.

Thrown Exceptions

  • AipsError if missing VS_ keywords, columns, or they type is not IERS.
static Bool casa::MeasIERS::getTable ( Table table,
TableRecord kws,
ROTableRow row,
Vector< RORecordFieldPtr< Double > > &  rfp,
String vs,
Double dt,
const Vector< String > &  reqcols,
Vector< String > &  optcols,
const String name,
const String rc,
const String dir,
const Table tabin = 0 
) [static]

Find and open table tab, using the rc variable, the dir and the name.

reqcols gives the names (in order) of the columns which must be present. optcols gives the names of columns which should be added, in order after reqcols, if they are present. Returned are an open table, the table keywordset (kws), a row record, pointers (rfp) to row data, the table version (vs), dt, and, directly, whether or not it was successful. optcols is set to the optional columns that were found. Lookup for name is bypassed if the Table address tabin is provided.

Thrown Exceptions

  • AipsError if missing VS_ keywords, required columns, or the type is not IERS.
static Bool casa::MeasIERS::handle_keywords ( Double dt,
String vs,
const TableRecord ks,
const Table tab 
) [static, private]

A helper function for getTable() which is not likely usable outside it.

Sets dt and vs (the table version), and checks that ks has VS_DATE, VS_VERSION, VS_CREATE, and VS_TYPE, and that tab's type is IERS in its info. Returns whether or not it was successful.

static Bool casa::MeasIERS::initMeas ( MeasIERS::Files  which) [static, private]

Destructor, NOT defined and not declared to stop warning ~MeasIERS();.

Initialise tables

static void casa::MeasIERS::openNote ( CLOSEFUN  fun) [static]

Notify that a table has successfully been opened with getTable()

MeasIERS& casa::MeasIERS::operator= ( const MeasIERS other) [private]

Copy assign, NOT defined.


Member Data Documentation

Double casa::MeasIERS::dateNow [static, private]

Current date.

Definition at line 271 of file MeasIERS.h.

Force prediction.

Definition at line 293 of file MeasIERS.h.

const Double casa::MeasIERS::INTV [static]

Definition at line 130 of file MeasIERS.h.

Double casa::MeasIERS::ldat[2 *N_Files][N_Types] [static, private]

Last read data (measlow - predictlow - meashigh - predicthigh)

Definition at line 283 of file MeasIERS.h.

volatile Bool casa::MeasIERS::measFlag[N_Files] [static, private]

Measured data read.

Definition at line 269 of file MeasIERS.h.

Int casa::MeasIERS::mjd0[N_Files] [static, private]

First (-1) MJD in list.

Definition at line 279 of file MeasIERS.h.

Int casa::MeasIERS::mjdl[N_Files] [static, private]

Last MJD in list.

Definition at line 281 of file MeasIERS.h.

Bool casa::MeasIERS::msgDone [static, private]

Message given.

Definition at line 285 of file MeasIERS.h.

uInt casa::MeasIERS::nNote [static, private]

Number of close notifications.

Definition at line 299 of file MeasIERS.h.

uInt casa::MeasIERS::notable_reg [static, private]

Use no table.

Definition at line 291 of file MeasIERS.h.

Check prediction interval.

Definition at line 289 of file MeasIERS.h.

Field pointers.

Definition at line 277 of file MeasIERS.h.

Row descriptions.

Definition at line 275 of file MeasIERS.h.

uInt casa::MeasIERS::sizeNote [static, private]

Size of close notification list.

Definition at line 295 of file MeasIERS.h.

Table casa::MeasIERS::t[N_Files] [static, private]

Open tables.

Definition at line 273 of file MeasIERS.h.

Mutex casa::MeasIERS::theirMutex [static, private]

Mutex for thread-safety.

Definition at line 301 of file MeasIERS.h.

CLOSEFUN* casa::MeasIERS::toclose [static, private]

Tables notifying that they should be closed.

Definition at line 297 of file MeasIERS.h.

const String casa::MeasIERS::tp[N_Files] [static, private]

File names.

Definition at line 287 of file MeasIERS.h.


The documentation for this class was generated from the following file: