casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::EarthMagneticMachine Class Reference

Calculates magnetic field in a direction. More...

#include <EarthMagneticMachine.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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

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;
MeasFrame frame(epo, pos);
// Note that e.g. the time in the frame can be changed later
// Set up a machine
// Given a current observational direction
MDirection indir(Quantity(3.25745692, "rad"),
Quantity(0.040643336,"rad"),
// 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

Definition at line 116 of file EarthMagneticMachine.h.

Constructor & Destructor Documentation

casacore::EarthMagneticMachine::EarthMagneticMachine ( )

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

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
casacore::EarthMagneticMachine::EarthMagneticMachine ( const MDirection::Ref in,
const Quantum< Double > &  hgt,
const MPosition pos,
const MEpoch tm 
)
casacore::EarthMagneticMachine::EarthMagneticMachine ( const MDirection::Ref in,
const MVDirection dir,
MeasFrame frame 
)
casacore::EarthMagneticMachine::EarthMagneticMachine ( const MDirection::Ref in,
const MVDirection dir,
const MPosition pos,
const MEpoch tm 
)
casacore::EarthMagneticMachine::EarthMagneticMachine ( const EarthMagneticMachine other)

Copy constructor.

casacore::EarthMagneticMachine::~EarthMagneticMachine ( )

Member Function Documentation

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

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

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

Calculate field.

void casacore::EarthMagneticMachine::copy ( const EarthMagneticMachine other)
private

Copy data members.

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

Field (in nT, in ITRF)

const MVEarthMagnetic& casacore::EarthMagneticMachine::getField ( const MVDirection in)
Double casacore::EarthMagneticMachine::getLong ( )

Longitude (rad)

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

Longitude in units (e.g.

deg)

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

Return data.

Line-of-sight field in nT

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

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

G)

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

Position point.

const MVPosition& casacore::EarthMagneticMachine::getPosition ( const MVDirection in)
void casacore::EarthMagneticMachine::init ( )
private

Initialise machinery.

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

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

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

Copy assignments.

void casacore::EarthMagneticMachine::reCalculate ( )

Recalculate the machinery.

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

Set or reset part of the machine.

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

Member Data Documentation

Bool casacore::EarthMagneticMachine::clx_p
private

Calc done.

Definition at line 256 of file EarthMagneticMachine.h.

MDirection::Convert casacore::EarthMagneticMachine::conv_p
private

Conversion engine.

Definition at line 231 of file EarthMagneticMachine.h.

Int casacore::EarthMagneticMachine::cumf_p
private

Cumulative filled fields.

Definition at line 254 of file EarthMagneticMachine.h.

Double casacore::EarthMagneticMachine::epo_p
private

Epoch.

Definition at line 229 of file EarthMagneticMachine.h.

Bool casacore::EarthMagneticMachine::fex_p
private

Extension calculated.

Definition at line 238 of file EarthMagneticMachine.h.

Int casacore::EarthMagneticMachine::fil_p
private

Fields filled.

Definition at line 252 of file EarthMagneticMachine.h.

MVEarthMagnetic casacore::EarthMagneticMachine::fld_p
private

Magnetic field.

Definition at line 246 of file EarthMagneticMachine.h.

EarthField casacore::EarthMagneticMachine::fldc_p
private

Earth field calculator.

Definition at line 244 of file EarthMagneticMachine.h.

Double casacore::EarthMagneticMachine::hgt_p
private

Height (m)

Definition at line 221 of file EarthMagneticMachine.h.

MVDirection casacore::EarthMagneticMachine::in_p
private

Input position.

Definition at line 233 of file EarthMagneticMachine.h.

MDirection::Ref casacore::EarthMagneticMachine::inref_p
private

Input direction reference.

Definition at line 219 of file EarthMagneticMachine.h.

Double casacore::EarthMagneticMachine::los_p
private

Line-of-sight field.

Definition at line 248 of file EarthMagneticMachine.h.

Bool casacore::EarthMagneticMachine::pex_p
private

Definition at line 239 of file EarthMagneticMachine.h.

Vector<Double> casacore::EarthMagneticMachine::pl_p
private

Field position.

Definition at line 250 of file EarthMagneticMachine.h.

MVPosition casacore::EarthMagneticMachine::pos_p
private

Observatory position.

Definition at line 223 of file EarthMagneticMachine.h.

Double casacore::EarthMagneticMachine::posl_p
private

Distance to Earth centre.

Definition at line 225 of file EarthMagneticMachine.h.

MVDirection casacore::EarthMagneticMachine::rin_p
private

Re-typed input position.

Definition at line 235 of file EarthMagneticMachine.h.

MVPosition casacore::EarthMagneticMachine::sub_p
private

Position sub-point.

Definition at line 242 of file EarthMagneticMachine.h.

Double casacore::EarthMagneticMachine::subl_p
private

Distance squared to sub-point.

Definition at line 227 of file EarthMagneticMachine.h.


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