Template Function lupnt::ReadHarmonicGravityField(const std::string&, int, int, bool)¶
Defined in File body.cc
Function Documentation¶
-
template<typename T>
GravityField<T> lupnt::ReadHarmonicGravityField(const std::string &filename, int n, int m, bool normalized)¶ Read a harmonic gravity field from a file.
Load and unnormalize a spherical-harmonic gravity field of degree/order
nxmfromfilename, in SI units.Used by
Body::Earth/Moon/Mars/Venus(and directly in examples/tests) to populateGravityField::CS,GM, andRfor high-fidelity gravity acceleration viaAccelarationGravityField. Parses a GFC-style coefficient file (POTFIELD/RECOEFrecords); ifnormalizedis true, coefficients are converted to unnormalized form on load.- Parameters:
filename – Harmonic gravity field filename
n – Degree of the spherical harmonics expansion
m – Order of the spherical harmonics expansion
normalized – Whether the coefficients are normalized
filename – Coefficient file name, resolved via the LuPNT data path (e.g. “EGM96.cof”, “grgm900c.cof”)
n – Max degree to retain (must be <= the field’s stored n_max)
m – Max order to retain (must be <= the field’s stored m_max)
normalized – True if the file’s stored coefficients are normalized and should be converted to unnormalized form
- Returns:
Gravity field object
- Returns:
GravityField<T>with GM [m^3/s^2], R [m], and unnormalized CS coefficients up to degree/ordern/m