MeasFrame.h

Classes

MeasFrame -- Container for Measure frame (full description)
Global Functions -- Global functions (full description)

class MeasFrame

Types

enum FrameTypes

EPOCH = 1
POSITION = 2
DIRECTION = 4
VELOCITY = 8
COMET = 16

enum GetTypes

GetTDB
Get TDB in days
GetUT1
Get UT1 in days
GetTT
Get TT in days
GetLong
Get the ITRF longitude (in rad)
GetLat
Get the ITRF latitude (in rad)
GetRadius
Get the geocentric position (in m)
GetLatGeo
Get the geodetic latitude
GetLAST
Get the LAST (in days)
GetLASTr
Get the LAST (in rad)
GetJ2000
Get J2000 coordinates (direction cosines)
GetJ2000Long
Get J2000 coordinates (longitude)
GetJ2000Lat
Get J2000 coordinates (latitude)
GetB1950
Get B1950 coordinates (direction cosines)
GetB1950Long
Get B1950 coordinates (longitude)
GetB1950Lat
Get B1950 coordinates (latitude)
GetApp
Get apparent coordinates (direction cosines)
GetAppLong
Get App coordinates (longitude)
GetAppLat
Get App coordinates (latitude)
GetLSR
Get LSR radial velocity (m/s)
GetITRF
Get the position
GetCometType
Get the comet type
GetComet
Get comet coordinates

Interface

Public Members
friend ostream &operator<<(ostream &os, MeasFrame &mf)
friend Bool MCFrameGetdbl(void *dmf, uInt tp, Double &result)
friend Bool MCFrameGetmvdir(void *dmf, uInt tp, MVDirection &result)
friend Bool MCFrameGetmvpos(void *dmf, uInt tp, MVPosition &result)
friend Bool MCFrameGetuint(void *dmf, uInt tp, uInt &result)
MeasFrame()
MeasFrame(const Measure &meas1)
MeasFrame(const Measure &meas1, const Measure &meas2)
MeasFrame(const Measure &meas1, const Measure &meas2, const Measure &meas3)
MeasFrame(const MeasFrame &other)
MeasFrame &operator=(const MeasFrame &other)
~MeasFrame()
Bool operator==(const MeasFrame &other) const
Bool operator!=(const MeasFrame &other) const
Bool empty() const
void set(const Measure &meas1)
void set(const Measure &meas1, const Measure &meas2)
void set(const Measure &meas1, const Measure &meas2, const Measure &meas3)
void set(const MeasComet &meas)
void resetEpoch(Double val)
void resetEpoch(const Vector<Double> &val)
void resetEpoch(const Quantum<Double> &val)
void resetEpoch(const Quantum<Vector<Double> > &val)
void resetEpoch(const MVEpoch &val)
void resetEpoch(const Measure &val)
void resetPosition(const Vector<Double> &val)
void resetPosition(const Quantum<Vector<Double> > &val)
void resetPosition(const MVPosition &val)
void resetPosition(const Measure &val)
void resetDirection(const Vector<Double> &val)
void resetDirection(const Quantum<Vector<Double> > &val)
void resetDirection(const MVDirection &val)
void resetDirection(const Measure &val)
void resetRadialVelocity(const Vector<Double> &val)
void resetRadialVelocity(const Quantum<Vector<Double> > &val)
void resetRadialVelocity(const MVRadialVelocity &val)
void resetRadialVelocity(const Measure &val)
void resetComet(const MeasComet &val)
const Measure *const epoch() const
const Measure *const position() const
const Measure *const direction() const
const Measure *const radialVelocity() const
const MeasComet *const comet() const
Bool getTDB(Double &tdb)
Bool getUT1(Double &tdb)
Bool getTT(Double &tdb)
Bool getLong(Double &tdb)
Bool getLat(Double &tdb)
Bool getITRF(MVPosition &tdb)
Bool getRadius(Double &tdb)
Bool getLatGeo(Double &tdb)
Bool getLAST(Double &tdb)
Bool getLASTr(Double &tdb)
Bool getJ2000(MVDirection &tdb)
Bool getJ2000Long(Double &tdb)
Bool getJ2000Lat(Double &tdb)
Bool getB1950(MVDirection &tdb)
Bool getB1950Long(Double &tdb)
Bool getB1950Lat(Double &tdb)
Bool getApp(MVDirection &tdb)
Bool getAppLong(Double &tdb)
Bool getAppLat(Double &tdb)
Bool getLSR(Double &tdb)
Bool getCometType(uInt &tdb)
Bool getComet(MVPosition &tdb)
void *getMCFramePoint() const
Private Members
void create()
void fill(const Measure *in)
void fill(const MeasComet *in)
void makeEpoch()
void makePosition()
void makeDirection()
void makeRadialVelocity()
void makeComet()
void errorReset(const String &txt)
Bool getEpset() const
Bool getDirset() const
Bool getPosset() const
Bool getRadset() const
Bool getComset() const
Bool getEpreset() const
Bool getDirreset() const
Bool getPosreset() const
Bool getRadreset() const
Bool getComreset() const
void setEpset(Bool in)
void setPosset(Bool in)
void setDirset(Bool in)
void setRadset(Bool in)
void setComset(Bool in)
void setEpreset(Bool in)
void setPosreset(Bool in)
void setDirreset(Bool in)
void setRadreset(Bool in)
void setComreset(Bool in)
void setMCFramePoint(void *in)
void setMCFrameDelete(void (*in)(void*))
void setMCFrameGetdbl(Bool (*in)(void *, uInt, Double &))
void setMCFrameGetmvdir(Bool (*in)(void *, uInt, MVDirection &))
void setMCFrameGetmvpos(Bool (*in)(void *, uInt, MVPosition &))
void setMCFrameGetuint(Bool (*in)(void *, uInt, uInt &))
void lock()
void unlock()

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Programs:
Tests:

