public class GeoMagneticField extends Object
Based on original software written by Manoj Nair from the National Geophysical Data Center, NOAA, as part of the WMM 2010 software release (WMM_SubLibrary.c)
Constructor and Description |
---|
GeoMagneticField(String modelNameIn,
double epochIn,
int maxNIn,
int maxNSecIn,
double validityStartIn,
double validityEndIn)
Create a new geomagnetic field model with the given parameters.
Internal structures are initialized according to the specified degrees of the main and secular variations. |
Modifier and Type | Method and Description |
---|---|
GeoMagneticElements |
calculateField(double latitude,
double longitude,
double altitude)
Calculate the magnetic field at the specified latitude, longitude and height.
|
GeoMagneticElements |
calculateField(EllipsoidPoint point)
Calculate the magnetic field at the specified ellipsoid point identified by latitude, longitude and height.
|
GeoMagneticElements |
calculateField(Vector3D point,
Frame frame,
AbsoluteDate date)
Calculate the magnetic field at the specified point identified by the coordinates of the point and the reference
point.
|
static double |
getDecimalYear(AbsoluteDate date)
Utility function to get a decimal year for a given AbsoluteDate.
|
static double |
getDecimalYear(int day,
int month,
int year)
Utility function to get a decimal year for a given day.
|
double |
getEpoch()
Getter for the epoch for this magnetic field model.
|
String |
getModelName()
Getter for the model name.
|
void |
setMainFieldCoefficients(int n,
int m,
double gnm,
double hnm)
Setter for the given main field coefficients.
|
void |
setSecularVariationCoefficients(int n,
int m,
double dgnm,
double dhnm)
Setter for the given secular variation coefficients.
|
boolean |
supportsTimeTransform()
Indicates whether this model supports time transformation or not.
|
GeoMagneticField |
transformModel(double year)
Time transform the model coefficients from the base year of the model using secular variation coefficients.
|
GeoMagneticField |
transformModel(GeoMagneticField otherModel,
double year)
Time transform the model coefficients from the base year of the model using a linear interpolation with a second
model.
|
double |
validFrom()
Getter for the start of the validity period for this model.
|
double |
validTo()
Getter for the end of the validity period for this model.
|
public GeoMagneticField(String modelNameIn, double epochIn, int maxNIn, int maxNSecIn, double validityStartIn, double validityEndIn)
modelNameIn
- the model nameepochIn
- the base time of magnetic field model epoch (yrs)maxNIn
- the maximum degree of the main modelmaxNSecIn
- the maximum degree of the secular variationsvalidityStartIn
- validity start of this modelvalidityEndIn
- validity end of this modelpublic double getEpoch()
public String getModelName()
public double validFrom()
public double validTo()
public boolean supportsTimeTransform()
true
if this model can be transformed within its validity period, false
otherwisepublic void setMainFieldCoefficients(int n, int m, double gnm, double hnm)
n
- the degreem
- the ordergnm
- the g coefficient at position n,mhnm
- the h coefficient at position n,mpublic void setSecularVariationCoefficients(int n, int m, double dgnm, double dhnm)
n
- the degreem
- the orderdgnm
- the dg coefficient at position n,mdhnm
- the dh coefficient at position n,mpublic GeoMagneticElements calculateField(double latitude, double longitude, double altitude)
latitude
- the latitude in decimal degreeslongitude
- the longitude in decimal degreesaltitude
- the altitude in kilometers above mean sea levelGeoMagneticElements
at the given geodetic pointpublic GeoMagneticElements calculateField(EllipsoidPoint point)
point
- ellipsoid pointGeoMagneticElements
at the given ellipsoid pointpublic GeoMagneticElements calculateField(Vector3D point, Frame frame, AbsoluteDate date) throws PatriusException
point
- cartesian pointframe
- frame in which cartesian point is expresseddate
- date in which cartesian point is givenGeoMagneticElements
at the given cartesian pointPatriusException
- if point cannot be converted to body frame
if the specified year is outside the validity period
if getDecimalYear() error occurredpublic GeoMagneticField transformModel(double year) throws PatriusException
year
- the year to which the model shall be transformedPatriusException
- if the specified year is outside the validity period of the model or the model does not support time
transformations (i.e. no secular variations available)public GeoMagneticField transformModel(GeoMagneticField otherModel, double year) throws PatriusException
otherModel
- the other magnetic field modelyear
- the year to which the model shall be transformedPatriusException
- if the specified year is outside the validity period of the model or the model does not support time
transformations (i.e. no secular variations available)public static double getDecimalYear(AbsoluteDate date) throws PatriusException
date
- date in AbsoluteDate formatPatriusException
- if TimeScalesFactory error occurredpublic static double getDecimalYear(int day, int month, int year)
day
- the day (1-31)month
- the month (1-12)year
- the yearCopyright © 2023 CNES. All rights reserved.