EarthMagneticMachine.h

Classes

EarthMagneticMachine -- Calculates magnetic field in a direction (full description)

class EarthMagneticMachine

Interface

Public Members
EarthMagneticMachine()
EarthMagneticMachine(const MDirection::Ref &in, const Quantum<Double> &hgt, Quantum &frame)
EarthMagneticMachine(const MDirection::Ref &in, const Quantum<Double> &hgt, const Quantum &pos, const MPosition &tm)
EarthMagneticMachine(const MDirection::Ref &in, const MVDirection &dir, MVDirection &frame)
EarthMagneticMachine(const MDirection::Ref &in, const MVDirection &dir, const MVDirection &pos, const MPosition &tm)
EarthMagneticMachine(const EarthMagneticMachine &other)
EarthMagneticMachine &operator=(const EarthMagneticMachine &other)
~EarthMagneticMachine()
Double operator()()
Quantum<Double> operator()(const Unit &un)
Double operator()(const MVDirection &in)
Quantum<Double> operator()(const MVDirection &in, const Unit &un)
Double operator()(const Quantum<Double> &in)
Quantum<Double> operator()(const Quantum<Double> &in, const Unit &un)
Double operator()(const Double in)
Quantum<Double> operator()(const Double in, const Unit &un)
void set(const MDirection::Ref &in)
void set(const Quantum<Double> &hgt)
void set(MeasFrame &frame)
void set(const MPosition &pos)
void set(const MEpoch &tm)
void set(const MVDirection &dir)
Bool calculate(const MVDirection &in)
Bool calculate(const Quantum<Double> &hgt)
Bool calculate(const Double hgt)
Double getLOSField()
Double getLOSField(const MVDirection &in)
Double getLOSField(const Quantum<Double> &in)
Double getLOSField(const Double in)
Quantum<Double> getLOSField(const Unit &un)
Quantum<Double> getLOSField(const MVDirection &in, const Unit &un)
Quantum<Double> getLOSField(const Quantum<Double> &in, const Unit &un)
Quantum<Double> getLOSField(const Double in, const Unit &un)
const MVEarthMagnetic &getField()
const MVEarthMagnetic &getField(const MVDirection &in)
Double getLong()
Double getLong(const MVDirection &in)
Quantum<Double> getLong(const Unit &un)
Quantum<Double> getLong(const MVDirection &in, const Unit &un)
const MVPosition &getPosition()
const MVPosition &getPosition(const MVDirection &in)
void reCalculate()
Private Members
void init()
void copy(const EarthMagneticMachine &other)
void calculate()

Description

Review Status

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

Prerequisite

Etymology

From Earth' magnetic Field and machinery

Synopsis

The construction of an EarthMagneticMachine class object creates a machine that can calculate the magnetic field in an arbitrary direction.

The constructors need a reference code (and possibly frame) input MDirection::Ref to specify how the the input coordinates have to be interpreted (e.g. MDirection::HADEC). It also needs an altitude above the Earth for which the field has to be calculated. The position on Earth can be given as either a position, or as a frame containing the position. In the latter case the frame will also be used in the coordinate transformations.

Once the EarthMagneticMachine has been established, it can be used to calculate the field by the calculate(MVDirection) method. A variety of get methods let you obtain e.g. the field along the line of sight, the longitude of the point for which the field was calculated (e.g. the sub-ionospheric point).

Example

	// Define a time/position frame
	MEpoch epo(MVEpoch(MVTime(98,5,16,0.5).day()));
	MPosition pos;
	MeasTable::Observatory(pos, "ATCA");
	MeasFrame frame(epo, pos);
	// Note that e.g. the time in the frame can be changed later
	// Set up a machine
	EarthMagneticMachine exec(MDirection::B1950, Quantity(200, "km"), frame);
	// Given a current observational direction
	MDirection indir(Quantity(3.25745692, "rad"),
		   	 Quantity(0.040643336,"rad"),
		   	 MDirection::Ref(MDirection::B1950));
	// The field in this direction is calculated
	exec.calculate(indir.getValue());
	// Show some data
	cout << "Parallel field: " << exec.getLOSField() << " nT" << endl;
	cout << "Sub-ionosphere long: " << exec.getLong("deg") << endl;

Motivation

To aid calculating fields in a simple way.

To Do

Member Description

EarthMagneticMachine()

Construct an empty machine (probably not usable unles set() used)

EarthMagneticMachine(const MDirection::Ref &in, const Quantum<Double> &hgt, Quantum &frame)
EarthMagneticMachine(const MDirection::Ref &in, const Quantum<Double> &hgt, const Quantum &pos, const MPosition &tm)
EarthMagneticMachine(const MDirection::Ref &in, const MVDirection &dir, MVDirection &frame)
EarthMagneticMachine(const MDirection::Ref &in, const MVDirection &dir, const MVDirection &pos, const MPosition &tm)

Construct a machine from the input values. Either a height or direction is normally specified. The other can be set(), or can be iterated over in the () operator or the getLOSfield().

Thrown Exceptions

EarthMagneticMachine(const EarthMagneticMachine &other)

Copy constructor

EarthMagneticMachine &operator=(const EarthMagneticMachine &other)

Copy assignments

~EarthMagneticMachine()

Double operator()()
Quantum<Double> operator()(const Unit &un)
Double operator()(const MVDirection &in)
Quantum<Double> operator()(const MVDirection &in, const Unit &un)
Double operator()(const Quantum<Double> &in)
Quantum<Double> operator()(const Quantum<Double> &in, const Unit &un)
Double operator()(const Double in)
Quantum<Double> operator()(const Double in, const Unit &un)

Return line-of-sight field (nT or given units) (from previous calculate if no direction or height given)

void set(const MDirection::Ref &in)
void set(const Quantum<Double> &hgt)
void set(MeasFrame &frame)
void set(const MPosition &pos)
void set(const MEpoch &tm)
void set(const MVDirection &dir)

Set or reset part of the machine

Bool calculate(const MVDirection &in)
Bool calculate(const Quantum<Double> &hgt)
Bool calculate(const Double hgt)

Return data

Calculate a value from direction or height (in m if not Quantity)

Double getLOSField()
Double getLOSField(const MVDirection &in)
Double getLOSField(const Quantum<Double> &in)
Double getLOSField(const Double in)

Return data

Line-of-sight field in nT

Quantum<Double> getLOSField(const Unit &un)
Quantum<Double> getLOSField(const MVDirection &in, const Unit &un)
Quantum<Double> getLOSField(const Quantum<Double> &in, const Unit &un)
Quantum<Double> getLOSField(const Double in, const Unit &un)

Return data

Line-of-sight field in specified units (e.g. G)

const MVEarthMagnetic &getField()
const MVEarthMagnetic &getField(const MVDirection &in)

Return data

Field (in nT, in ITRF)

Double getLong()
Double getLong(const MVDirection &in)

Return data

Longitude (rad)

Quantum<Double> getLong(const Unit &un)
Quantum<Double> getLong(const MVDirection &in, const Unit &un)

Return data

Longitude in units (e.g. deg)

const MVPosition &getPosition()
const MVPosition &getPosition(const MVDirection &in)

Return data

void reCalculate()

Recalculate the machinery

void init()

Initialise machinery

void copy(const EarthMagneticMachine &other)

Copy data members

void calculate()

Calculate field