DataLoader
EGMFormatReader
, GRGSFormatReader
, ICGEMFormatReader
, SHMFormatReader
public abstract class PotentialCoefficientsReader extends Object implements DataLoader
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.
GravityFieldFactory
Modifier | Constructor | Description |
---|---|---|
protected |
PotentialCoefficientsReader(String supportedNames,
boolean missingCoefficientsAllowed) |
Simple constructor.
|
Modifier and Type | Method | Description |
---|---|---|
protected static double[] |
buildRow(int degree,
int order,
double value) |
Build a coefficients row.
|
protected static double[][] |
buildTriangularArray(int degree,
int order,
double value) |
Build a coefficients triangular array.
|
protected void |
extendListOfLists(List<List<Double>> list,
int degree,
int order,
double value) |
Extend a list of lists of coefficients if needed.
|
protected double |
getAe() |
Get the central body reference radius.
|
protected org.orekit.forces.gravity.potential.ConstantSphericalHarmonics |
getConstantProvider(boolean wantNormalized,
int degree,
int order) |
Get a time-independent provider for read spherical harmonics coefficients.
|
int |
getMaxAvailableDegree() |
Get the maximal degree available in the last file parsed.
|
int |
getMaxAvailableOrder() |
Get the maximal order available in the last file parsed.
|
int |
getMaxParseDegree() |
Get the degree limit for the next file parsing.
|
int |
getMaxParseOrder() |
Get the order limit for the next file parsing.
|
protected double |
getMu() |
Get the central body attraction coefficient.
|
abstract RawSphericalHarmonicsProvider |
getProvider(boolean wantNormalized,
int degree,
int order) |
Get a provider for read spherical harmonics coefficients.
|
String |
getSupportedNames() |
Get the regular expression for supported files names.
|
protected TideSystem |
getTideSystem() |
Get the
TideSystem used in the gravity field. |
abstract void |
loadData(InputStream input,
String name) |
Load data from a stream.
|
boolean |
missingCoefficientsAllowed() |
Check if missing coefficients are allowed in the input data.
|
protected void |
parseCoefficient(String field,
double[][] array,
int i,
int j,
String cName,
String name) |
Parse a coefficient.
|
protected void |
parseCoefficient(String field,
List<List<Double>> list,
int i,
int j,
String cName,
String name) |
Parse a coefficient.
|
protected static double |
parseDouble(String string) |
Parse a double from a string.
|
protected static void |
rescale(double scale,
boolean normalizedOrigin,
double[][] originC,
double[][] originS,
boolean wantNormalized,
double[][] rescaledC,
double[][] rescaledS) |
Rescale coefficients arrays.
|
protected void |
setAe(double ae) |
Set the central body reference radius.
|
void |
setMaxParseDegree(int maxParseDegree) |
Set the degree limit for the next file parsing.
|
void |
setMaxParseOrder(int maxParseOrder) |
Set the order limit for the next file parsing.
|
protected void |
setMu(double mu) |
Set the central body attraction coefficient.
|
protected void |
setRawCoefficients(boolean rawNormalized,
double[][] c,
double[][] s,
String name) |
Set the tesseral-sectorial coefficients matrix.
|
protected void |
setReadComplete(boolean readComplete) |
Set the indicator for completed read.
|
protected void |
setTideSystem(TideSystem tideSystem) |
Set the
TideSystem used in the gravity field. |
boolean |
stillAcceptsData() |
Check if the loader still accepts new data.
|
protected double[][] |
toArray(List<List<Double>> list) |
Convert a list of list into an array.
|
protected PotentialCoefficientsReader(String supportedNames, boolean missingCoefficientsAllowed)
Build an uninitialized reader.
supportedNames
- regular expression for supported files namesmissingCoefficientsAllowed
- allow missing coefficients in the input datapublic String getSupportedNames()
public boolean missingCoefficientsAllowed()
public void setMaxParseDegree(int maxParseDegree)
maxParseDegree
- maximal degree to parse (may be safely
set to Integer.MAX_VALUE
to parse all available coefficients)public int getMaxParseDegree()
public void setMaxParseOrder(int maxParseOrder)
maxParseOrder
- maximal order to parse (may be safely
set to Integer.MAX_VALUE
to parse all available coefficients)public int getMaxParseOrder()
public boolean stillAcceptsData()
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.
stillAcceptsData
in interface DataLoader
protected void setReadComplete(boolean readComplete)
readComplete
- if true, a gravity field has been completely readprotected void setAe(double ae)
ae
- central body reference radiusprotected double getAe()
protected void setMu(double mu)
mu
- central body attraction coefficientprotected double getMu()
protected void setTideSystem(TideSystem tideSystem)
TideSystem
used in the gravity field.tideSystem
- tide system used in the gravity fieldprotected TideSystem getTideSystem()
TideSystem
used in the gravity field.protected void setRawCoefficients(boolean rawNormalized, double[][] c, double[][] s, String name) throws OrekitException
rawNormalized
- if true, raw coefficients are normalizedc
- raw tesseral-sectorial coefficients matrix
(a reference to the array will be stored)s
- raw tesseral-sectorial coefficients matrix
(a reference to the array will be stored)name
- name of the file (or zip entry)OrekitException
- if a coefficient is missingpublic int getMaxAvailableDegree()
public int getMaxAvailableOrder()
public abstract void loadData(InputStream input, String name) throws IOException, ParseException, OrekitException
loadData
in interface DataLoader
input
- data input streamname
- name of the file (or zip entry)IOException
- if data can't be readParseException
- if data can't be parsedOrekitException
- if some data is missing
or if some loader specific error occurspublic abstract RawSphericalHarmonicsProvider getProvider(boolean wantNormalized, int degree, int order) throws OrekitException
wantNormalized
- if true, the provider will provide normalized coefficients,
otherwise it will provide un-normalized coefficientsdegree
- maximal degreeorder
- maximal orderOrekitException
- if the requested maximal degree or order exceeds the
available degree or order or if no gravity field has read yetgetConstantProvider(boolean, int, int)
protected org.orekit.forces.gravity.potential.ConstantSphericalHarmonics getConstantProvider(boolean wantNormalized, int degree, int order) throws OrekitException
wantNormalized
- if true, the raw provider must provide normalized coefficients,
otherwise it will provide un-normalized coefficientsdegree
- maximal degreeorder
- maximal orderOrekitException
- if the requested maximal degree or order exceeds the
available degree or order or if no gravity field has read yetgetProvider(boolean, int, int)
protected static double[][] buildTriangularArray(int degree, int order, double value)
degree
- array degreeorder
- array ordervalue
- initial value to put in array elementsprotected static double parseDouble(String string)
string
- to be parsed.string
.protected static double[] buildRow(int degree, int order, double value)
degree
- row degreeorder
- row ordervalue
- initial value to put in array elementsprotected void extendListOfLists(List<List<Double>> list, int degree, int order, double value)
list
- list of lists of coefficientsdegree
- degree required to be presentorder
- order required to be presentvalue
- initial value to put in list elementsprotected double[][] toArray(List<List<Double>> list)
list
- list of lists of coefficientsprotected void parseCoefficient(String field, List<List<Double>> list, int i, int j, String cName, String name) throws OrekitException
field
- text field to parselist
- list where to put the coefficienti
- first index in the listj
- second index in the listcName
- name of the coefficientname
- name of the fileOrekitException
- if the coefficient is already setprotected void parseCoefficient(String field, double[][] array, int i, int j, String cName, String name) throws OrekitException
field
- text field to parsearray
- array where to put the coefficienti
- first index in the listj
- second index in the listcName
- name of the coefficientname
- name of the fileOrekitException
- if the coefficient is already setprotected static void rescale(double scale, boolean normalizedOrigin, double[][] originC, double[][] originS, boolean wantNormalized, double[][] rescaledC, double[][] rescaledS) throws OrekitException
scale
- general scaling factor to apply to all elementsnormalizedOrigin
- if true, the origin coefficients are normalizedoriginC
- cosine part of the origina coefficientsoriginS
- sine part of the origin coefficientswantNormalized
- if true, the rescaled coefficients must be normalizedrescaledC
- cosine part of the rescaled coefficients to fill in (may be the originC array)rescaledS
- sine part of the rescaled coefficients to fill in (may be the originS array)OrekitException
- if normalization/unnormalization fails because of an underflow
due to too high degree/orderCopyright © 2002-2018 CS Systèmes d'information. All rights reserved.