org.orekit.models.earth
Class GeoMagneticModelReader

java.lang.Object
  extended by org.orekit.models.earth.GeoMagneticModelReader
All Implemented Interfaces:
DataLoader, GeoMagneticDataProvider
Direct Known Subclasses:
COFFileFormatReader

public abstract class GeoMagneticModelReader
extends Object
implements DataLoader, GeoMagneticDataProvider

Loads geomagnetic field models from a given input stream. A stream may contain multiple models, the loader reads all available models in consecutive order.

The format of the expected model file is the following:

     {model name} {epoch} {nMax} {nMaxSec} {nMax3} {validity start} {validity end} {minAlt} {maxAlt} {model name} {line number}
 {n} {m} {gnm} {hnm} {dgnm} {dhnm} {model name} {line number}
 

Example:

    WMM2010  2010.00 12 12  0 2010.00 2015.00   -1.0  600.0          WMM2010   0
 1  0  -29496.6       0.0      11.6       0.0                        WMM2010   1
 1  1   -1586.3    4944.4      16.5     -25.9                        WMM2010   2
 

Author:
Thomas Neidhart

Constructor Summary
protected GeoMagneticModelReader(String supportedNames)
          Simple constructor.
 
Method Summary
protected  void add(GeoMagneticField model)
          Add a GeoMagneticField to the models list.
 Collection<GeoMagneticField> getModels()
          Returns a Collection of the GeoMagneticField models that have been successfully loaded.
 String getSupportedNames()
          Get the regular expression for supported files names.
abstract  void loadData(InputStream input, String name)
          Load data from a stream.
 boolean stillAcceptsData()
          Check if the loader still accepts new data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoMagneticModelReader

protected GeoMagneticModelReader(String supportedNames)
Simple constructor.

Build an uninitialized reader.

Parameters:
supportedNames - regular expression for supported files names
Method Detail

getModels

public Collection<GeoMagneticField> getModels()
Returns a Collection of the GeoMagneticField models that have been successfully loaded. The Collection is in insertion-order, thus it may not be sorted in order of the model epoch.

Specified by:
getModels in interface GeoMagneticDataProvider
Returns:
a Collection of GeoMagneticField models

stillAcceptsData

public boolean stillAcceptsData()
Check if the loader still accepts new data.

This method is used to speed up data loading by interrupting crawling the data sets as soon as a loader has found the data it was waiting for. For loaders that can merge data from any number of sources (for example JPL ephemerides or Earth Orientation Parameters that are split among several files), this method should always return true to make sure no data is left over.

Specified by:
stillAcceptsData in interface DataLoader
Returns:
true while the loader still accepts new data

loadData

public abstract void loadData(InputStream input,
                              String name)
                       throws IOException,
                              ParseException,
                              OrekitException
Load data from a stream.

Specified by:
loadData in interface DataLoader
Parameters:
input - data input stream
name - name of the file (or zip entry)
Throws:
IOException - if data can't be read
ParseException - if data can't be parsed
OrekitException - if some data is missing or if some loader specific error occurs

getSupportedNames

public String getSupportedNames()
Get the regular expression for supported files names.

Returns:
regular expression for supported files names

add

protected void add(GeoMagneticField model)
Add a GeoMagneticField to the models list.

Parameters:
model - model to add to list


Copyright © 2017 CNES. All Rights Reserved.