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

More...

`#include <SolarPos.h>`

## Public Types

enum | SolarPosTypes { STANDARD , NONE }
| Types of known SolarPos calculations (at 1995/09/04 STANDARD == IAU1980). More...

## Public Member Functions

| SolarPos ()
| Default constructor, generates default J2000 SolarPos identification.
| SolarPos (const SolarPos &other)
| Copy constructor.
| SolarPos (SolarPosTypes type)
| Constructor with type.
SolarPos & | operator= (const SolarPos &other)
| Copy assignment.
| ~SolarPos ()
const MVPosition & | operator() (Double epoch)
| Operator () calculates the geocentric Solar Position in AU.
const MVPosition & | derivative (Double epoch)
| Return derivatives of SolarPos (d-1).
const MVPosition & | baryEarthDerivative (Double epoch)
const MVPosition & | barySunDerivative (Double epoch)
const MVPosition & | baryEarth (Double epoch)
| Barycentric position of Earth.
const MVPosition & | barySun (Double epoch)
| Barycentric position of Sun.
void | init ()
| Re-initialise SolarPos object.
void | init (SolarPosTypes type)
void | refresh ()
| Refresh calculations.

## Static Public Attributes

static constexpr Double | INTV
| Interval to be used for linear approximation (in days).

## Private Member Functions

void | copy (const SolarPos &other)
void | calcEarth (Double t)
| Calculate heliocentric Earth position for time t.
void | calcSun (Double t)
| Calculate heliocentric barycentre position.

## Static Private Member Functions

static void | initialize_statics ()

## Private Attributes

SolarPosTypes | method
| Method to be used.
Double | checkEpoch
| Check epoch for linear approximation.
Double | checkSunEpoch
Double | eval [3]
| Cached calculated Earth positions.
Double | deval [3]
| Cached derivatives.
Double | sval [3]
| Cached calculated Sun positions.
Double | dsval [3]
| Cached derivatives.
Int | lres
| To be able to use references in simple calculations, results are calculated in a circular buffer.
MVPosition | result [6]
| Last calculation.

## Static Private Attributes

static uInt | interval_reg
| Interpolation interval.
static uInt | usejpl_reg
| JPL use.
static std::once_flag | initialize_once_flag

## Detailed Description

Solar position class and calculations

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- Measure class, especially MEpoch
- MeasData class for constants

### Etymology

SolarPos from Solar Position

### Synopsis

SolarPos forms the class for Solar Position calculations. It is a simple container with the selected method, and the mean epoch.
The method is selected from one of the following:

- SolarPos::STANDARD (at 1995/09/04 the IAU1980 definition)
- SolarPos::NONE

Epochs can be specified as the MJD (with defined constants MeasData::MJD2000 and MeasData::MJDB1950 or the actual MJD), leading to the following constructors:

- SolarPos() default; assuming JD2000, IAU1980
- SolarPos(method) assuming the correct default epoch of JD2000
- SolarPos(method,epoch) with epoch Double(MJD)

Actual SolarPos for a certain Epoch is calculated by the () operator as SolarPos(epoch), with epoch Double MJD, as an MVPosition vector.
It returns the geocentric position of the heliocentre in rectangular coordinates in AU.
The derivative (d-1) can be obtained as well by derivative(epoch), baryEarthDerivative() and barySunDerivative().
The Earth's and solar barycentric position can be obtained by the members baryEarth and barySun. The following details can be set with the Aipsrc mechanism:

- measures.solarpos.d_interval: approximation interval as time (fraction of days is default unit) over which linear approximation is used
- measures.solarpos.b_usejpl: use the JPL database for solar position. Else analytical expression, relative error about 10-9 Note that the JPL database to be used can be set with measures.jpl.ephemeris (at the moment of writing DE200 (default), or DE405)

Reference: M. Soma et al., Cel. Mech. 41 (1988), 389; E.M. Standish, Astron. Astroph. 114 (1982), 297.

### Example

### Motivation

To calculate the solar/Earth positions for gravitational deflection. An alternate route could have been a global function, but having a simple container allows caching of some calculations for speed.
Using MJD (JD-2400000.5) rather than JD is for precision reasons.

Definition at line 110 of file SolarPos.h.

## Member Enumeration Documentation

## SolarPosTypes

enum casacore::SolarPos::SolarPosTypes

Types of known SolarPos calculations (at 1995/09/04 STANDARD == IAU1980).