Prerequisite

Etymology

From Measure and Frame

Synopsis

Measurements are made in a reference frame (epoch, position, direction, ...).
The class is a container for the reference frame Measures (MEpoch etc). Since a frame will possibly be used by many different Measures, it behaves as a smart pointer, with reference rather than copy characteristics. Since it caches all its operations, it is advisable to have a 'global' MeasFrame across an execution, resetting (or setting) its values when appropiate. The frame can also contain other related information. At the moment the orbit of a solar system body (MeasComet) can be set. In future the planetary ephemeris used (e.g. DE205) and environmental information like refraction data will be added.

A MeasFrame is constructed by setting the appropiate Measures, either in a constructor, or with a set(). The input to the constructors and set are Measures.

Inside the frames automatic conversion to the most appropiate usage of its values is done (e.g. time to TBD time, position to astronomical longitude). These conversions are done only if an explicit Measure::Convert was used that needed information, e.g. the following code:

	MeasFrame frame(obser);   // obser is an MPosition
	MEpoch::Convert conv(MEpoch(12345), MEpoch::Ref(MEpoch::LAST,obser));
	MEpoch last = conv();
will set-up a state machine to convert UTC(default) to LAST in conv; the next call will do the actual conversion. During this conversion, the astronomical longitude (among others) will be needed to convert to local sidereal time. conv will ask (getLong()) this from the frame, which will calculate it (including possible other conversions) from the observatory's position specified in a frame. Any calculation done will be cached (e.g. a Nutation calculation in this case for dpsi), and used in subsequent conversions using the same frame.
Furthermore, a frame will often be regularly updated (e.g. coordinate conversion for a series of times). To make use of cached information, and to speed up as much as possible, reset...() functions are available. These reset functions accept the same range of input parameter types as the MeasConvert () operator, and will keep any determined conversion machines and related information intact, only recalculating whatever is necessary.
The actual frame calculations and interrogations are done in a separate MCFrame hidden class, which attaches itself to MeasFrame when and if necessary (see there if you are really curious).
. get...() functions can return frame measures. Only when the frame has been attached to a calculating machine *MCFrame) are these values available. This attachment is done if the frame has been actively used by a Measure::Convert engine, or if explicitly done by the MCFrame::make(MeasFrame &) static method.
Caution An explicit (or implicit) call to MCFrame::make will load the whole conversion machinery (including Tables) into your linked module).

Aipsrc keywords can be used for additional (highly specialised) additional internal conversion parameters.

Example

	MEpoch my_epoch(Quantity(MeasData::MJDB1950,"d")); // an epoch
	MeasFrame frame(my_epoch);	// used in a frame

Motivation

To separate the frame definition from the measure type

To Do

Member Description

friend ostream &operator<<(ostream &os, MeasFrame &mf)

Output a frame

enum FrameTypes

Enumeration for the different farme entries possible. This can be used to find out if a certain conversion needs the frame. It will be used in a registration/notify environment to enable bypassing of some new conversion settings.

friend Bool MCFrameGetdbl(void *dmf, uInt tp, Double &result)
friend Bool MCFrameGetmvdir(void *dmf, uInt tp, MVDirection &result)
friend Bool MCFrameGetmvpos(void *dmf, uInt tp, MVPosition &result)
friend Bool MCFrameGetuint(void *dmf, uInt tp, uInt &result)

Machinery

MeasFrame()

Default constructor

MeasFrame(const Measure &meas1)

Construct frame with specified measures

Thrown Exceptions

MeasFrame(const Measure &meas1, const Measure &meas2)

MeasFrame(const Measure &meas1, const Measure &meas2, const Measure &meas3)

MeasFrame(const MeasFrame &other)

Copy constructor (reference semantics)

MeasFrame &operator=(const MeasFrame &other)

Copy assignment (reference semantics)

~MeasFrame()

Destructor

Bool operator==(const MeasFrame &other) const
Bool operator!=(const MeasFrame &other) const

Comparisons

Bool empty() const

Test if empty (i.e. no measure filled in)

