org.orekit.forces.gravity.potential
Class PotentialCoefficientsReader

java.lang.Object
  extended by org.orekit.forces.gravity.potential.PotentialCoefficientsReader
All Implemented Interfaces:
DataLoader, PotentialCoefficientsProvider
Direct Known Subclasses:
EGMFormatReader, GRGSFormatReader, ICGEMFormatReader, SHMFormatReader

public abstract class PotentialCoefficientsReader
extends Object
implements DataLoader, PotentialCoefficientsProvider

This abstract class represents a Gravitational Potential Coefficients file reader.

As it exits many different coefficients models and containers this interface represents all the methods that should be implemented by a reader. The proper way to use this interface is to call the GravityFieldFactory which will determine which reader to use with the selected potential coefficients file.

Author:
Fabien Maussion
See Also:
GravityFieldFactory

Field Summary
protected  double ae
          Central body reference radius.
protected  double mu
          Central body attraction coefficient.
protected  double[][] normalizedC
          fully normalized tesseral-sectorial coefficients matrix.
protected  double[] normalizedJ
          fully normalized zonal coefficients array.
protected  double[][] normalizedS
          fully normalized tesseral-sectorial coefficients matrix.
protected  boolean readCompleted
          Indicator for completed read.
 
Constructor Summary
protected PotentialCoefficientsReader(String supportedNames, boolean missingCoefficientsAllowed)
          Simple constructor.
 
Method Summary
 double getAe()
          Get the value of the central body reference radius.
 double[][] getC(int n, int m, boolean normalized)
          Get the tesseral-sectorial and zonal coefficients.
 double[] getJ(boolean normalized, int n)
          Get the zonal coefficients.
 double getMu()
          Get the central body attraction coefficient.
 double[][] getS(int n, int m, boolean normalized)
          Get tesseral-sectorial coefficients.
 String getSupportedNames()
          Get the regular expression for supported files names.
abstract  void loadData(InputStream input, String name)
          Load data from a stream.
 boolean missingCoefficientsAllowed()
          Check if missing coefficients are allowed in the input data.
 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.


ae

protected double ae
Central body reference radius.


mu

protected double mu
Central body attraction coefficient.


normalizedJ

protected double[] normalizedJ
fully normalized zonal coefficients array.


normalizedC

protected double[][] normalizedC
fully normalized tesseral-sectorial coefficients matrix.


normalizedS

protected double[][] normalizedS
fully normalized tesseral-sectorial coefficients matrix.

Constructor Detail

PotentialCoefficientsReader

protected PotentialCoefficientsReader(String supportedNames,
                                      boolean missingCoefficientsAllowed)
Simple constructor.

Build an uninitialized reader.

Parameters:
supportedNames - regular expression for supported files names
missingCoefficientsAllowed - allow missing coefficients in the input data
Method Detail

getSupportedNames

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

Returns:
regular expression for supported files names

missingCoefficientsAllowed

public boolean missingCoefficientsAllowed()
Check if missing coefficients are allowed in the input data.

Returns:
true if missing coefficients are allowed in the input data

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

getJ

public double[] getJ(boolean normalized,
                     int n)
              throws OrekitException
Get the zonal coefficients.

Specified by:
getJ in interface PotentialCoefficientsProvider
Parameters:
normalized - (true) or un-normalized (false)
n - the maximal degree requested
Returns:
J the zonal coefficients array.
Throws:
OrekitException - if the requested maximal degree exceeds the available degree

getC

public double[][] getC(int n,
                       int m,
                       boolean normalized)
                throws OrekitException
Get the tesseral-sectorial and zonal coefficients.

Specified by:
getC in interface PotentialCoefficientsProvider
Parameters:
n - the degree
m - the order
normalized - (true) or un-normalized (false)
Returns:
the cosines coefficients matrix
Throws:
OrekitException - if the requested maximal degree or order exceeds the available degree or order

getS

public double[][] getS(int n,
                       int m,
                       boolean normalized)
                throws OrekitException
Get tesseral-sectorial coefficients.

Specified by:
getS in interface PotentialCoefficientsProvider
Parameters:
n - the degree
m - the order
normalized - (true) or un-normalized (false)
Returns:
the sines coefficients matrix
Throws:
OrekitException - if the requested maximal degree or order exceeds the available degree or order

getMu

public double getMu()
Get the central body attraction coefficient.

Specified by:
getMu in interface PotentialCoefficientsProvider
Returns:
mu (m3/s2)

getAe

public double getAe()
Get the value of the central body reference radius.

Specified by:
getAe in interface PotentialCoefficientsProvider
Returns:
ae (m)


Copyright © 2017 CNES. All Rights Reserved.