casacore
Loading...
Searching...
No Matches

More...

#include <EarthField.h>

Public Types

enum  EarthFieldTypes {
  IGRF ,
  NONE ,
  STANDARD
}
 Known EarthField calculation models. More...

Public Member Functions

 EarthField ()
 Default constructor, generates default J2000 EarthField identification.
 EarthField (const EarthField &other)
 Copy constructor.
 EarthField (EarthFieldTypes model, Double catepoch=51544.5)
 Constructor with epoch in MJulian days (default is J2000).
EarthFieldoperator= (const EarthField &other)
 Copy assignment.
 ~EarthField ()
const Vector< Double > & operator() (const MVPosition &pos)
 Return the EarthField components.
const Vector< Double > * derivative (const MVPosition &pos)
 Return derivatives of field (to X, Y, Z).
void init ()
 Re-initialise EarthField object with specified model and epoch, or defaults STANDARD and J2000.
void init (EarthFieldTypes model, Double catepoch=51544.5)
void refresh ()
 Refresh calculations.

Static Public Attributes

static constexpr Double INTV
 Default interval to be used for linear approximation (in m).

Private Member Functions

void copy (const EarthField &other)
 Make a copy.
void fillField ()
 Create correct default fixedEpoch and catalogue field data.
void calcField (const MVPosition &pos)
 Calculate EarthField for longitude and latitude and altitude (m).

Static Private Member Functions

static void initializeRcValue ()

Private Attributes

EarthFieldTypes method_p
 Method to be used.
Double fixedEpoch_p
 Fixed epoch to be used (MJD).
Vector< Doubleagh_p
 List of spherical components.
Vector< Doublep_p
 Work arrays for calculations.
Vector< Doubleq_p
Vector< Doublecl_p
Vector< Doublesl_p
MVPosition checkPos_p
 Check position.
Double pval_p [3]
 Cached calculated field components.
Double dval_p [3][3]
 Cached derivatives.
Int lres_p
 To reference results, and use a few in interim calculations, results are calculated in a circular buffer.
Vector< Doubleresult_p [4]
 Last calculation.

Static Private Attributes

static uInt interval_reg_p
 Interpolation interval.
static std::once_flag initialization_once_flag

Detailed Description

EarthField class model calculations

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

Earth magnetic Field model

Synopsis

EarthField forms the class for Earth magnetic field calculations. It is a simple container with the selected model, and the mean epoch.
The method is selected from one of the following:

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

  • EarthField() default; assuming IGRF and MJD2000
  • EarthField(method); assuming J2000 as epoch
  • EarthField(method, epoch) with epoch Double(MJD)

Actual EarthField for a certain position on Earth is calculated by the () operator. Arguments can be:

  • MVPosition: a position on Earth (in the ITRF frame)

The returned value is a 3D vector of the field (in nT) in ITRF coordinates. The derivative (d-1) can be obtained as well by derivative(MVPosition).
An EarthField can be re-initialised with a different method and/or other epoch with the init() functions (same format as constructors).

To bypass the full, lengthy calculation actual returned values are calculated using the derivative if within about 50 km (error less than about 10-2 G). A call to refresh() will re-initiate calculations from scratch.
The following details can be set with the Aipsrc mechanism:

  • measures.earthfield.d_interval: approximation radius (km is default unit) over which a linear approximation is used

The field model is assumed to be constant over the time-span the class is used.

The calculations are based on a routine provided by the IGRF community. See ftp.ngdc.noaa.gov/Solid_Earth/Mainfld_Mag/Models/IAGA, routine IGRFLIB.FOR. The values are in nT (10uG).

Example

