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

More...

`#include <MeasJPL.h>`

## Public Types

enum | Types { MJD , X , N_Columns , MERCURY , VENUS , EARTH , MARS , JUPITER , SATURN , URANUS , NEPTUNE , PLUTO , MOON , SUN , BARYSOLAR , BARYEARTH , NUTATION , LIBRATION , N_Types }
| Types of known data. More...
enum | Files { DE200 , DE405 , N_Files , DEFAULT }
| Types of files. More...
enum | Codes { CAU , GMS , AU , RADS , N_Codes }
| Codes for special constants. More...

## Static Public Member Functions

static Bool | get (Vector< Double > &returnValue, MeasJPL::Files file, MeasJPL::Types type, const MVEpoch &date)
| Get the values from a DE table, interpolated for date(in MJD(TDB)).
static Bool | getConst (Double &res, MeasJPL::Files which, MeasJPL::Codes what)
| Get indicated special constant.
static Bool | getConst (Double &res, MeasJPL::Files which, const String &nam)
| Get filed constant with name nam.
static void | closeMeas ()
| Close the set of JPL tables only.

## Private Member Functions

| MeasJPL ()
| Default constructor, NOT defined.
MeasJPL & | operator= (const MeasJPL &other)
| Copy assign, NOT defined.

## Static Private Member Functions

static Bool | initMeasOnce (MeasJPL::Files which)
| Destructor, NOT defined and not declared to stop warning ~MeasJPL();.
static void | doInitMeas (MeasJPL::Files which)
static const Double * | fillMeas (Double &intv, MeasJPL::Files which, const MVEpoch &utf)
| Get a pointer to the data for the given date.
static void | interMeas (Double res[], MeasJPL::Files which, Double intv, Double ivf, Int ncf, Int ncm, Int na, const Double buf[])
| Interpolate Chebyshev polymomial to res.

## Static Private Attributes

static std::once_flag | theirCallOnceFlags [N_Files]
| Object to ensure safe multi-threaded lazy single initialization.
static std::mutex | theirMutex
| Mutex for thread-safety (other than initialization).
static Table | t [N_Files]
| Tables present.
static ArrayColumn< Double > | acc [N_Files]
| Data column descriptor.
static Int | mjd0 [N_Files]
| First (-1) MJD in list.
static Int | mjdl [N_Files]
| Last MJD in list.
static Int | dmjd [N_Files]
| Interval in days (i.e., date step between subsequent rows).
static const String | tp [N_Files]
| File names.
static Int | idx [N_Files][3][13]
| Index in record.
static vector< Int > | curDate [N_Files]
| Dates of the data read in buffer.
static vector< Vector< Double > > | dval [N_Files]
| Data read in.
static Double | aufac [N_Files]
| Some helper data read from the table keywords.
static Double | emrat [N_Files]
static Double | cn [N_Files][N_Codes]

## Detailed Description

Interface to JPL DE tables

### Intended use:

Internal

### Review Status

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

### Prerequisite

- MeasTable

### Etymology

From Measure and JPL

### Synopsis