void set(const Measure &meas1)
void set(const Measure &meas1, const Measure &meas2)
void set(const Measure &meas1, const Measure &meas2, const Measure &meas3)
void set(const MeasComet &meas)

Set frame elements

Thrown Exceptions

void resetEpoch(Double val)
void resetEpoch(const Vector<Double> &val)
void resetEpoch(const Quantum<Double> &val)
void resetEpoch(const Quantum<Vector<Double> > &val)
void resetEpoch(const MVEpoch &val)
void resetEpoch(const Measure &val)
void resetPosition(const Vector<Double> &val)
void resetPosition(const Quantum<Vector<Double> > &val)
void resetPosition(const MVPosition &val)
void resetPosition(const Measure &val)
void resetDirection(const Vector<Double> &val)
void resetDirection(const Quantum<Vector<Double> > &val)
void resetDirection(const MVDirection &val)
void resetDirection(const Measure &val)
void resetRadialVelocity(const Vector<Double> &val)
void resetRadialVelocity(const Quantum<Vector<Double> > &val)
void resetRadialVelocity(const MVRadialVelocity &val)
void resetRadialVelocity(const Measure &val)
void resetComet(const MeasComet &val)

Reset a frame element and its cached derived values.

Thrown Exceptions

const Measure *const epoch() const

Get the epoch pointer (0 if not present)

const Measure *const position() const

Get the position pointer (0 if not present)

const Measure *const direction() const

Get the direction pointer (0 if not present)

const Measure *const radialVelocity() const

Get the radial velocity pointer (0 if not present)

const MeasComet *const comet() const

Get the comet pointer (0 if not present)

Bool getTDB(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get TDB in days

Bool getUT1(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get UT1 in days

Bool getTT(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get TT in days

Bool getLong(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the ITRF longitude (in rad)

Bool getLat(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the ITRF latitude (in rad)

Bool getITRF(MVPosition &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the position

Bool getRadius(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the geocentric position (in m)

Bool getLatGeo(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the geodetic latitude

Bool getLAST(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the LAST (in days)

Bool getLASTr(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the LAST (in rad)

Bool getJ2000(MVDirection &tdb)
Bool getJ2000Long(Double &tdb)
Bool getJ2000Lat(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get J2000 coordinates (direction cosines) and its longitude/latitude (rad)

Bool getB1950(MVDirection &tdb)
Bool getB1950Long(Double &tdb)
Bool getB1950Lat(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get B1950 coordinates (direction cosines)

Bool getApp(MVDirection &tdb)
Bool getAppLong(Double &tdb)
Bool getAppLat(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get apparent coordinates (direction cosines)

Bool getCometType(uInt &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the comet table reference type

Bool getComet(MVPosition &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

Get the comet coordinates

Bool getLSR(Double &tdb)

Get data from frame. Only available if appropiate measures are set, and the frame is in a calculating state.

void *getMCFramePoint() const

Get the frame conversion data pointer (0 if none)

enum GetTypes

Types of known get data routines. The actual work is in MCFrame, using pointers to functions

void create()

Create an instance of the MeasFrame class

void fill(const Measure *in)
void fill(const MeasComet *in)

Fill a MeasFrame element

void makeEpoch()

Make full Epoch

void makePosition()

Make full Position

void makeDirection()

Make full Direction

void makeRadialVelocity()

Make full RadialVelocity

void makeComet()

Make full Comet

void errorReset(const String &txt)

Throw reset error

Bool getEpset() const
Bool getDirset() const
Bool getPosset() const
Bool getRadset() const
Bool getComset() const
Bool getEpreset() const
Bool getDirreset() const
Bool getPosreset() const
Bool getRadreset() const
Bool getComreset() const

Get the different set and reset indicators (for use in MCFrame)

void setEpset(Bool in)
void setPosset(Bool in)
void setDirset(Bool in)
void setRadset(Bool in)
void setComset(Bool in)
void setEpreset(Bool in)
void setPosreset(Bool in)
void setDirreset(Bool in)
void setRadreset(Bool in)
void setComreset(Bool in)

Set the different set/reset switches

void setMCFramePoint(void *in)

Set the frame conversion data pointer (by MCFrame)

void setMCFrameDelete(void (*in)(void*))

Set the frame conversion deletor

void setMCFrameGetdbl(Bool (*in)(void *, uInt, Double &))

Set the get double routine

void setMCFrameGetmvdir(Bool (*in)(void *, uInt, MVDirection &))

Set the get MVDirection routine

void setMCFrameGetmvpos(Bool (*in)(void *, uInt, MVPosition &))

Set the get MVPosition routine

void setMCFrameGetuint(Bool (*in)(void *, uInt, uInt &))

Set the get uint routine

void lock()

Lock the frame to make sure deletion occurs when needed

void unlock()

Unlock the frame

Global functions (source)

Interface

ostream &operator<<(ostream &os, MeasFrame &mf)

Description

Member Description

ostream &operator<<(ostream &os, MeasFrame &mf)

Output a frame