Enumerator
STANDARD |
NONE |

Definition at line 118 of file SolarPos.h.

## Constructor & Destructor Documentation

## SolarPos() [1/3]

casacore::SolarPos::SolarPos | ( |  | ) |

Default constructor, generates default J2000 SolarPos identification.

Referenced by copy(), operator=(), and SolarPos().

## SolarPos() [2/3]

casacore::SolarPos::SolarPos | ( | const SolarPos & | other | ) |

Copy constructor.

References SolarPos().

## SolarPos() [3/3]

casacore::SolarPos::SolarPos | ( | SolarPosTypes | type | ) |

Constructor with type.

## ~SolarPos()

casacore::SolarPos::~SolarPos | ( |  | ) |

## Member Function Documentation

## baryEarth()

const MVPosition & casacore::SolarPos::baryEarth | ( | Double | epoch | ) |

Barycentric position of Earth.

## baryEarthDerivative()

const MVPosition & casacore::SolarPos::baryEarthDerivative | ( | Double | epoch | ) |

## barySun()

const MVPosition & casacore::SolarPos::barySun | ( | Double | epoch | ) |

Barycentric position of Sun.

## barySunDerivative()

const MVPosition & casacore::SolarPos::barySunDerivative | ( | Double | epoch | ) |

## calcEarth()

void casacore::SolarPos::calcEarth | ( | Double | t | ) |

private

Calculate heliocentric Earth position for time t.

## calcSun()

void casacore::SolarPos::calcSun | ( | Double | t | ) |

private

Calculate heliocentric barycentre position.

## copy()

void casacore::SolarPos::copy | ( | const SolarPos & | other | ) |

private

References SolarPos().

## derivative()

const MVPosition & casacore::SolarPos::derivative | ( | Double | epoch | ) |

Return derivatives of SolarPos (d-1).

## init() [1/2]

void casacore::SolarPos::init | ( |  | ) |

Re-initialise SolarPos object.

## init() [2/2]

void casacore::SolarPos::init | ( | SolarPosTypes | type | ) |

## initialize_statics()

void casacore::SolarPos::initialize_statics | ( |  | ) |

static private

## operator()()

const MVPosition & casacore::SolarPos::operator() | ( | Double | epoch | ) |

Operator () calculates the geocentric Solar Position in AU.

## operator=()

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

Copy assignment.

References SolarPos().

## refresh()

void casacore::SolarPos::refresh | ( |  | ) |

Refresh calculations.

## Member Data Documentation

## checkEpoch

Double casacore::SolarPos::checkEpoch

private

Check epoch for linear approximation.

Definition at line 163 of file SolarPos.h.

## checkSunEpoch

Double casacore::SolarPos::checkSunEpoch

private

Definition at line 164 of file SolarPos.h.

## deval

Double casacore::SolarPos::deval[3]

private

Cached derivatives.

Definition at line 168 of file SolarPos.h.

## dsval

Double casacore::SolarPos::dsval[3]

private

Cached derivatives.

Definition at line 172 of file SolarPos.h.

## eval

Double casacore::SolarPos::eval[3]

private

Cached calculated Earth positions.

Definition at line 166 of file SolarPos.h.

## initialize_once_flag

std::once_flag casacore::SolarPos::initialize_once_flag

inline static private

Definition at line 183 of file SolarPos.h.

## interval_reg

uInt casacore::SolarPos::interval_reg

inline static private

Interpolation interval.

Definition at line 180 of file SolarPos.h.

## INTV

Double casacore::SolarPos::INTV

static constexpr

Interval to be used for linear approximation (in days).

Definition at line 114 of file SolarPos.h.

## lres

Int casacore::SolarPos::lres

private

To be able to use references in simple calculations, results are calculated in a circular buffer.

Current buffer pointer

Definition at line 176 of file SolarPos.h.

## method

SolarPosTypes casacore::SolarPos::method

private

Method to be used.

Definition at line 161 of file SolarPos.h.

## result

MVPosition casacore::SolarPos::result[6]

private

Last calculation.

Definition at line 178 of file SolarPos.h.

## sval

Double casacore::SolarPos::sval[3]

private

Cached calculated Sun positions.

Definition at line 170 of file SolarPos.h.

## usejpl_reg

uInt casacore::SolarPos::usejpl_reg

inline static private

JPL use.

Definition at line 182 of file SolarPos.h.

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

- measures/Measures/SolarPos.h