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.
|
Modifier and Type | Method and Description |
---|---|
GeoMagneticElements |
calculateField(double latitude,
double longitude,
double height)
Calculate the magnetic field at the specified geodetic point identified
by latitude, longitude and altitude.
|
GeoMagneticElements |
calculateField(GeodeticPoint gp)
Calculate the magnetic field at the specified geodetic point identified
by geodetic objet.
|
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()
Returns the epoch for this magnetic field model.
|
String |
getModelName()
Returns the model name.
|
void |
setMainFieldCoefficients(int n,
int m,
double gnm,
double hnm)
Set the given main field coefficients.
|
void |
setSecularVariationCoefficients(int n,
int m,
double dgnm,
double dhnm)
Set 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()
Returns the start of the validity period for this model.
|
double |
validTo()
Returns 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 height)
latitude
- the latitude in decimal degreeslongitude
- the longitude in decimal degreesheight
- the altitude in kilometers above mean sea levelGeoMagneticElements
at the given geodetic pointpublic GeoMagneticElements calculateField(GeodeticPoint gp)
gp
- geodetic pointGeoMagneticElements
at the given geodetic 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 framePatriusException
- if the specified year is outside the validity periodPatriusException
- 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 © 2021 CNES. All rights reserved.