casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
casacore::MeasIERS Class Reference

Interface to IERS tables. More...

#include <MeasIERS.h>

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. More...
 

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). More...
 
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. More...
 
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. More...
 
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. More...
 
static void openNote (CLOSEFUN fun)
 Notify that a table has successfully been opened with getTable() More...
 
static void closeTables ()
 Make sure all static tables are closed that were opened with getTable (like JPL, IERS). More...
 
static void closeMeas ()
 Close the set of IERS tables only. More...
 

Static Public Attributes

static const Double INTV
 

Private Member Functions

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

Static Private Member Functions

static void initMeas ()
 Destructor, NOT defined and not declared to stop warning ~MeasIERS();. More...
 
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. More...
 

Static Private Attributes

static std::once_flag theirCallOnceFlag
 Object to ensure safe multi-threaded lazy single initialization. More...
 
static Double dateNow
 Current date. More...
 
static Vector< Doubleldat [N_Files][N_Types]
 Read data (meas - predict) More...
 
static const String tp [N_Files]
 File names. More...
 
static uInt predicttime_reg
 Check prediction interval. More...
 
static uInt notable_reg
 Use no table. More...
 
static uInt forcepredict_reg
 Force prediction. More...
 
static uInt sizeNote
 Size of close notification list. More...
 
static CLOSEFUNtoclose
 Tables notifying that they should be closed. More...
 
static uInt nNote
 Number of close notifications. More...
 

Detailed Description

Interface to IERS tables.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tMeasMath

Prerequisite

Etymology

From Measure and IERS

Synopsis

MeasIERS is the interface class to the global IERS data. It has only static members.
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 123 of file MeasIERS.h.

Member Typedef Documentation

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

Define the function pointer to be called to close files.

Definition at line 128 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 166 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 135 of file MeasIERS.h.

Constructor & Destructor Documentation

casacore::MeasIERS::MeasIERS ( )
private

Default constructor, NOT defined.

Member Function Documentation

static void casacore::MeasIERS::closeMeas ( )
static

Close the set of IERS tables only.

Only call it last at end of program.

static void casacore::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. Only call it last at end of program.

static Bool casacore::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 casacore::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 casacore::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 casacore::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 casacore::MeasIERS::handle_keywords ( Double dt,
String vs,
const TableRecord ks,
const Table tab 
)
staticprivate

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 void casacore::MeasIERS::initMeas ( )
staticprivate

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

Initialise tables

static void casacore::MeasIERS::openNote ( CLOSEFUN  fun)
static

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

MeasIERS& casacore::MeasIERS::operator= ( const MeasIERS other)
private

Copy assign, NOT defined.

Member Data Documentation

Double casacore::MeasIERS::dateNow
staticprivate

Current date.

Definition at line 270 of file MeasIERS.h.

uInt casacore::MeasIERS::forcepredict_reg
staticprivate

Force prediction.

Definition at line 280 of file MeasIERS.h.

const Double casacore::MeasIERS::INTV
static

Definition at line 131 of file MeasIERS.h.

Vector<Double> casacore::MeasIERS::ldat[N_Files][N_Types]
staticprivate

Read data (meas - predict)

Definition at line 272 of file MeasIERS.h.

uInt casacore::MeasIERS::nNote
staticprivate

Number of close notifications.

Definition at line 286 of file MeasIERS.h.

uInt casacore::MeasIERS::notable_reg
staticprivate

Use no table.

Definition at line 278 of file MeasIERS.h.

uInt casacore::MeasIERS::predicttime_reg
staticprivate

Check prediction interval.

Definition at line 276 of file MeasIERS.h.

uInt casacore::MeasIERS::sizeNote
staticprivate

Size of close notification list.

Definition at line 282 of file MeasIERS.h.

std::once_flag casacore::MeasIERS::theirCallOnceFlag
staticprivate

Object to ensure safe multi-threaded lazy single initialization.

Definition at line 268 of file MeasIERS.h.

CLOSEFUN* casacore::MeasIERS::toclose
staticprivate

Tables notifying that they should be closed.

Definition at line 284 of file MeasIERS.h.

const String casacore::MeasIERS::tp[N_Files]
staticprivate

File names.

Definition at line 274 of file MeasIERS.h.


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