public class RuggedBuilder extends Object
Rugged instances.
This class implements the builder pattern to create Rugged instances.
It does so by using a fluent API in order to clarify reading and allow
later extensions with new configuration parameters.
A typical use would be:
Rugged rugged = new RuggedBuilder().
setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF).
setAlgorithmID(AlgorithmId.Duvenhage).
setDigitalElevationModel(tileUpdater, maxCachedTiles).
setTimeSpan(minDate, maxDate, tStep, overshootTolerance).
setTrajectory(positionsVelocities, pvInterpolationNumber, pvFilter,
quaternions, aInterpolationNumber, aFilter).
addLineSensor(sensor1).
addLineSensor(sensor2).
addLineSensor(sensor3).
build();
If a configuration parameter has not been set prior to the call to {]link #build()}, then an exception will be triggered with an explicit error message.
| Constructor and Description |
|---|
RuggedBuilder()
Create a non-configured builder.
|
| Modifier and Type | Method and Description |
|---|---|
RuggedBuilder |
addLineSensor(LineSensor lineSensor)
Set up line sensor model.
|
Rugged |
build()
Build a
Rugged instance. |
RuggedBuilder |
clearLineSensors()
Remove all line sensors.
|
boolean |
getAberrationOfLightCorrection()
Get the aberration of light correction flag.
|
AngularDerivativesFilter |
getAFilter()
Get the filter for derivatives from the sample to use in attitude interpolation.
|
int |
getAInterpolationNumber()
Get the number of points to use for attitude interpolation.
|
AlgorithmId |
getAlgorithm()
Get the algorithm to use for Digital Elevation Model intersection.
|
double |
getConstantElevation()
Get the constant elevation over ellipsoid to use with
AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID. |
ExtendedEllipsoid |
getEllipsoid()
Get the ellipsoid.
|
Frame |
getInertialFrame()
Get the inertial frame.
|
boolean |
getLightTimeCorrection()
Get the light time correction flag.
|
List<LineSensor> |
getLineSensors()
Get all line sensors.
|
int |
getMaxCachedTiles()
Get the maximum number of tiles stored in the cache.
|
AbsoluteDate |
getMaxDate()
Get the end of search time span.
|
AbsoluteDate |
getMinDate()
Get the start of search time span.
|
double |
getOvershootTolerance()
Get the tolerance in seconds allowed for
getMinDate() and getMaxDate() overshooting. |
List<TimeStampedPVCoordinates> |
getpositionsVelocities()
Get the satellite position and velocity (m and m/s in inertial frame).
|
CartesianDerivativesFilter |
getPVFilter()
Get the filter for derivatives from the sample to use in position/velocity interpolation.
|
int |
getPVInterpolationNumber()
Get the number of points to use for position/velocity interpolation.
|
List<TimeStampedAngularCoordinates> |
getQuaternions()
Get the satellite quaternions with respect to inertial frame.
|
TileUpdater |
getTileUpdater()
Get the updater used to load Digital Elevation Model tiles.
|
double |
getTStep()
Get the step to use for inertial frame to body frame transforms cache computations.
|
RuggedBuilder |
setAberrationOfLightCorrection(boolean aberrationOfLightCorrection)
Set flag for aberration of light correction.
|
RuggedBuilder |
setAlgorithm(AlgorithmId algorithmID)
Set the algorithm to use for Digital Elevation Model intersection.
|
RuggedBuilder |
setConstantElevation(double constantElevation)
Set the user-provided constant elevation model.
|
RuggedBuilder |
setDigitalElevationModel(TileUpdater tileUpdater,
int maxCachedTiles)
Set the user-provided
tile updater. |
RuggedBuilder |
setEllipsoid(EllipsoidId ellipsoidID,
BodyRotatingFrameId bodyRotatingFrameID)
Set the reference ellipsoid.
|
RuggedBuilder |
setEllipsoid(OneAxisEllipsoid ellipsoid)
Set the reference ellipsoid.
|
RuggedBuilder |
setLightTimeCorrection(boolean lightTimeCorrection)
Set flag for light time correction.
|
RuggedBuilder |
setTimeSpan(AbsoluteDate minDate,
AbsoluteDate maxDate,
double tStep,
double overshootTolerance)
Set the time span to be covered for direct and inverse location calls.
|
RuggedBuilder |
setTrajectory(double interpolationStep,
int interpolationNumber,
CartesianDerivativesFilter pvFilter,
AngularDerivativesFilter aFilter,
Propagator propagator)
Set the spacecraft trajectory.
|
RuggedBuilder |
setTrajectory(Frame inertialFrame,
List<TimeStampedPVCoordinates> positionsVelocities,
int pvInterpolationNumber,
CartesianDerivativesFilter pvFilter,
List<TimeStampedAngularCoordinates> quaternions,
int aInterpolationNumber,
AngularDerivativesFilter aFilter)
Set the spacecraft trajectory.
|
RuggedBuilder |
setTrajectory(InertialFrameId inertialFrame,
List<TimeStampedPVCoordinates> positionsVelocities,
int pvInterpolationNumber,
CartesianDerivativesFilter pvFilter,
List<TimeStampedAngularCoordinates> quaternions,
int aInterpolationNumber,
AngularDerivativesFilter aFilter)
Set the spacecraft trajectory.
|
RuggedBuilder |
setTrajectoryAndTimeSpan(InputStream storageStream)
Set both the spacecraft trajectory and the time span.
|
void |
storeInterpolator(OutputStream storageStream)
Store frames transform interpolator.
|
public RuggedBuilder()
The builder must be configured before calling the
build() method, otherwise an exception will be triggered
at build time.
public RuggedBuilder setEllipsoid(EllipsoidId ellipsoidID, BodyRotatingFrameId bodyRotatingFrameID) throws RuggedException
ellipsoidID - reference ellipsoidbodyRotatingFrameID - body rotating frame identifierRuggedException - if data needed for some frame cannot be loaded
or if trajectory has been recovered
from an earlier run and frames mismatchsetEllipsoid(OneAxisEllipsoid),
getEllipsoid()public RuggedBuilder setEllipsoid(OneAxisEllipsoid ellipsoid) throws RuggedException
ellipsoid - reference ellipsoidRuggedException - if trajectory has been
recovered from an earlier run and frames mismatchsetEllipsoid(EllipsoidId, BodyRotatingFrameId),
getEllipsoid()public ExtendedEllipsoid getEllipsoid()
setEllipsoid(EllipsoidId, BodyRotatingFrameId),
setEllipsoid(OneAxisEllipsoid)public RuggedBuilder setAlgorithm(AlgorithmId algorithmID)
Note that some algorithms require specific other methods to be called too:
DUVENHAGE,
DUVENHAGE_FLAT_BODY
and BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY all
require setDigitalElevationModel
to be called,CONSTANT_ELEVATION_OVER_ELLIPSOID requires
setConstantElevation to be called,IGNORE_DEM_USE_ELLIPSOID does not require
any methods tobe called.algorithmID - identifier of algorithm to use for Digital Elevation Model intersectionsetDigitalElevationModel(TileUpdater, int),
getAlgorithm()public AlgorithmId getAlgorithm()
setAlgorithm(AlgorithmId)public RuggedBuilder setDigitalElevationModel(TileUpdater tileUpdater, int maxCachedTiles)
tile updater.
Note that when the algorithm specified in setAlgorithm(AlgorithmId)
is either CONSTANT_ELEVATION_OVER_ELLIPSOID or IGNORE_DEM_USE_ELLIPSOID,
then this method becomes irrelevant and can either be not called at all,
or it can be called with an updater set to null. For all other
algorithms, the updater must be properly configured.
tileUpdater - updater used to load Digital Elevation Model tilesmaxCachedTiles - maximum number of tiles stored in the cachesetAlgorithm(AlgorithmId),
getTileUpdater(),
getMaxCachedTiles()public TileUpdater getTileUpdater()
setDigitalElevationModel(TileUpdater, int),
getMaxCachedTiles()public RuggedBuilder setConstantElevation(double constantElevation)
Note that this method is relevant only if the algorithm specified
in setAlgorithm(AlgorithmId) is CONSTANT_ELEVATION_OVER_ELLIPSOID.
If it is called for another algorithm, the elevation set here will be ignored.
constantElevation - constant elevation to usesetAlgorithm(AlgorithmId),
getConstantElevation()public double getConstantElevation()
AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID.setConstantElevation(double)public int getMaxCachedTiles()
setDigitalElevationModel(TileUpdater, int),
getTileUpdater()public RuggedBuilder setTimeSpan(AbsoluteDate minDate, AbsoluteDate maxDate, double tStep, double overshootTolerance)
This method set only the time span and not the trajectory, therefore it
must be used together with either
setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
or setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)
but should not be mixed with setTrajectoryAndTimeSpan(InputStream).
minDate - start of search time spanmaxDate - end of search time spantStep - step to use for inertial frame to body frame transforms cache computationsovershootTolerance - tolerance in seconds allowed for minDate and maxDate overshootingsetTrajectoryAndTimeSpan(InputStream),
getMinDate(),
getMaxDate(),
getTStep(),
getOvershootTolerance()public AbsoluteDate getMinDate()
setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)public AbsoluteDate getMaxDate()
setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)public double getTStep()
setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)public double getOvershootTolerance()
getMinDate() and getMaxDate() overshooting.getMinDate() and getMaxDate() overshootingsetTimeSpan(AbsoluteDate, AbsoluteDate, double, double)public RuggedBuilder setTrajectory(InertialFrameId inertialFrame, List<TimeStampedPVCoordinates> positionsVelocities, int pvInterpolationNumber, CartesianDerivativesFilter pvFilter, List<TimeStampedAngularCoordinates> quaternions, int aInterpolationNumber, AngularDerivativesFilter aFilter) throws RuggedException
This method set only the trajectory and not the time span, therefore it
must be used together with the setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)
but should not be mixed with setTrajectoryAndTimeSpan(InputStream).
inertialFrame - inertial frame used for spacecraft positions/velocities/quaternionspositionsVelocities - satellite position and velocity (m and m/s in inertial frame)pvInterpolationNumber - number of points to use for position/velocity interpolationpvFilter - filter for derivatives from the sample to use in position/velocity interpolationquaternions - satellite quaternions with respect to inertial frameaInterpolationNumber - number of points to use for attitude interpolationaFilter - filter for derivatives from the sample to use in attitude interpolationRuggedException - if data needed for inertial frame cannot be loadedsetTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator),
setTrajectoryAndTimeSpan(InputStream),
getInertialFrame(),
getpositionsVelocities(),
getPVInterpolationNumber(),
getPVInterpolationNumber(),
getQuaternions(),
getAInterpolationNumber(),
getAFilter()public RuggedBuilder setTrajectory(Frame inertialFrame, List<TimeStampedPVCoordinates> positionsVelocities, int pvInterpolationNumber, CartesianDerivativesFilter pvFilter, List<TimeStampedAngularCoordinates> quaternions, int aInterpolationNumber, AngularDerivativesFilter aFilter)
This method set only the trajectory and not the time span, therefore it
must be used together with the setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)
but should not be mixed with setTrajectoryAndTimeSpan(InputStream).
inertialFrame - inertial frame used for spacecraft positions/velocities/quaternionspositionsVelocities - satellite position and velocity (m and m/s in inertial frame)pvInterpolationNumber - number of points to use for position/velocity interpolationpvFilter - filter for derivatives from the sample to use in position/velocity interpolationquaternions - satellite quaternions with respect to inertial frameaInterpolationNumber - number of points to use for attitude interpolationaFilter - filter for derivatives from the sample to use in attitude interpolationsetTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator),
setTrajectoryAndTimeSpan(InputStream),
getpositionsVelocities(),
getPVInterpolationNumber(),
getPVInterpolationNumber(),
getQuaternions(),
getAInterpolationNumber(),
getAFilter()public RuggedBuilder setTrajectory(double interpolationStep, int interpolationNumber, CartesianDerivativesFilter pvFilter, AngularDerivativesFilter aFilter, Propagator propagator)
This method set only the trajectory and not the time span, therefore it
must be used together with the setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)
but should not be mixed with setTrajectoryAndTimeSpan(InputStream).
interpolationStep - step to use for inertial/Earth/spacraft transforms interpolationsinterpolationNumber - number of points to use for inertial/Earth/spacraft transforms interpolationspvFilter - filter for derivatives from the sample to use in position/velocity interpolationaFilter - filter for derivatives from the sample to use in attitude interpolationpropagator - global propagatorsetTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectoryAndTimeSpan(InputStream)public Frame getInertialFrame()
public List<TimeStampedPVCoordinates> getpositionsVelocities()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public int getPVInterpolationNumber()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public CartesianDerivativesFilter getPVFilter()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public List<TimeStampedAngularCoordinates> getQuaternions()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public int getAInterpolationNumber()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public AngularDerivativesFilter getAFilter()
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator)public RuggedBuilder setTrajectoryAndTimeSpan(InputStream storageStream) throws RuggedException
This method set both the trajectory and the time span in a tightly coupled
way, therefore it should not be mixed with the individual methods
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator),
setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
or setTimeSpan(AbsoluteDate, AbsoluteDate, double, double).
storageStream - stream from where to read previous instance stored interpolator (caller opened it and remains responsible for closing it)RuggedException - if storage stream cannot be parsed
or if frames do not match the ones referenced in the storage streamsetTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator),
storeInterpolator(OutputStream)public void storeInterpolator(OutputStream storageStream) throws RuggedException
This method allows to reuse the interpolator built in one instance, to build
another instance by calling setTrajectoryAndTimeSpan(InputStream).
This reduces the builder initialization time as setting up the interpolator can be long, it is
mainly intended to be used when several runs are done (for example in an image processing chain)
with the same configuration.
This method must be called after both the ellipsoid and trajectory have been set.
storageStream - stream where to store the interpolator
(caller opened it and remains responsible for closing it)RuggedException - if interpolator cannot be written to streamsetEllipsoid(EllipsoidId, BodyRotatingFrameId),
setEllipsoid(OneAxisEllipsoid),
setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter),
setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator),
setTrajectoryAndTimeSpan(InputStream)public RuggedBuilder setLightTimeCorrection(boolean lightTimeCorrection)
This methods set the flag for compensating or not light time between
ground and spacecraft. Compensating this delay improves location
accuracy and is enabled by default (i.e. not calling this
method before building is therefore equivalent to calling it with
a parameter set to true). Not compensating it is mainly useful
for validation purposes against system that do not compensate it.
lightTimeCorrection - if true, the light travel time between ground
and spacecraft is compensated for more accurate locationsetAberrationOfLightCorrection(boolean),
getLightTimeCorrection()public boolean getLightTimeCorrection()
setLightTimeCorrection(boolean)public RuggedBuilder setAberrationOfLightCorrection(boolean aberrationOfLightCorrection)
This methods set the flag for compensating or not aberration of light,
which is velocity composition between light and spacecraft when the
light from ground points reaches the sensor.
Compensating this velocity composition improves location
accuracy and is enabled by default (i.e. not calling this
method before building is therefore equivalent to calling it with
a parameter set to true). Not compensating it is useful
in two cases: for validation purposes against system that do not
compensate it or when the pixels line of sight already include the
correction.
aberrationOfLightCorrection - if true, the aberration of light
is corrected for more accurate locationsetLightTimeCorrection(boolean),
getAberrationOfLightCorrection()public boolean getAberrationOfLightCorrection()
setAberrationOfLightCorrection(boolean)public RuggedBuilder addLineSensor(LineSensor lineSensor)
lineSensor - line sensor modelpublic RuggedBuilder clearLineSensors()
public List<LineSensor> getLineSensors()
public Rugged build() throws RuggedException
Rugged instance.RuggedException - if the builder is not properly configured
or if some internal elements cannot be built (frames, ephemerides, ...)Copyright © 2014–2016 CS Syst?mes d'Information. All rights reserved.