EarthMagneticMachine.h
Classes
- EarthMagneticMachine -- Calculates magnetic field in a direction (full description)
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()
Review Status
- Date Reviewed:
- yyyy/mm/dd
- 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
- add more get() values if necessary
Member Description
Construct an empty machine (probably not usable unles set() used)
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
Copy constructor
EarthMagneticMachine &operator=(const EarthMagneticMachine &other)
Copy assignments
Return line-of-sight field (nT or given units) (from previous calculate
if no direction or height given)
Set or reset part of the machine
Return data
Calculate a value from direction or height (in m if not Quantity)
Return data
Line-of-sight field in nT
Return data
Line-of-sight field in specified units (e.g. G)
Return data
Field (in nT, in ITRF)
Return data
Longitude (rad)
Return data
Longitude in units (e.g. deg)
Return data
Recalculate the machinery
Initialise machinery
void copy(const EarthMagneticMachine &other)
Copy data members
Calculate field