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

More...

`#include <EarthMagneticMachine.h>`

## Public Member Functions

| EarthMagneticMachine ()
| Construct an empty machine (probably not usable unles set() used).
| EarthMagneticMachine (const MDirection::Ref &in, const Quantum< Double > &hgt, MeasFrame &frame)
| Construct a machine from the input values.
| EarthMagneticMachine (const MDirection::Ref &in, const Quantum< Double > &hgt, const MPosition &pos, const MEpoch &tm)
| EarthMagneticMachine (const MDirection::Ref &in, const MVDirection &dir, MeasFrame &frame)
| EarthMagneticMachine (const MDirection::Ref &in, const MVDirection &dir, const MPosition &pos, const MEpoch &tm)
| EarthMagneticMachine (const EarthMagneticMachine &other)
| Copy constructor.
EarthMagneticMachine & | operator= (const EarthMagneticMachine &other)
| Copy assignments.
| ~EarthMagneticMachine ()
Double | operator() ()
| Return line-of-sight field (nT or given units) (from previous calculate if no direction or height given).
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)
| Set or reset part of the machine.
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)
| Calculate a value from direction or height (in m if not Quantity).
Bool | calculate (const Quantum< Double > &hgt)
Bool | calculate (const Double hgt)
Double | getLOSField ()
| Return data.
Double | getLOSField (const MVDirection &in)
Double | getLOSField (const Quantum< Double > &in)
Double | getLOSField (const Double in)
Quantum< Double > | getLOSField (const Unit &un)
| Line-of-sight field in specified units (e.g.
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 ()
| Field (in nT, in ITRF).
const MVEarthMagnetic & | getField (const MVDirection &in)
Double | getLong ()
| Longitude (rad).
Double | getLong (const MVDirection &in)
Quantum< Double > | getLong (const Unit &un)
| Longitude in units (e.g.
Quantum< Double > | getLong (const MVDirection &in, const Unit &un)
const MVPosition & | getPosition ()
| Position point.
const MVPosition & | getPosition (const MVDirection &in)
void | reCalculate ()
| Recalculate the machinery.

## Private Member Functions

void | init ()
| Initialise machinery.
void | copy (const EarthMagneticMachine &other)
| Copy data members.
void | calculate ()
| Calculate field.

## Private Attributes

MDirection::Ref | inref_p
| Input direction reference.
Double | hgt_p
| Height (m).
MVPosition | pos_p
| Observatory position.
Double | posl_p
| Distance to Earth centre.
Double | subl_p
| Distance squared to sub-point.
Double | epo_p
| Epoch.
MDirection::Convert | conv_p
| Conversion engine.
MVDirection | in_p
| Input position.
MVDirection | rin_p
| Re-typed input position.
Bool | fex_p
| Extension calculated.
Bool | pex_p
MVPosition | sub_p
| Position sub-point.
EarthField | fldc_p
| Earth field calculator.
MVEarthMagnetic | fld_p
| Magnetic field.
Double | los_p
| Line-of-sight field.
Vector< Double > | pl_p
| Field position.
Int | fil_p
| Fields filled.
Int | cumf_p
| Cumulative filled fields.
Bool | clx_p
| Calc done.

## Detailed Description

Calculates magnetic field in a direction

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- MEarthMagnetic class
- MDirection class

### 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;
casacore::EarthMagneticMachine::EarthMagneticMachine
EarthMagneticMachine()
Construct an empty machine (probably not usable unles set() used).
casacore::MDirection
Definition MDirection.h:171
casacore::MDirection::Ref
MeasRef< MDirection > Ref
Measure reference (i.e.
Definition MDirection.h:244
casacore::MDirection::B1950
@ B1950
Definition MDirection.h:190
casacore::MEpoch
Definition MEpoch.h:101
casacore::MPosition
Definition MPosition.h:76
casacore::MVEpoch
Definition MVEpoch.h:87
casacore::MVTime
Definition MVTime.h:268
casacore::MeasFrame
Definition MeasFrame.h:151
casacore::MeasTable::Observatory
static Bool Observatory(MPosition &obs, const String &nam)
Get position of observatory nam (False if not present).
casacore::day
TableExprNode day(const TableExprNode &node)
Definition ExprNode.h:1527
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39

### Motivation

To aid calculating fields in a simple way.

### To Do

- add more get() values if necessary

Definition at line 113 of file EarthMagneticMachine.h.

## Constructor & Destructor Documentation

## EarthMagneticMachine() [1/6]

casacore::EarthMagneticMachine::EarthMagneticMachine | ( |  | ) |

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

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

## EarthMagneticMachine() [2/6]

casacore::EarthMagneticMachine::EarthMagneticMachine | ( | const MDirection::Ref & | in,
|  | const Quantum< Double > & | hgt,
|  | MeasFrame & | frame )

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

- AipsError if frame does not contain position and time

## EarthMagneticMachine() [3/6]

casacore::EarthMagneticMachine::EarthMagneticMachine | ( | const MDirection::Ref & | in,
|  | const Quantum< Double > & | hgt,
|  | const MPosition & | pos,
|  | const MEpoch & | tm )

## EarthMagneticMachine() [4/6]

casacore::EarthMagneticMachine::EarthMagneticMachine | ( | const MDirection::Ref & | in,
|  | const MVDirection & | dir,
|  | MeasFrame & | frame )

## EarthMagneticMachine() [5/6]

casacore::EarthMagneticMachine::EarthMagneticMachine | ( | const MDirection::Ref & | in,
|  | const MVDirection & | dir,
|  | const MPosition & | pos,
|  | const MEpoch & | tm )

## EarthMagneticMachine() [6/6]

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

Copy constructor.

References EarthMagneticMachine().

## ~EarthMagneticMachine()

casacore::EarthMagneticMachine::~EarthMagneticMachine | ( |  | ) |

## Member Function Documentation

## calculate() [1/4]

void casacore::EarthMagneticMachine::calculate | ( |  | ) |

private

Calculate field.

## calculate() [2/4]

Bool casacore::EarthMagneticMachine::calculate | ( | const Double | hgt | ) |

## calculate() [3/4]

Bool casacore::EarthMagneticMachine::calculate | ( | const MVDirection & | in | ) |

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

## calculate() [4/4]

Bool casacore::EarthMagneticMachine::calculate | ( | const Quantum< Double > & | hgt | ) |

## copy()

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

private

Copy data members.

References EarthMagneticMachine().

## getField() [1/2]

const MVEarthMagnetic & casacore::EarthMagneticMachine::getField | ( |  | ) |

Field (in nT, in ITRF).

## getField() [2/2]

const MVEarthMagnetic & casacore::EarthMagneticMachine::getField | ( | const MVDirection & | in | ) |

## getLong() [1/4]

Double casacore::EarthMagneticMachine::getLong | ( |  | ) |

Longitude (rad).

## getLong() [2/4]

Double casacore::EarthMagneticMachine::getLong | ( | const MVDirection & | in | ) |

## getLong() [3/4]

Quantum< Double > casacore::EarthMagneticMachine::getLong | ( | const MVDirection & | in,
|  | const Unit & | un )

## getLong() [4/4]

Quantum< Double > casacore::EarthMagneticMachine::getLong | ( | const Unit & | un | ) |

Longitude in units (e.g.

deg)

## getLOSField() [1/8]

Double casacore::EarthMagneticMachine::getLOSField | ( |  | ) |

Return data.

Line-of-sight field in nT

## getLOSField() [2/8]

Double casacore::EarthMagneticMachine::getLOSField | ( | const Double | in | ) |

## getLOSField() [3/8]

Quantum< Double > casacore::EarthMagneticMachine::getLOSField | ( | const Double | in,
|  | const Unit & | un )

## getLOSField() [4/8]

Double casacore::EarthMagneticMachine::getLOSField | ( | const MVDirection & | in | ) |

## getLOSField() [5/8]

Quantum< Double > casacore::EarthMagneticMachine::getLOSField | ( | const MVDirection & | in,
|  | const Unit & | un )

## getLOSField() [6/8]

Double casacore::EarthMagneticMachine::getLOSField | ( | const Quantum< Double > & | in | ) |

## getLOSField() [7/8]

Quantum< Double > casacore::EarthMagneticMachine::getLOSField | ( | const Quantum< Double > & | in,
|  | const Unit & | un )

## getLOSField() [8/8]

Quantum< Double > casacore::EarthMagneticMachine::getLOSField | ( | const Unit & | un | ) |

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

G)

## getPosition() [1/2]

const MVPosition & casacore::EarthMagneticMachine::getPosition | ( |  | ) |

Position point.

## getPosition() [2/2]

const MVPosition & casacore::EarthMagneticMachine::getPosition | ( | const MVDirection & | in | ) |

## init()

void casacore::EarthMagneticMachine::init | ( |  | ) |

private

Initialise machinery.

## operator()() [1/8]

Double casacore::EarthMagneticMachine::operator() | ( |  | ) |

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

## operator()() [2/8]

Double casacore::EarthMagneticMachine::operator() | ( | const Double | in | ) |

## operator()() [3/8]

Quantum< Double > casacore::EarthMagneticMachine::operator() | ( | const Double | in,
|  | const Unit & | un )

## operator()() [4/8]

Double casacore::EarthMagneticMachine::operator() | ( | const MVDirection & | in | ) |

## operator()() [5/8]

Quantum< Double > casacore::EarthMagneticMachine::operator() | ( | const MVDirection & | in,
|  | const Unit & | un )

## operator()() [6/8]

Double casacore::EarthMagneticMachine::operator() | ( | const Quantum< Double > & | in | ) |

## operator()() [7/8]

Quantum< Double > casacore::EarthMagneticMachine::operator() | ( | const Quantum< Double > & | in,
|  | const Unit & | un )

## operator()() [8/8]

Quantum< Double > casacore::EarthMagneticMachine::operator() | ( | const Unit & | un | ) |

## operator=()

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

Copy assignments.

References EarthMagneticMachine().

## reCalculate()

void casacore::EarthMagneticMachine::reCalculate | ( |  | ) |

Recalculate the machinery.

## set() [1/6]

void casacore::EarthMagneticMachine::set | ( | const MDirection::Ref & | in | ) |

Set or reset part of the machine.

## set() [2/6]

void casacore::EarthMagneticMachine::set | ( | const MEpoch & | tm | ) |

## set() [3/6]

void casacore::EarthMagneticMachine::set | ( | const MPosition & | pos | ) |

## set() [4/6]

void casacore::EarthMagneticMachine::set | ( | const MVDirection & | dir | ) |

## set() [5/6]

void casacore::EarthMagneticMachine::set | ( | const Quantum< Double > & | hgt | ) |

## set() [6/6]

void casacore::EarthMagneticMachine::set | ( | MeasFrame & | frame | ) |

## Member Data Documentation

## clx_p

Bool casacore::EarthMagneticMachine::clx_p

private

Calc done.

Definition at line 253 of file EarthMagneticMachine.h.

## conv_p

MDirection::Convert casacore::EarthMagneticMachine::conv_p

private

Conversion engine.

Definition at line 228 of file EarthMagneticMachine.h.

## cumf_p

Int casacore::EarthMagneticMachine::cumf_p

private

Cumulative filled fields.

Definition at line 251 of file EarthMagneticMachine.h.

## epo_p

Double casacore::EarthMagneticMachine::epo_p

private

Epoch.

Definition at line 226 of file EarthMagneticMachine.h.

## fex_p

Bool casacore::EarthMagneticMachine::fex_p

private

Extension calculated.

Definition at line 235 of file EarthMagneticMachine.h.

## fil_p

Int casacore::EarthMagneticMachine::fil_p

private

Fields filled.

Definition at line 249 of file EarthMagneticMachine.h.

## fld_p

MVEarthMagnetic casacore::EarthMagneticMachine::fld_p

private

Magnetic field.

Definition at line 243 of file EarthMagneticMachine.h.

## fldc_p

EarthField casacore::EarthMagneticMachine::fldc_p

private

Earth field calculator.

Definition at line 241 of file EarthMagneticMachine.h.

## hgt_p

Double casacore::EarthMagneticMachine::hgt_p

private

Height (m).

Definition at line 218 of file EarthMagneticMachine.h.

## in_p

MVDirection casacore::EarthMagneticMachine::in_p

private

Input position.

Definition at line 230 of file EarthMagneticMachine.h.

## inref_p

MDirection::Ref casacore::EarthMagneticMachine::inref_p

private

Input direction reference.

Definition at line 216 of file EarthMagneticMachine.h.

## los_p

Double casacore::EarthMagneticMachine::los_p

private

Line-of-sight field.

Definition at line 245 of file EarthMagneticMachine.h.

## pex_p

Bool casacore::EarthMagneticMachine::pex_p

private

Definition at line 236 of file EarthMagneticMachine.h.

## pl_p

Vector<Double> casacore::EarthMagneticMachine::pl_p

private

Field position.

Definition at line 247 of file EarthMagneticMachine.h.

## pos_p

MVPosition casacore::EarthMagneticMachine::pos_p

private

Observatory position.

Definition at line 220 of file EarthMagneticMachine.h.

## posl_p

Double casacore::EarthMagneticMachine::posl_p

private

Distance to Earth centre.

Definition at line 222 of file EarthMagneticMachine.h.

## rin_p

MVDirection casacore::EarthMagneticMachine::rin_p

private

Re-typed input position.

Definition at line 232 of file EarthMagneticMachine.h.

## sub_p

MVPosition casacore::EarthMagneticMachine::sub_p

private

Position sub-point.

Definition at line 239 of file EarthMagneticMachine.h.

## subl_p

Double casacore::EarthMagneticMachine::subl_p

private

Distance squared to sub-point.

Definition at line 224 of file EarthMagneticMachine.h.

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

- measures/Measures/EarthMagneticMachine.h