public static class MroObservation.Builder
extends java.lang.Object
To use the builder, instantiate it with an orbital data model, optionally
set a label and/or comment, and invoke the build()
method. For
example, to create a new observation of a Target
called
aramChaos on orbit 13203, use the following code:
OrbitalData orbitalData = MroObservation.OrbitalData.findData ( aramChaos, 13203 ); MroObservation observation = new MroObservation.Builder ( orbitalData ).label ("ESP_013203_1825").comment ("Stereo-1 of Aram Chaos").build ();
Alternatively, if the ephemeris time and roll angle are already known via another source, the builder may be instantiated with the target, orbit, ephemeris time, and roll angle directly. For example, the same observation may be obtained with the following code:
MroObservation observation = new MroObservation.Builder ( aramChaos, Orbit.valueOf ("13203a"), 296161196.352, Math.toRadians (-23.653) ).label ("ESP_013203_1825").comment ("Stereo-1 of Aram Chaos").build ();
Note that the builder (and the resultant observation) assume the roll angle is in radians.
The NAIF ID
of the target's body
must be 499 (Mars). If not, an IllegalArgumentException
will be thrown.
The resultant observation's Observer
will be the shared MRO
instance, which represents the MRO spacecraft in the IAU
Mars body-fixed reference frame.
It is assumed that all necessary SPICE kernels are loaded into the SPICE
kernel pool when the observation is constructed; if not, a SpiceException
will be thrown.
Constructor and Description |
---|
Builder(MroObservation.OrbitalData orbitalData)
Creates a new MRO observation builder with the indicated orbital data model.
|
Builder(Target target,
MroObservation.Orbit orbit,
double et,
double rollAngle)
Creates a new MRO observation builder with the indicated target, ephemeris
time, and roll angle.
|
Modifier and Type | Method and Description |
---|---|
MroObservation |
build()
Instantiates a new, immutable MRO observation from this builder.
|
MroObservation.Builder |
comment(java.lang.String comment)
Sets the optional comment for this builder.
|
MroObservation.Builder |
label(java.lang.String label)
Sets the optional label for this builder.
|
public Builder(Target target, MroObservation.Orbit orbit, double et, double rollAngle)
NAIF ID
of the target's
body
must be 499, the NAIF ID code
for Mars; if not, a IllegalArgumentException
will be thrown.
The builder's observer is set to the shared MRO
instance,
which represents the MRO spacecraft in the IAU Mars body-fixed reference
frame.
target
- the target of the observation, which must be of Mars.orbit
- the observation's orbit.et
- the ephemeris time of the observation.rollAngle
- the roll angle in radians.java.lang.NullPointerException
- if the target or orbit is null.java.lang.IllegalArgumentException
- if the target body is not Mars.public Builder(MroObservation.OrbitalData orbitalData)
NAIF ID
of the target's body
must be 499, the NAIF ID code for Mars; if not, a
IllegalArgumentException
will be thrown.
The builder's observer is set to the shared MRO
instance,
which represents the MRO spacecraft in the IAU Mars body-fixed reference
frame.
orbitalData
- the orbital data model.java.lang.NullPointerException
- if the orbital data model is null.java.lang.IllegalArgumentException
- if the orbital data target body is not
Mars.public MroObservation.Builder label(java.lang.String label)
build()
method is invoked.label
- the observation's optional label.public MroObservation.Builder comment(java.lang.String comment)
build()
method is invoked.comment
- the observation's optional comment.public MroObservation build()
The observation's observer is set to the shared MRO
instance, which represents the MRO spacecraft in the IAU Mars body-fixed
reference frame.
edu.asu.jmars.layer.obs.mro.SpiceException
- if the SPICE kernel pool lacks the kernels needed
to compute the observation's parameters.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona