public class TLcdIGRFMagneticNorthMap extends Object implements ILcdInputStreamFactoryCapable
Be sure to use the same TLcdIGRFMagneticNorthMap
for successive calculations since it performs caching.
The model used for the calculations has a limited life span. If you try to perform calculations outside this lifespan, an exception will be thrown.
The user of this class is responsible for setting the data file name of the model to use.
See TLcdIGRFModelDecoder
for more information about the supported data files.
Check out http://www.ngdc.noaa.gov/geomag/geomag.shtml for more info about the used terms.
Check out http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html for more information about the used model.
Modifier and Type | Field and Description |
---|---|
protected static int |
DECLINATION |
protected static int |
INCLINATION |
protected static int |
TOTAL_INTENSITY |
Constructor and Description |
---|
TLcdIGRFMagneticNorthMap()
Constructs a new
TLcdIGRFMagneticNorthMap . |
TLcdIGRFMagneticNorthMap(String aDataFileName)
Constructs a new
TLcdIGRFMagneticNorthMap ready to use. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
static float |
convertCalendarToDecimalTime(Calendar aTime)
Converts a
Calendar to a decimal year format. |
static Calendar |
convertDecimalTimeToCalendar(float aDecimalTime)
Converts a decimal year format to a
Calendar . |
Calendar |
getBeginValidDate()
Return the first date value for which this map can retrieve magnetic north.
|
String |
getDataFileName()
Return the file name of the data file used to base the calculations on.
|
Calendar |
getDate()
Returns the current date set to this map.
|
Calendar |
getEndValidDate()
Return the last date value for which this map can retrieve magnetic north.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory to load the data.
|
String |
getModelName()
Returns the name of the model.
|
String |
getShortModelName()
Returns the abbreviated model name.
|
Calendar |
getValidDateClosestToToday() |
boolean |
isValidDate(Calendar aDate)
Checks whether the given date is a valid date for this map.
|
float |
retrieveDeclinationAt(ILcdPoint aPoint)
Given a point (and implicitly a time value via setDate()), this method calculates
the declination of the magnetic north vector.
|
float |
retrieveInclinationAt(ILcdPoint aPoint)
Given a point (and implicitly a time value via setDate()), this method calculates
the inclination of the magnetic north vector.
|
float |
retrieveTotalIntensityAt(ILcdPoint aPoint)
Given a point (and implicitly a time value via setDate()), this method calculates
the total intensity of the magnetic north vector.
|
void |
setDataFileName(String aDataFileName)
Sets the file name of the data file to be used.
|
void |
setDate(Calendar aDate)
Sets the date to retrieve the magnetic north at.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to load the data.
|
protected static final int DECLINATION
protected static final int INCLINATION
protected static final int TOTAL_INTENSITY
public TLcdIGRFMagneticNorthMap()
TLcdIGRFMagneticNorthMap
. You have to set the data file
before it can be fully used.public TLcdIGRFMagneticNorthMap(String aDataFileName)
TLcdIGRFMagneticNorthMap
ready to use.aDataFileName
- The file name of the data file containing the
data about the igrf modelpublic String getDataFileName()
setDataFileName(java.lang.String)
public void setDataFileName(String aDataFileName)
aDataFileName
- The file name relative to the classpathgetDataFileName()
public String getModelName()
ILcdMagneticNorthMap
getModelName
in interface ILcdMagneticNorthMap
ILcdMagneticNorthMap
public String getShortModelName()
ILcdMagneticNorthMap
getShortModelName
in interface ILcdMagneticNorthMap
ILcdMagneticNorthMap
public float retrieveDeclinationAt(ILcdPoint aPoint)
ILcdMagneticNorthMap
retrieveDeclinationAt
in interface ILcdMagneticNorthMap
aPoint
- The point on the globe, the reference is World Geodetic System
1984 (WGS 84)public float retrieveInclinationAt(ILcdPoint aPoint)
ILcdMagneticNorthMap
retrieveInclinationAt
in interface ILcdMagneticNorthMap
aPoint
- The point on the globe, the reference is World Geodetic System
1984 (WGS 84)public float retrieveTotalIntensityAt(ILcdPoint aPoint)
ILcdMagneticNorthMap
retrieveTotalIntensityAt
in interface ILcdMagneticNorthMap
aPoint
- The point on the globe, the reference is World Geodetic System
1984 (WGS 84)public boolean isValidDate(Calendar aDate)
ILcdMagneticNorthMap
isValidDate
in interface ILcdMagneticNorthMap
aDate
- the date to check the validity for.getBeginValidDate() <= aDate <= getEndValidDate()
, false otherwise.public Calendar getBeginValidDate()
ILcdMagneticNorthMap
getBeginValidDate
in interface ILcdMagneticNorthMap
public Calendar getEndValidDate()
ILcdMagneticNorthMap
getEndValidDate
in interface ILcdMagneticNorthMap
public void setDate(Calendar aDate)
ILcdMagneticNorthMap
setDate
in interface ILcdMagneticNorthMap
aDate
- The date, isValidDate(aDate) must be true.ILcdMagneticNorthMap.getDate()
public Calendar getDate()
ILcdMagneticNorthMap
getDate
in interface ILcdMagneticNorthMap
ILcdMagneticNorthMap.setDate(java.util.Calendar)
public Object clone() throws CloneNotSupportedException
clone
in interface ILcdMagneticNorthMap
CloneNotSupportedException
public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
setInputStreamFactory(com.luciad.io.ILcdInputStreamFactory)
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- an InputStream factory that creates input streams to load the
magnetic north data.getInputStreamFactory()
public Calendar getValidDateClosestToToday()
public static float convertCalendarToDecimalTime(Calendar aTime)
Calendar
to a decimal year format.
Only uses year, month and day. Hours and seconds are ignored.public static Calendar convertDecimalTimeToCalendar(float aDecimalTime)
Calendar
.
Only uses year. Month, day, hours and seconds are ignored.