45837.0); // define EarthField type
// for 84/05/17
MeasTable::Observatory(pos, "WSRT"); // Obervatory position
// Make sure correct position frame used
MVEarthMagnetic now = mine(x); // get EarthField
EarthField()
Default constructor, generates default J2000 EarthField identification.
@ STANDARD
Standard default model if none specified.
Definition EarthField.h:144
MeasConvert< MPosition > Convert
Measure Convert (i.e.
Definition MPosition.h:105
static Bool Observatory(MPosition &obs, const String &nam)
Get position of observatory nam (False if not present).

Motivation

To have a container (with history) for field calculations

To Do

  • nothing I know off

Definition at line 128 of file EarthField.h.

Member Enumeration Documentation

◆ EarthFieldTypes

Known EarthField calculation models.

Enumerator
IGRF 

Standard IGRF model.

NONE 

Make the field equal to zero.

STANDARD 

Standard default model if none specified.

Definition at line 138 of file EarthField.h.

Constructor & Destructor Documentation

◆ EarthField() [1/3]

casacore::EarthField::EarthField ( )

Default constructor, generates default J2000 EarthField identification.

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

◆ EarthField() [2/3]

casacore::EarthField::EarthField ( const EarthField & other)

Copy constructor.

References EarthField().

◆ EarthField() [3/3]

casacore::EarthField::EarthField ( EarthFieldTypes model,
Double catepoch = 51544.5 )
explicit

Constructor with epoch in MJulian days (default is J2000).

◆ ~EarthField()

casacore::EarthField::~EarthField ( )

Member Function Documentation

◆ calcField()

void casacore::EarthField::calcField ( const MVPosition & pos)
private

Calculate EarthField for longitude and latitude and altitude (m).

◆ copy()

void casacore::EarthField::copy ( const EarthField & other)
private

Make a copy.

References EarthField().

◆ derivative()

const Vector< Double > * casacore::EarthField::derivative ( const MVPosition & pos)

Return derivatives of field (to X, Y, Z).

Note that the value returned has only a lifetime as long as the EarthField container exists, and no new components or derivative is calculated. The returned value should not be deleted.

◆ fillField()

void casacore::EarthField::fillField ( )
private

Create correct default fixedEpoch and catalogue field data.

◆ init() [1/2]

void casacore::EarthField::init ( )

Re-initialise EarthField object with specified model and epoch, or defaults STANDARD and J2000.

◆ init() [2/2]

void casacore::EarthField::init ( EarthFieldTypes model,
Double catepoch = 51544.5 )

◆ initializeRcValue()

void casacore::EarthField::initializeRcValue ( )
staticprivate

◆ operator()()

const Vector< Double > & casacore::EarthField::operator() ( const MVPosition & pos)

Return the EarthField components.

Note that the value returned has only a lifetime as long as the EarthField container exists, and no new derivative is asked for.

◆ operator=()

EarthField & casacore::EarthField::operator= ( const EarthField & other)

Copy assignment.

References EarthField().

◆ refresh()

void casacore::EarthField::refresh ( )

Refresh calculations.

Member Data Documentation

◆ agh_p

Vector<Double> casacore::EarthField::agh_p
private

List of spherical components.

Definition at line 188 of file EarthField.h.

◆ checkPos_p

MVPosition casacore::EarthField::checkPos_p
private

Check position.

Definition at line 197 of file EarthField.h.

◆ cl_p

Vector<Double> casacore::EarthField::cl_p
private

Definition at line 193 of file EarthField.h.

◆ dval_p

Double casacore::EarthField::dval_p[3][3]
private

Cached derivatives.

Definition at line 201 of file EarthField.h.

◆ fixedEpoch_p

Double casacore::EarthField::fixedEpoch_p
private

Fixed epoch to be used (MJD).

Definition at line 186 of file EarthField.h.

◆ initialization_once_flag

std::once_flag casacore::EarthField::initialization_once_flag
inlinestaticprivate

Definition at line 210 of file EarthField.h.

◆ interval_reg_p

uInt casacore::EarthField::interval_reg_p
inlinestaticprivate

Interpolation interval.

Definition at line 209 of file EarthField.h.

◆ INTV

Double casacore::EarthField::INTV
staticconstexpr

Default interval to be used for linear approximation (in m).

Definition at line 134 of file EarthField.h.

◆ lres_p

Int casacore::EarthField::lres_p
private

To reference results, and use a few in interim calculations, results are calculated in a circular buffer.

Current result pointer

Definition at line 205 of file EarthField.h.

◆ method_p

EarthFieldTypes casacore::EarthField::method_p
private

Method to be used.

Definition at line 184 of file EarthField.h.

◆ p_p

Vector<Double> casacore::EarthField::p_p
private

Work arrays for calculations.

Definition at line 191 of file EarthField.h.

◆ pval_p

Double casacore::EarthField::pval_p[3]
private

Cached calculated field components.

Definition at line 199 of file EarthField.h.

◆ q_p

Vector<Double> casacore::EarthField::q_p
private

Definition at line 192 of file EarthField.h.

◆ result_p

Vector<Double> casacore::EarthField::result_p[4]
private

Last calculation.

Definition at line 207 of file EarthField.h.

◆ sl_p

Vector<Double> casacore::EarthField::sl_p
private

Definition at line 194 of file EarthField.h.


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