fr.cnes.sirius.patrius.tools.force.validation
Class PVEphemerisLoader

java.lang.Object
  extended by fr.cnes.sirius.patrius.tools.force.validation.PVEphemerisLoader
All Implemented Interfaces:
DataLoader

public class PVEphemerisLoader
extends Object
implements DataLoader

Step by step ephemeris data loader.

This class is a PV ephemeris loader. The ephemeris file contains 8 columns. The date must be written in the two first columns: the first column is the offset with respect to the fifties reference epoch, the second column is the second number within the day. The position is stored in the third, forth and fifth columns. The velocity is stored in the sixth, seventh and eighth columns. The allowed characters are : space, numbers, point, minus sign, plus sign and E.

Step by step, this loader read one line of the file, extracts the information and saves it in two tables. The list 'dates' contains the absolute dates in the specified time scale (by default, TAI scale). Use 'setTScale' to modify the time scale. The list 'ephemeris' contains the PV coordinates.

Since:
1.1
Version:
$Id: PVEphemerisLoader.java 17581 2017-05-10 12:47:31Z bignon $
Author:
Gerald Mercadier
Use sample :
final PVEphemerisLoader loader = new PVEphemerisLoader("PV_ephem.ascii"); loader.loadData(input,"PV_ephem.ascii");
Concurrency :
not thread safe

Constructor Summary
PVEphemerisLoader()
          Build an ephemeris data loader.
 
Method Summary
 List<AbsoluteDate> getDates()
          Give the list of dates which have been read.
 List<PVCoordinates> getEphemeris()
          Give the list of PV coordinates which have been read.
 void loadData(InputStream input, String name)
          Load data from a stream.
 void setTScale(TimeScale inTScale)
          Set the TimeScale for AbsoluteDate management.
 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

PVEphemerisLoader

public PVEphemerisLoader()
Build an ephemeris data loader.

Method Detail

stillAcceptsData

public final boolean stillAcceptsData()
Description copied from interface: DataLoader
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 final void loadData(InputStream input,
                           String name)
                    throws IOException,
                           ParseException,
                           OrekitException
Description copied from interface: DataLoader
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

getEphemeris

public final List<PVCoordinates> getEphemeris()
Give the list of PV coordinates which have been read.

Returns:
the list of PV coordinates

getDates

public final List<AbsoluteDate> getDates()
Give the list of dates which have been read.

Returns:
the list of dates

setTScale

public final void setTScale(TimeScale inTScale)
Set the TimeScale for AbsoluteDate management.

Parameters:
inTScale - the TimeScale to set


Copyright © 2017 CNES. All Rights Reserved.