Loading...
Searching...
No Matches
casacore::MeasIERS Class Reference
measures package (libcasa_measures) » Measures_module » Measures_module_internal_classes

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.

## 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.
MeasIERS & | operator= (const MeasIERS &other)
| Copy assign, NOT defined.

## Static Private Member Functions

static void | initMeas ()
| Destructor, NOT defined and not declared to stop warning ~MeasIERS();.
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 std::once_flag | theirCallOnceFlag
| Object to ensure safe multi-threaded lazy single initialization.
static Double | dateNow
| Current date.
static Vector< Double > | ldat [N_Files][N_Types]
| Read data (meas - predict).
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 CLOSEFUN * | toclose
| Tables notifying that they should be closed.
static uInt | nNote
| Number of close notifications.

## Detailed Description

Interface to IERS tables

### Intended use:

Internal

### Review Status

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

### Prerequisite

- MeasTable

### 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 package (libcasa_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:

- measures.measiers.b_notable : Do not use IERS tables to convert measures
- measures.measiers.b_forcepredict : Use values from prediction tables even if Measured table asked by program.
- measures.measiers.d_predicttime : Use values from prediction tables if (now - time) less than value given (default 5) (days)

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

- AipsError if table opened has wrong format or otherwise corrupted.

### 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 121 of file MeasIERS.h.

## Member Typedef Documentation

## CLOSEFUN

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

Define the function pointer to be called to close files.

Definition at line 126 of file MeasIERS.h.

## Member Enumeration Documentation

## Files

enum casacore::MeasIERS::Files

Types of files.

Enumerator
MEASURED | Measured EOP values.
PREDICTED | Predicted EOP values.

N_Files

# of known types

DEFAULT | Default.

Definition at line 164 of file MeasIERS.h.

## Types

enum casacore::MeasIERS::Types

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 133 of file MeasIERS.h.

## Constructor & Destructor Documentation

## MeasIERS()

casacore::MeasIERS::MeasIERS | ( |  | ) |

private

Default constructor, NOT defined.

Referenced by operator=().

## Member Function Documentation

## closeMeas()

void casacore::MeasIERS::closeMeas | ( |  | ) |

static

Close the set of IERS tables only.

Only call it last at end of program.

## closeTables()

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.

## findTab()

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.

References casacore::name().

## get()

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.

References casacore::date().

## getTable() [1/2]

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.

References casacore::name().

## getTable() [2/2]

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.

References casacore::name().

## handle_keywords()

Bool casacore::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.

## initMeas()

void casacore::MeasIERS::initMeas | ( |  | ) |

static private

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

Initialise tables

## openNote()

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

static

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

## operator=()

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

private

Copy assign, NOT defined.

References MeasIERS().

## Member Data Documentation

## dateNow

Double casacore::MeasIERS::dateNow

static private

Current date.

Definition at line 268 of file MeasIERS.h.

## forcepredict_reg

uInt casacore::MeasIERS::forcepredict_reg

static private

Force prediction.

Definition at line 278 of file MeasIERS.h.

## INTV

const Double casacore::MeasIERS::INTV

static

Definition at line 129 of file MeasIERS.h.

## ldat

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

static private

Read data (meas - predict).

Definition at line 270 of file MeasIERS.h.

## nNote

uInt casacore::MeasIERS::nNote

static private

Number of close notifications.

Definition at line 284 of file MeasIERS.h.

## notable_reg

uInt casacore::MeasIERS::notable_reg

static private

Use no table.

Definition at line 276 of file MeasIERS.h.

## predicttime_reg

uInt casacore::MeasIERS::predicttime_reg

static private

Check prediction interval.

Definition at line 274 of file MeasIERS.h.

## sizeNote

uInt casacore::MeasIERS::sizeNote

static private

Size of close notification list.

Definition at line 280 of file MeasIERS.h.

## theirCallOnceFlag

std::once_flag casacore::MeasIERS::theirCallOnceFlag

static private

Object to ensure safe multi-threaded lazy single initialization.

Definition at line 266 of file MeasIERS.h.

## toclose

CLOSEFUN* casacore::MeasIERS::toclose

static private

Tables notifying that they should be closed.

Definition at line 282 of file MeasIERS.h.

## tp

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

static private

File names.

Definition at line 272 of file MeasIERS.h.

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

- measures/Measures/MeasIERS.h