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.
User Guide
The Module: magneticFieldWMM model is created using:
1from Basilisk.utilities.supportDataTools.dataFetcher import get_path, DataFile
2from Basilisk.simulation import magneticFieldWMM
3
4magModule = magneticFieldWMM.MagneticFieldWMM()
5magModule.ModelTag = "WMM"
6
7# Configuration of WMM coefficient file
8wmm_file = get_path(DataFile.MagneticFieldData.WMM)
9magModule.configureWMMFile(str(wmm_file))
10
11scSim.AddModelToTask(dynTaskName, magModule)
-
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.
-
~MagneticFieldWMM()
Clean up any memory allocations.
-
void configureWMMFile(const std::string &file)
Method to configure the Magnetic Field model with the data file path
- Parameters:
file – WMM source data path
Public Members
-
double epochDateFractionalYear
Specified epoch date as a fractional year.
-
BSKLogger bskLogger
— BSK Logging
-
std::string wmmDataFullPath
Full path to the WMM file selected by the user.
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)
-
void initializeWmm()
-
void cleanupEarthMagFieldModel()
Performs memory cleanup necessary for magnetic field models
-
void computeWmmField(double decimalYear, MAGtype_CoordSpherical coord, double B_M[3])
-
void customReset(uint64_t CurrentClock)
Custom Reset() method. This loads the WMM coefficient file and gets the model setup.
-
void customSetEpochFromVariable()
Custom customSetEpochFromVariable() method. This allows specifying epochDateFractionYear directly from Python. If an epoch message is set then this variable is not used.
-
void decimalYear2Gregorian(double fractionalYear, struct tm *gregorian)
Convert a fraction year double value into a time structure with gregorian date/time information
-
double gregorian2DecimalYear(double currentTime)
Convert a time structure with gregorian date/time information into a fraction year value.
- Returns:
double
Private Members
-
MAGtype_MagneticModel *magneticModel
-
MAGtype_MagneticModel *timedMagneticModel
-
MAGtype_Ellipsoid ellip
-
MAGtype_Geoid geoid
-
MAGtype_Date userDate
-
MAGtype_LegendreFunction *LegendreFunction
-
MAGtype_SphericalHarmonicVariables *SphVariables
-
MagneticFieldWMM()