org.orekit.forces.gravity.tides.coefficients
Class OceanTidesCoefficientsReader

java.lang.Object
  extended by org.orekit.forces.gravity.tides.coefficients.OceanTidesCoefficientsReader
All Implemented Interfaces:
DataLoader, OceanTidesCoefficientsProvider
Direct Known Subclasses:
FES2004FormatReader

public abstract class OceanTidesCoefficientsReader
extends Object
implements DataLoader, OceanTidesCoefficientsProvider

This abstract class represents a Ocean Tides Coefficients file reader.

For any format specific reader of ocean tides coefficients file, this interface represents all the methods that should be implemented by a reader.
The proper way to use this it to call the getCoefficientProvider method. Indeed, the OceanTidesCoefficientsFactory will determine the best reader to use, depending on file available in the file system.

Since:
1.2
Version:
$Id: OceanTidesCoefficientsReader.java 17582 2017-05-10 12:58:16Z bignon $
Author:
Rami Houdroge
See Also:
OceanTidesCoefficientsFactory
Concurrency :
not thread-safe
Concurrency comment :
instance is mutable

Field Summary
protected  boolean readCompleted
          Indicator for completed read.
 
Constructor Summary
protected OceanTidesCoefficientsReader(String supportedNames)
          Simple constructor.
 
Method Summary
protected  void add(OceanTidesCoefficientsSet set)
          Add a OceanTidesCoefficientsSet to the data map
 double[] getCpmEpm(double nDoodson, int l, int m)
          Get the Clm± and εlm± for given wave
 double[] getCpmSpm(double nDoodson, int l, int m)
          Get the Clm± and Slm± for given wave
 double[] getDoodsonNumbers()
          Get available Doodson numbers
 int getMaxDegree(double doodson, int order)
          Get maximum degree for given wave and order
 int getMaxOrder(double doodson)
          Get maximum order for given wave
 int getMinDegree(double doodson, int order)
          Get min degree for given wave and order
 String getSupportedNames()
          Get the regular expression for supported files names.
protected  boolean isEmpty()
          Chech if data map is empty
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
 

Field Detail

readCompleted

protected boolean readCompleted
Indicator for completed read.

Constructor Detail

OceanTidesCoefficientsReader

protected OceanTidesCoefficientsReader(String supportedNames)
Simple constructor.

Build an uninitialized reader.

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

getDoodsonNumbers

public double[] getDoodsonNumbers()
Get available Doodson numbers

Specified by:
getDoodsonNumbers in interface OceanTidesCoefficientsProvider
Returns:
array of Doodson numbers

getMaxDegree

public int getMaxDegree(double doodson,
                        int order)
Get maximum degree for given wave and order

Specified by:
getMaxDegree in interface OceanTidesCoefficientsProvider
Parameters:
doodson - number
order - of wave
Returns:
Max degree for given wave

getMinDegree

public int getMinDegree(double doodson,
                        int order)
Get min degree for given wave and order

Specified by:
getMinDegree in interface OceanTidesCoefficientsProvider
Parameters:
doodson - number
order - of wave
Returns:
Min degree for given wave

getMaxOrder

public int getMaxOrder(double doodson)
Get maximum order for given wave

Specified by:
getMaxOrder in interface OceanTidesCoefficientsProvider
Parameters:
doodson - number
Returns:
Max order for given wave

getCpmSpm

public double[] getCpmSpm(double nDoodson,
                          int l,
                          int m)
Get the Clm± and Slm± for given wave

Specified by:
getCpmSpm in interface OceanTidesCoefficientsProvider
Parameters:
nDoodson - doodson number
l - order
m - degree
Returns:
double[4] array containing {Clm+, Clm-, Slm+, Slm-}

getCpmEpm

public double[] getCpmEpm(double nDoodson,
                          int l,
                          int m)
Get the Clm± and εlm± for given wave

Specified by:
getCpmEpm in interface OceanTidesCoefficientsProvider
Parameters:
nDoodson - doodson number doodson number
l - order
m - degree
Returns:
double[4] array containing {Clm+, Clm-, εlm+, εlm-}

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

isEmpty

protected boolean isEmpty()
Chech if data map is empty

Returns:
true if it is

add

protected void add(OceanTidesCoefficientsSet set)
Add a OceanTidesCoefficientsSet to the data map

Parameters:
set - set to add to map


Copyright © 2017 CNES. All Rights Reserved.