Module: magneticFieldWMM

Executive Summary

Evaluate a magnetic field model about Earth for a range of spacecraft locations using the World Magnetic Model (WMM).

For more information on this module see this For more information on this module see this PDF Description.

The module is a sub-class of the Module: magneticFieldBase base class. See that class for the nominal messages used and general instructions.


class MagneticFieldWMM : public MagneticFieldBase
#include <magneticFieldWMM.h>

magnetic field WMM class

Public Functions

MagneticFieldWMM()

The constructor method initializes the dipole parameters to zero, resuling in a zero magnetic field result by default.

Returns:

void

~MagneticFieldWMM()

Clean up any memory allocations.

Returns:

void

Public Members

std::string dataPath

&#8212; String with the path to the WMM coefficient file

double epochDateFractionalYear

Specified epoch date as a fractional year.

BSKLogger bskLogger

&#8212; BSK Logging

Private Functions

void evaluateMagneticFieldModel(MagneticFieldMsgPayload *msg, double currentTime)

This method is evaluates the centered dipole magnetic field model.

Parameters:
  • msg – magnetic field message structure

  • currentTime – current time (s)

Returns:

void

void initializeWmm(const char *dataPath)
void cleanupEarthMagFieldModel()

Performs memory cleanup necessary for magnetic field models

Returns:

void

void computeWmmField(double decimalYear, double phi, double lambda, double h, double B_M[3])
void customReset(uint64_t CurrentClock)

Custom Reset() method. This loads the WMM coefficient file and gets the model setup.

Returns:

void

void customSetEpochFromVariable()

Custom customSetEpochFromVariable() method. This allows specifying epochDateFractionYear directly from Python. If an epoch message is set then this variable is not used.

Returns:

void

void decimalYear2Gregorian(double fractionalYear, struct tm *gregorian)

Convert a fraction year double value into a time structure with gregorian date/time information

Returns:

void

double gregorian2DecimalYear(double currentTime)

Convert a time structure with gregorian date/time information into a fraction year value.

Returns:

double

Private Members

MAGtype_MagneticModel *magneticModels[1]
MAGtype_MagneticModel *timedMagneticModel
MAGtype_Ellipsoid ellip
MAGtype_Geoid geoid
MAGtype_Date userDate