MeasJPL is the interface class to the JPL DE planetary data. It has only static memebers.
Tables are found using the aipsrc (using measures package (libcasa_measures).<table>.directory) mechanism. If not provided they are assumed to reside in standard places (i.e. in $AIPSROOT/data/ephemerides) 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 the JPL planetary tables (i.e. the DE200 and the DE405 tables). The data obtained will be the barycentric position (AU) and velocity (AU/d) of planets; the nutation (rad, rad/d) or the libration (rad, rad/d; DE405 only). All in the J2000 system.
The JPL DE Tables have a large set of constants attach to it. Some will be available by their own special code, the others their filed name. (See the get functions.
The enumeration code gives the available data and planets. See E.M. Standish et al., JPL IOM 314.10 - 127 for further details.
Note that the normal usage of these tables is through the Measures system.

Note: A message is Logged (once) if a 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

#include <casacore/casa/aips.h>
#include <casacore/casa/Quanta/MVEpoch.h>
#include <casacore/measures/Measures/MeasJPL.h>
#include <casacore/casa/Arrays/Vector.h>
const MVEpoch dat = 51116; // a date (1998/10/30) in TDB
Vector<Double> val(6), valE(6); // results
// Get position and velocity of Venus (barycentric)
if (!MeasJPL::get(val, MeasJPL::DE200, MeasJPL::VENUS, dat)) {
cout << "Some error getting Venus position" << endl;
// Get Earth position and velocity (barycentric)
} else if (!MeasJPL::get(valE, MeasJPL::DE200, MeasJPL::VENUS, dat)) {
cout << "Some error getting Earth position" << endl;
} else {
cout << "Venus (geocentric): " << (val-valE) << endl;
};
casacore::MVEpoch
Definition MVEpoch.h:87
casacore::MeasJPL::VENUS
@ VENUS
Definition MeasJPL.h:135
casacore::MeasJPL::DE200
@ DE200
DE200.
Definition MeasJPL.h:159
casacore::MeasJPL::get
static Bool get(Vector< Double > &returnValue, MeasJPL::Files file, MeasJPL::Types type, const MVEpoch &date)
Get the values from a DE table, interpolated for date(in MJD(TDB)).
casacore::Vector
Definition Vector.h:82

### Motivation

To use the JPL data for planetary positions and high precision nutation

Definition at line 119 of file MeasJPL.h.

## Member Enumeration Documentation

## Codes

enum casacore::MeasJPL::Codes

Codes for special constants.

Enumerator
CAU | Light velocity used in AU/d.
GMS | Solar mass (GM0)/c2 in AU.
AU | AU in km.
RADS | Solar radius in AU.

N_Codes

# of codes

Definition at line 168 of file MeasJPL.h.

## Files

enum casacore::MeasJPL::Files

Types of files.

Enumerator
DE200 | DE200.
DE405 | DE405.

N_Files

# of known types

DEFAULT | Default.

Definition at line 157 of file MeasJPL.h.

## Types

enum casacore::MeasJPL::Types

Types of known data.

Enumerator
MJD | MJD (must be first in list).
X | Column with data.
N_Columns | Number of columns.
MERCURY | Planets.
VENUS |
EARTH |
MARS |
JUPITER |
SATURN |
URANUS |
NEPTUNE |
PLUTO |
MOON |
SUN |
BARYSOLAR | Solar system barycentre.
BARYEARTH | Earth-Moon system barycentre.
NUTATION | Nutations.
LIBRATION | Librations.
N_Types | Number of types.

Definition at line 126 of file MeasJPL.h.

## Constructor & Destructor Documentation

## MeasJPL()

casacore::MeasJPL::MeasJPL | ( |  | ) |

private

Default constructor, NOT defined.

Referenced by operator=().

## Member Function Documentation

## closeMeas()

void casacore::MeasJPL::closeMeas | ( |  | ) |

static

Close the set of JPL tables only.

Only call it last at end of program.

## doInitMeas()

void casacore::MeasJPL::doInitMeas | ( | MeasJPL::Files | which | ) |

static private

## fillMeas()

const Double * casacore::MeasJPL::fillMeas | ( | Double & | intv,
|  | MeasJPL::Files | which,
|  | const MVEpoch & | utf )

static private

Get a pointer to the data for the given date.

It reads the data if needed.

## get()

Bool casacore::MeasJPL::get | ( | Vector< Double > & | returnValue,
|  | MeasJPL::Files | file,
|  | MeasJPL::Types | type,
|  | const MVEpoch & | date )

static

Get the values from a DE table, interpolated for date(in MJD(TDB)).

The file can be DE200 or DE405, the type as given in enum.

References casacore::date().

## getConst() [1/2]

Bool casacore::MeasJPL::getConst | ( | Double & | res,
|  | MeasJPL::Files | which,
|  | const String & | nam )

static

Get filed constant with name nam.

## getConst() [2/2]

Bool casacore::MeasJPL::getConst | ( | Double & | res,
|  | MeasJPL::Files | which,
|  | MeasJPL::Codes | what )

static

Get indicated special constant.

## initMeasOnce()

Bool casacore::MeasJPL::initMeasOnce | ( | MeasJPL::Files | which | ) |

static private

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

Initialise tables

## interMeas()

void casacore::MeasJPL::interMeas | ( | Double | res[],
|  | MeasJPL::Files | which,
|  | Double | intv,
|  | Double | ivf,
|  | Int | ncf,
|  | Int | ncm,
|  | Int | na,
|  | const Double | buf[] )

static private

Interpolate Chebyshev polymomial to res.

## operator=()

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

private

Copy assign, NOT defined.

References MeasJPL().

## Member Data Documentation

## acc

ArrayColumn<Double> casacore::MeasJPL::acc[N_Files]

static private

Data column descriptor.

Definition at line 231 of file MeasJPL.h.

## aufac

Double casacore::MeasJPL::aufac[N_Files]

static private

Some helper data read from the table keywords.

Definition at line 248 of file MeasJPL.h.

## cn

Double casacore::MeasJPL::cn[N_Files][N_Codes]

static private

Definition at line 250 of file MeasJPL.h.

## curDate

vector<Int> casacore::MeasJPL::curDate[N_Files]

static private

Dates of the data read in buffer.

Definition at line 243 of file MeasJPL.h.

## dmjd

Int casacore::MeasJPL::dmjd[N_Files]

static private

Interval in days (i.e., date step between subsequent rows).

Definition at line 237 of file MeasJPL.h.

## dval

vector<Vector<Double> > casacore::MeasJPL::dval[N_Files]

static private

Data read in.

Definition at line 245 of file MeasJPL.h.

## emrat

Double casacore::MeasJPL::emrat[N_Files]

static private

Definition at line 249 of file MeasJPL.h.

## idx

Int casacore::MeasJPL::idx[N_Files][3][13]

static private

Index in record.

Definition at line 241 of file MeasJPL.h.

## mjd0

Int casacore::MeasJPL::mjd0[N_Files]

static private

First (-1) MJD in list.

Definition at line 233 of file MeasJPL.h.

## mjdl

Int casacore::MeasJPL::mjdl[N_Files]

static private

Last MJD in list.

Definition at line 235 of file MeasJPL.h.

## t

Table casacore::MeasJPL::t[N_Files]

static private

Tables present.

Definition at line 229 of file MeasJPL.h.

## theirCallOnceFlags

std::once_flag casacore::MeasJPL::theirCallOnceFlags[N_Files]

static private

Object to ensure safe multi-threaded lazy single initialization.

Definition at line 225 of file MeasJPL.h.

## theirMutex

std::mutex casacore::MeasJPL::theirMutex

static private

Mutex for thread-safety (other than initialization).

Definition at line 227 of file MeasJPL.h.

## tp

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

static private

File names.

Definition at line 239 of file MeasJPL.h.

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

- measures/Measures/MeasJPL.h