Package com.luciad.format.magneticnorth
Class TLcdIGRFMagneticNorthMap
java.lang.Object
com.luciad.format.magneticnorth.TLcdIGRFMagneticNorthMap
- All Implemented Interfaces:
ILcdMagneticNorthMap,ILcdInputStreamFactoryCapable
This class maps the declination, inclination and total intensity of the magnetic north
vector to a given point and date.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdIGRFMagneticNorthMap.TLcdIGRFMagneticNorthMap(String aDataFileName) Constructs a newTLcdIGRFMagneticNorthMapready to use. -
Method Summary
Modifier and TypeMethodDescriptionclone()static floatConverts aCalendarto a decimal year format.static CalendarconvertDecimalTimeToCalendar(float aDecimalTime) Converts a decimal year format to aCalendar.Return the first date value for which this map can retrieve magnetic north.Return the file name of the data file used to base the calculations on.getDate()Returns the current date set to this map.Return the last date value for which this map can retrieve magnetic north.Returns the input stream factory to load the data.Returns the name of the model.Returns the abbreviated model name.booleanisValidDate(Calendar aDate) Checks whether the given date is a valid date for this map.floatretrieveDeclinationAt(ILcdPoint aPoint) Given a point (and implicitly a time value via setDate()), this method calculates the declination of the magnetic north vector.floatretrieveInclinationAt(ILcdPoint aPoint) Given a point (and implicitly a time value via setDate()), this method calculates the inclination of the magnetic north vector.floatretrieveTotalIntensityAt(ILcdPoint aPoint) Given a point (and implicitly a time value via setDate()), this method calculates the total intensity of the magnetic north vector.voidsetDataFileName(String aDataFileName) Sets the file name of the data file to be used.voidSets the date to retrieve the magnetic north at.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to load the data.
-
Field Details
-
DECLINATION
protected static final int DECLINATION- See Also:
-
INCLINATION
protected static final int INCLINATION- See Also:
-
TOTAL_INTENSITY
protected static final int TOTAL_INTENSITY- See Also:
-
-
Constructor Details
-
TLcdIGRFMagneticNorthMap
public TLcdIGRFMagneticNorthMap()Constructs a newTLcdIGRFMagneticNorthMap. You have to set the data file before it can be fully used. -
TLcdIGRFMagneticNorthMap
Constructs a newTLcdIGRFMagneticNorthMapready to use.- Parameters:
aDataFileName- The file name of the data file containing the data about the igrf model
-
-
Method Details
-
getDataFileName
Return the file name of the data file used to base the calculations on.- Returns:
- The file name of the data file used to base the calculations on
- See Also:
-
setDataFileName
Sets the file name of the data file to be used.- Parameters:
aDataFileName- The file name relative to the classpath- See Also:
-
getModelName
Description copied from interface:ILcdMagneticNorthMapReturns the name of the model.- Specified by:
getModelNamein interfaceILcdMagneticNorthMap- Returns:
- the name of the model
- See Also:
-
getShortModelName
Description copied from interface:ILcdMagneticNorthMapReturns the abbreviated model name.- Specified by:
getShortModelNamein interfaceILcdMagneticNorthMap- Returns:
- the abbreviated model name
- See Also:
-
retrieveDeclinationAt
Description copied from interface:ILcdMagneticNorthMapGiven a point (and implicitly a time value via setDate()), this method calculates the declination of the magnetic north vector.- Specified by:
retrieveDeclinationAtin interfaceILcdMagneticNorthMap- Parameters:
aPoint- The point on the globe, the reference is World Geodetic System 1984 (WGS 84)- Returns:
- the declination in degrees at the given point
-
retrieveInclinationAt
Description copied from interface:ILcdMagneticNorthMapGiven a point (and implicitly a time value via setDate()), this method calculates the inclination of the magnetic north vector.- Specified by:
retrieveInclinationAtin interfaceILcdMagneticNorthMap- Parameters:
aPoint- The point on the globe, the reference is World Geodetic System 1984 (WGS 84)- Returns:
- the inclination in degrees at the given point
-
retrieveTotalIntensityAt
Description copied from interface:ILcdMagneticNorthMapGiven a point (and implicitly a time value via setDate()), this method calculates the total intensity of the magnetic north vector.- Specified by:
retrieveTotalIntensityAtin interfaceILcdMagneticNorthMap- Parameters:
aPoint- The point on the globe, the reference is World Geodetic System 1984 (WGS 84)- Returns:
- the total intensity in nanoTesla (nT) at the given point
-
isValidDate
Description copied from interface:ILcdMagneticNorthMapChecks whether the given date is a valid date for this map.- Specified by:
isValidDatein interfaceILcdMagneticNorthMap- Parameters:
aDate- the date to check the validity for.- Returns:
- true if
getBeginValidDate() <= aDate <= getEndValidDate(), false otherwise.
-
getBeginValidDate
Description copied from interface:ILcdMagneticNorthMapReturn the first date value for which this map can retrieve magnetic north.- Specified by:
getBeginValidDatein interfaceILcdMagneticNorthMap- Returns:
- the first date value for which this map can retrieve magnetic north
-
getEndValidDate
Description copied from interface:ILcdMagneticNorthMapReturn the last date value for which this map can retrieve magnetic north.- Specified by:
getEndValidDatein interfaceILcdMagneticNorthMap- Returns:
- the last date value for which this map can retrieve magnetic north
-
setDate
Description copied from interface:ILcdMagneticNorthMapSets the date to retrieve the magnetic north at.- Specified by:
setDatein interfaceILcdMagneticNorthMap- Parameters:
aDate- The date, isValidDate(aDate) must be true.- See Also:
-
getDate
Description copied from interface:ILcdMagneticNorthMapReturns the current date set to this map.- Specified by:
getDatein interfaceILcdMagneticNorthMap- Returns:
- The current date set to this map.
- See Also:
-
clone
- Specified by:
clonein interfaceILcdMagneticNorthMap- Throws:
CloneNotSupportedException
-
getInputStreamFactory
Returns the input stream factory to load the data.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory to load the data.
- See Also:
-
setInputStreamFactory
Sets the input stream factory to load the data.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- an InputStream factory that creates input streams to load the magnetic north data.- See Also:
-
getValidDateClosestToToday
-
convertCalendarToDecimalTime
Converts aCalendarto a decimal year format. Only uses year, month and day. Hours and seconds are ignored. -
convertDecimalTimeToCalendar
Converts a decimal year format to aCalendar. Only uses year. Month, day, hours and seconds are ignored.
-