Isis Developer Reference
|
Obtain SPICE position information for a body. More...
#include <SpicePosition.h>
Public Types | |
enum | Source { Spice , Memcache , HermiteCache , PolyFunction , PolyFunctionOverHermiteConstant } |
This enum indicates the status of the object. More... | |
enum | PartialType { WRT_X , WRT_Y , WRT_Z } |
enum | OverrideType { NoOverrides , ScaleOnly , BaseAndScale } |
Public Member Functions | |
SpicePosition (int targetCode, int observerCode) | |
Construct an empty SpicePosition class using valid body codes. | |
virtual | ~SpicePosition () |
Destructor. | |
void | SetTimeBias (double timeBias) |
Apply a time bias when invoking SetEphemerisTime method. | |
double | GetTimeBias () const |
Returns the value of the time bias added to ET. | |
virtual void | SetAberrationCorrection (const QString &correction) |
Set the aberration correction (light time) | |
virtual QString | GetAberrationCorrection () const |
Returns current state of stellar aberration correction. | |
double | GetLightTime () const |
Return the light time coorection value. | |
virtual const std::vector< double > & | SetEphemerisTime (double et) |
Return J2000 coordinate at given time. | |
virtual double | EphemerisTime () const |
Return the current ephemeris time. | |
double | scaledTime () const |
Return the scaled time. | |
const std::vector< double > & | GetCenterCoordinate () |
Compute and return the coordinate at the center time. | |
virtual const std::vector< double > & | Coordinate () |
Return the current J2000 position. | |
const std::vector< double > & | Velocity () |
Return the current J2000 velocity. | |
bool | HasVelocity () |
Return the flag indicating whether the velocity exists. | |
void | LoadCache (double startTime, double endTime, int size) |
Cache J2000 position over a time range. | |
void | LoadCache (double time) |
Cache J2000 position for a time. | |
void | LoadCache (Table &table) |
Cache J2000 positions using a table file. | |
void | LoadCache (nlohmann::json &isd) |
Load the cached data from an ALE ISD. | |
Table | LineCache (const QString &tableName) |
Return a table with J2000 to reference positions. | |
Table | LoadHermiteCache (const QString &tableName) |
Cache J2000 position over existing cached time range using polynomials stored as Hermite cubic spline knots. | |
void | ReloadCache () |
Cache J2000 positions over existing cached time range using polynomials. | |
void | ReloadCache (Table &table) |
Cache J2000 position over existing cached time range using table. | |
Table | Cache (const QString &tableName) |
Return a table with J2000 positions. | |
bool | IsCached () const |
Is this position cached. | |
int | cacheSize () const |
Get the size of the current cached positions. | |
void | SetPolynomial (const Source type=PolyFunction) |
Set the coefficients of a polynomial fit to each of the components (X, Y, Z) of the position vector for the time period covered by the cache, component = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale. | |
void | SetPolynomial (const std::vector< double > &XC, const std::vector< double > &YC, const std::vector< double > &ZC, const Source type=PolyFunction) |
Set the coefficients of a polynomial (parabola) fit to each of the three coordinates of the position vector for the time period covered by the cache, coord = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale. | |
void | GetPolynomial (std::vector< double > &XC, std::vector< double > &YC, std::vector< double > &ZC) |
Return the coefficients of a polynomial fit to each of the three coordinates of the position for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_basetime) / p_timeScale. | |
void | SetPolynomialDegree (int degree) |
Set the polynomial degree. | |
Source | GetSource () |
Return the source of the position. | |
void | ComputeBaseTime () |
Compute the base time using cached times. | |
double | GetBaseTime () |
Return the base time for the position. | |
void | SetOverrideBaseTime (double baseTime, double timeScale) |
Set an override base time to be used with observations on scanners to allow all images in an observation to use the same base time and polynomials for the positions. | |
double | GetTimeScale () |
Return the time scale for the position. | |
double | DPolynomial (const int coeffIndex) |
Evaluate the derivative of the fit polynomial (parabola) defined by the given coefficients with respect to the coefficient at the given index, at the current time. | |
std::vector< double > | CoordinatePartial (SpicePosition::PartialType partialVar, int coeffIndex) |
Set the coefficients of a polynomial fit to each of the three coordinates of the position vector for the time period covered by the cache,. | |
std::vector< double > | VelocityPartial (SpicePosition::PartialType partialVar, int coeffIndex) |
Compute the derivative of the velocity with respect to the specified variable. | |
void | Memcache2HermiteCache (double tolerance) |
This method reduces the cache for position, time and velocity to the minimum number of values needed to interpolate the J2000 coordinates using a Hermite spline, given a tolerance of deviation from the NAIF values. | |
std::vector< double > | Extrapolate (double timeEt) |
Extrapolate position for a given time assuming a constant velocity. | |
std::vector< double > | HermiteCoordinate () |
This method returns the Hermite coordinate for the current time for PolyFunctionOverHermiteConstant functions. | |
Protected Member Functions | |
void | SetEphemerisTimeMemcache () |
This is a protected method that is called by SetEphemerisTime() when Source type is Memcache. | |
void | SetEphemerisTimeHermiteCache () |
This is a protected method that is called by SetEphemerisTime() when Source type is HermiteCache. | |
virtual void | SetEphemerisTimeSpice () |
This is a protected method that is called by SetEphemerisTime() when Source type is Spice. | |
void | SetEphemerisTimePolyFunction () |
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunction. | |
void | SetEphemerisTimePolyFunctionOverHermiteConstant () |
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunctionOverHermiteConstant. | |
SpicePosition (int targetCode, int observerCode, bool swapObserverTarget) | |
Constructor for swapping observer/target order. | |
int | getObserverCode () const |
Returns observer code. | |
int | getTargetCode () const |
Returns target code. | |
double | getAdjustedEphemerisTime () const |
Returns adjusted ephemeris time. | |
void | computeStateVector (double et, int target, int observer, const QString &refFrame, const QString &abcorr, double state[6], bool &hasVelocity, double &lightTime) const |
Computes the state vector of the target w.r.t observer. | |
void | setStateVector (const double state[6], const bool &hasVelocity) |
Sets the state of target relative to observer. | |
void | setLightTime (const double &lightTime) |
Inheritors can set the light time if indicated. | |
Friends | |
class | ::IsisIlluminator_Velocity_Test |
Obtain SPICE position information for a body.
This class will obtain the J2000 body position between a target and observer body. For example, a spacecraft and Mars or the Sun and Mars. It is essentially a C++ wrapper to the NAIF spkez_c routine. Therefore, appropriate NAIF kernels are expected to be loaded prior to using this class. The position can be returned with or without one way light time corrections between the two bodies. See NAIF required reading for more information regarding this subject at ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/spk.req
An important functionality of this class is the ability to cache the positions so they do not have to be constantly read from the NAIF kernels. Onced the data is cached the NAIF kernels can be unloaded too.
This enum indicates the status of the object.
The class expects functions to be after MemCache in the list.
Isis::SpicePosition::SpicePosition | ( | int | targetCode, |
int | observerCode ) |
Construct an empty SpicePosition class using valid body codes.
See required reading ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/naif_ids.req
targetCode | Valid naif body name. |
observerCode | Valid naif body name. |
|
virtual |
Destructor.
Free the memory allocated by this SpicePosition instance.
|
protected |
Constructor for swapping observer/target order.
This specialized constructor is provided to expressly support swap of observer/target order in the NAIF spkez_c/spkezp_c routines when determining the state of spacecraft and target body.
Traditionally, ISIS (and ISIS2!) has had the target/observer order swapped improperly to determine state vector between the two bodies. This constructor provides a transaitional path to correct this in a controlled way. See SpacecraftPosition for details.
Note that the targetCode and observerCode are always provided in the same order as the orignal constructor (i.e., targetCode=s/c, observerCode=planet) as the swapObserverTarget boolean parameter provides the means to properly implement the swap internally.
It is not as simple as simply swapping the codes in the constructor as internal representation of the state vector is in body fixed state of the target body relative to observer. If the swap is invoked, the state vector must be inverted.
targetCode | Traditional s/c code |
observerCode | Traditional target/planet code |
swapObserverTarget | True indicates implement the observer/target swap, false will invoke preexisting behavior |
Table Isis::SpicePosition::Cache | ( | const QString & | tableName | ) |
Return a table with J2000 positions.
Return a table containg the cached coordinates with the given name. The table will have four or seven columns, J2000 x,y,z (optionally vx,vy,vx) and the ephemeris time.
tableName | Name of the table to create and return |
References _FILEINFO_, Isis::TableField::Double, Isis::IException::Io, LineCache(), Memcache2HermiteCache(), PolyFunction, and PolyFunctionOverHermiteConstant.
Referenced by LineCache(), and LoadHermiteCache().
|
inline |
Get the size of the current cached positions.
Referenced by Isis::Spice::createCache().
void Isis::SpicePosition::ComputeBaseTime | ( | ) |
Compute the base time using cached times.
References NoOverrides, and ScaleOnly.
Referenced by SetPolynomial(), and SetPolynomial().
|
protected |
Computes the state vector of the target w.r.t observer.
This method computes the state vector of the target that is relative of the observer. It first attempts to retrieve with velocity vectors. If that fails, it makes an additional attempt to get the state w/o velocity vectors. The final result is indicated by the hasVelocity parameter.
The parameters to this routine are the same as the NAIF spkez_c/spkezp_c routines. See http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkez_c.html for complete description.
Note that this routine does not actually affect the internals of this object (hence the constness of the method). It is up to the caller to apply the results and potentially handle swapping of observer/target and light time correction. See SpacecraftPosition for additional details on this application of the results.
et | Time to compute state vector for |
target | NAIF target code |
observer | NAIF observer code |
refFrame | Reference frame to express coordinates in (e.g., J2000) |
abcorr | Stellar aberration correction option |
state | Returns the 6-element state vector in target body fixed coordinates |
hasVelocity | Returns knowledge of whether the velocity vector is valid |
lightTime | Returns the light time correct resulting from the request if applicable |
References Isis::NaifStatus::CheckErrors().
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
|
inlinevirtual |
Return the current J2000 position.
Referenced by Isis::Spice::computeSolarLongitude(), GetCenterCoordinate(), Isis::Spice::instrumentBodyFixedPosition(), Isis::Spice::instrumentBodyFixedVelocity(), Isis::IsisIlluminator::position(), Isis::Spice::setTime(), Isis::Spice::subSpacecraftPoint(), Isis::Spice::sunToBodyDist(), and Isis::Spice::targetCenterDistance().
std::vector< double > Isis::SpicePosition::CoordinatePartial | ( | SpicePosition::PartialType | partialVar, |
int | coeffIndex ) |
Set the coefficients of a polynomial fit to each of the three coordinates of the position vector for the time period covered by the cache,.
coordinate = c0 + c1*t + c2*t**2 + ... cn*t**n, where t = (time - p_basetime) / p_timeScale.
partialVar | Designated variable of the partial derivative |
References DPolynomial().
double Isis::SpicePosition::DPolynomial | ( | const int | coeffIndex | ) |
Evaluate the derivative of the fit polynomial (parabola) defined by the given coefficients with respect to the coefficient at the given index, at the current time.
coeffIndex | Index of coefficient to differentiate with respect to |
References _FILEINFO_, Isis::IException::Programmer, and Isis::toString().
Referenced by CoordinatePartial().
|
inlinevirtual |
Return the current ephemeris time.
Referenced by getAdjustedEphemerisTime(), Isis::IsisIlluminator::position(), and Isis::IsisIlluminator::velocity().
std::vector< double > Isis::SpicePosition::Extrapolate | ( | double | timeEt | ) |
Extrapolate position for a given time assuming a constant velocity.
The position and velocity at the current time will be used to extrapolate position at the input time. If velocity does not exist, the value at the current time will be output. The caller must make sure to call SetEphemerisTime to set the time to the time to be used for the extrapolation.
[in] | timeEt | The time of the position to be extrapolated |
[out] | An | extrapolated position at the input time |
|
virtual |
Returns current state of stellar aberration correction.
The aberration correction is the value of the parameter that will be provided to the spkez_c/spkezp_c routines when determining the targer/observer vector state. See SetAberrationCorrection() for valid values.
Reimplemented in Isis::SpacecraftPosition.
Referenced by SetEphemerisTimeSpice().
|
protected |
Returns adjusted ephemeris time.
This method returns the actual ephemeris time adjusted by a specifed time bias. The bias typically comes explicitly from the camera model but could be adjusted by the environment they are utlized in.
References EphemerisTime(), and GetTimeBias().
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
|
inline |
Return the base time for the position.
Referenced by Isis::IsisBundleObservation::initializeExteriorOrientation().
const std::vector< double > & Isis::SpicePosition::GetCenterCoordinate | ( | ) |
Compute and return the coordinate at the center time.
References Coordinate(), and SetEphemerisTime().
Referenced by Isis::IsisBundleObservation::bundleOutputFetchData().
double Isis::SpicePosition::GetLightTime | ( | ) | const |
Return the light time coorection value.
This method returns the light time correction of the last call to SetEphemerisTimeSpice. This is the actual time after adjustments that has resulting int the adjustment of the target body. The observer position should be unchanged.
|
protected |
Returns observer code.
This methods returns the proper observer code as specified in constructor. Code has been subjected to swapping if requested.
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
void Isis::SpicePosition::GetPolynomial | ( | std::vector< double > & | XC, |
std::vector< double > & | YC, | ||
std::vector< double > & | ZC ) |
Return the coefficients of a polynomial fit to each of the three coordinates of the position for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_basetime) / p_timeScale.
[out] | XC | Coefficients of fit to first coordinate of position |
[out] | YC | Coefficients of fit to second coordinate of position |
[out] | ZC | Coefficients of fit to third coordinate of position |
Referenced by Isis::IsisBundleObservation::applyParameterCorrections(), Isis::IsisBundleObservation::bundleOutputFetchData(), and Isis::IsisBundleObservation::initializeExteriorOrientation().
|
inline |
Return the source of the position.
Referenced by Isis::Spice::createCache().
|
protected |
Returns target code.
This methods returns the proper target code as specified in constructor. Code has been subjected to swapping if requested.
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
double Isis::SpicePosition::GetTimeBias | ( | ) | const |
Returns the value of the time bias added to ET.
Referenced by getAdjustedEphemerisTime().
|
inline |
Return the time scale for the position.
Referenced by Isis::IsisBundleObservation::initializeExteriorOrientation().
|
inline |
Return the flag indicating whether the velocity exists.
Referenced by Isis::Spice::createCache().
std::vector< double > Isis::SpicePosition::HermiteCoordinate | ( | ) |
This method returns the Hermite coordinate for the current time for PolyFunctionOverHermiteConstant functions.
References _FILEINFO_, PolyFunctionOverHermiteConstant, Isis::IException::Programmer, and SetEphemerisTimeHermiteCache().
|
inline |
Is this position cached.
Referenced by Isis::Spice::createCache().
Table Isis::SpicePosition::LineCache | ( | const QString & | tableName | ) |
Return a table with J2000 to reference positions.
Return a table containing the cached positions with the given name. The table will have seven columns, positionX, positionY, positionZ, angular velocity X, angular velocity Y, angular velocity Z, and time of J2000 position.
tableName | Name of the table to create and return |
References _FILEINFO_, Cache(), HermiteCache, Memcache, Isis::IException::Programmer, and ReloadCache().
Referenced by Cache().
void Isis::SpicePosition::LoadCache | ( | double | startTime, |
double | endTime, | ||
int | size ) |
Cache J2000 position over a time range.
This method will load an internal cache with coordinates over a time range. This prevents the NAIF kernels from being read over-and-over again and slowing a application down due to I/O performance. Once the cache has been loaded then the kernels can be unloaded from the NAIF system.
startTime | Starting ephemeris time in seconds for the cache |
endTime | Ending ephemeris time in seconds for the cache |
size | Number of coordinates/positions to keep in the cache |
References _FILEINFO_, HermiteCache, Memcache, Isis::IException::Programmer, and SetEphemerisTime().
Referenced by Isis::Spice::createCache(), LoadCache(), and ReloadCache().
void Isis::SpicePosition::LoadCache | ( | double | time | ) |
Cache J2000 position for a time.
This method will load an internal cache with coordinates for a single time (e.g. useful for framing cameras). This prevents the NAIF kernels from being read over-and-over again and slowing a application down due to I/O performance. Once the cache has been loaded then the kernels can be unloaded from the NAIF system. This calls the LoadCache(stime,etime,size) method using the time as both the starting and ending time with a size of 1.
time | single ephemeris time in seconds to cache |
References LoadCache().
void Isis::SpicePosition::LoadCache | ( | nlohmann::json & | isd | ) |
Load the cached data from an ALE ISD.
The SpicePosition object must be set to a SPICE source before loading the cache.
isdPos | The ALE ISD as a JSON object. |
References _FILEINFO_, Memcache, Isis::IException::Programmer, and SetEphemerisTime().
void Isis::SpicePosition::LoadCache | ( | Table & | table | ) |
Cache J2000 positions using a table file.
This method will load an internal cache with coordinates from an ISIS table file. The table must have 4 columns, or 7 (if velocity) is included, and at least one row. The 4 columns contain the following information, body position x,y,z in J2000 and the ephemeris time of that position. If there are multiple rows it is assumed you can interpolate position at times in between the rows.
table | An ISIS table blob containing valid J2000 coordinate/time values |
References _FILEINFO_, Isis::PvlObject::findKeyword(), Isis::PvlObject::hasKeyword(), HermiteCache, Isis::IException::Io, Isis::Table::Label(), Memcache, Isis::Table::Name(), PolyFunction, Isis::IException::Programmer, Isis::Table::Records(), ScaleOnly, SetOverrideBaseTime(), SetPolynomial(), SetPolynomialDegree(), and Isis::toDouble().
Table Isis::SpicePosition::LoadHermiteCache | ( | const QString & | tableName | ) |
Cache J2000 position over existing cached time range using polynomials stored as Hermite cubic spline knots.
This method will reload an internal cache with positions formed from a cubic Hermite spline over a time range. The method assumes a polynomial function has been fit to the coordinates of the positions and calculates the spline from the polynomial function.
References _FILEINFO_, Cache(), HermiteCache, PolyFunction, Isis::IException::Programmer, and SetEphemerisTime().
void Isis::SpicePosition::Memcache2HermiteCache | ( | double | tolerance | ) |
This method reduces the cache for position, time and velocity to the minimum number of values needed to interpolate the J2000 coordinates using a Hermite spline, given a tolerance of deviation from the NAIF values.
tolerance | Maximum error allowed between NAIF kernel coordinate values and values interpolated by the Hermite spline. |
References _FILEINFO_, HermiteCache, Memcache, and Isis::IException::Programmer.
Referenced by Cache(), and Isis::Spice::createCache().
void Isis::SpicePosition::ReloadCache | ( | ) |
Cache J2000 positions over existing cached time range using polynomials.
This method will reload an internal cache with positions calculated from functions fit to the coordinates of the position over a time range.
References _FILEINFO_, Isis::NaifStatus::CheckErrors(), HermiteCache, Memcache, Isis::IException::Programmer, and SetEphemerisTime().
Referenced by LineCache().
void Isis::SpicePosition::ReloadCache | ( | Table & | table | ) |
Cache J2000 position over existing cached time range using table.
This method will reload an internal cache with positions formed from coordinates in a table
table | An ISIS table blob containing valid J2000 coordinate/time values. |
References LoadCache(), and Spice.
double Isis::SpicePosition::scaledTime | ( | ) | const |
Return the scaled time.
|
virtual |
Set the aberration correction (light time)
See NAIF required reading for more information on this correction at ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/spk.req
correction | This value must be one of the following: "NONE", "LT", "LT+S", "CN", "CN+S", "XLT", "XLT+S", "XCN" and "XCN+S" where LT is a correction for planetary aberration (light time), CN is converged Newtonian, XLT is transmission case using Newtonian formulation, XCN is transmission case using converged Newtonian formuation and S a correction for stellar aberration. See http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkezr_c.html for additional information on the "abcorr" parameters. If never called the default is "LT+S". |
Reimplemented in Isis::SpacecraftPosition.
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::SpacecraftPosition::SetAberrationCorrection().
|
virtual |
Return J2000 coordinate at given time.
This method returns the J2000 coordinates (x,y,z) of the body at a given et in seconds. The coordinates are obtained from either a valid NAIF spk kernel, or alternatively from an internal cache loaded from an ISIS Table object. In the first case, the SPK kernel must contain positions for the body code specified in the constructor at the given time and it must be loaded using the SpiceKernel class.
et | ephemeris time in seconds |
References Isis::NaifStatus::CheckErrors(), HermiteCache, Memcache, PolyFunction, PolyFunctionOverHermiteConstant, SetEphemerisTimeHermiteCache(), SetEphemerisTimeMemcache(), SetEphemerisTimePolyFunction(), SetEphemerisTimePolyFunctionOverHermiteConstant(), and SetEphemerisTimeSpice().
Referenced by Isis::Spice::computeSolarLongitude(), GetCenterCoordinate(), LoadCache(), LoadCache(), LoadHermiteCache(), Isis::IsisIlluminator::position(), ReloadCache(), SetPolynomial(), SetPolynomial(), Isis::Spice::setTime(), and Isis::IsisIlluminator::velocity().
|
protected |
This is a protected method that is called by SetEphemerisTime() when Source type is HermiteCache.
It calculates J2000 coordinates (x,y,z) of the body that correspond to a given et in seconds. These coordinates are obtained by using a Hermite spline to interpolate values from an internal reduced cache loaded from an ISIS Table object.
References _FILEINFO_, and Isis::IException::Io.
Referenced by HermiteCoordinate(), SetEphemerisTime(), and SetEphemerisTimePolyFunctionOverHermiteConstant().
|
protected |
This is a protected method that is called by SetEphemerisTime() when Source type is Memcache.
It calculates J2000 coordinates (x,y,z) of the body that correspond to a given et in seconds. These coordinates are obtained from an internal cache loaded from an ISIS Table object.
Referenced by SetEphemerisTime().
|
protected |
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunction.
It calculates J2000 coordinates (x,y,z) of the body that correspond to a given et in seconds. These coordinates are obtained by using an nth degree polynomial function fit to each coordinate of the position vector.
References WRT_X, WRT_Y, and WRT_Z.
Referenced by SetEphemerisTime(), and SetEphemerisTimePolyFunctionOverHermiteConstant().
|
protected |
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunctionOverHermiteConstant.
It calculates J2000 coordinates (x,y,z) of the body that correspond to a given et in seconds. These coordinates are obtained by adding a constant cubic Hermite spline added to an nth degree polynomial function fit to each coordinate of the position vector.
References SetEphemerisTimeHermiteCache(), and SetEphemerisTimePolyFunction().
Referenced by SetEphemerisTime().
|
protectedvirtual |
This is a protected method that is called by SetEphemerisTime() when Source type is Spice.
It calculates J2000 coordinates (x,y,z) of the body that correspond to a given et in seconds. The coordinates are obtained from a valid NAIF spk kernel. The SPK kernel must contain positions for the body code specified in the constructor at the given time and it must be loaded using the SpiceKernel class.
Reimplemented in Isis::SpacecraftPosition.
References computeStateVector(), GetAberrationCorrection(), getAdjustedEphemerisTime(), getObserverCode(), getTargetCode(), setLightTime(), and setStateVector().
Referenced by SetEphemerisTime(), and Isis::SpacecraftPosition::SetEphemerisTimeSpice().
|
protected |
Inheritors can set the light time if indicated.
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
void Isis::SpicePosition::SetOverrideBaseTime | ( | double | baseTime, |
double | timeScale ) |
Set an override base time to be used with observations on scanners to allow all images in an observation to use the same base time and polynomials for the positions.
[in] | baseTime | The baseTime to use and override the computed base time |
References BaseAndScale.
Referenced by Isis::IsisBundleObservation::initializeExteriorOrientation(), and LoadCache().
void Isis::SpicePosition::SetPolynomial | ( | const Source | type = PolyFunction | ) |
Set the coefficients of a polynomial fit to each of the components (X, Y, Z) of the position vector for the time period covered by the cache, component = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale.
References ComputeBaseTime(), PolyFunction, PolyFunctionOverHermiteConstant, SetEphemerisTime(), and SetPolynomial().
Referenced by Isis::IsisBundleObservation::initializeExteriorOrientation(), LoadCache(), SetPolynomial(), and SetPolynomialDegree().
void Isis::SpicePosition::SetPolynomial | ( | const std::vector< double > & | XC, |
const std::vector< double > & | YC, | ||
const std::vector< double > & | ZC, | ||
const Source | type = PolyFunction ) |
Set the coefficients of a polynomial (parabola) fit to each of the three coordinates of the position vector for the time period covered by the cache, coord = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale.
[in] | XC | Coefficients of fit to X coordinate |
[in] | YC | Coefficients of fit to Y coordinate |
[in] | ZC | Coefficients of fit to Z coordinate |
References ComputeBaseTime(), and SetEphemerisTime().
void Isis::SpicePosition::SetPolynomialDegree | ( | int | degree | ) |
Set the polynomial degree.
Set the degree of the polynomials to be fit to the three position coordinates for the time period covered by the cache, coordinate = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale, and n = p_degree.
[in] | degree | Degree of the polynomial to be fit |
References SetPolynomial().
Referenced by Isis::IsisBundleObservation::initializeExteriorOrientation(), and LoadCache().
|
protected |
Sets the state of target relative to observer.
This method sets the state of the target (vector) relative to the observer. Note that is the only place where the swap of observer/target adjustment to the state vector is handled. All contributors to this computation must compute the state vector representing the position and velocity of the target relative to the observer where the first three components of state[] are the x-, y- and z-component cartesian coordinates of the target's position; the last three are the corresponding velocity vector.
This routine maintains the directional integrity of the state vector should the observer/target be swapped. See the documentation for the spkez_c at http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkez_c.html.
state | State vector. First three components of this 6 element array is the body fixed coordinates of the vector from the target to the observer. The last three components are the velocity state. |
hasVelocity | If true, then the velocity components of the state vector are valid, otherwise they should be ignored. |
Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice(), and SetEphemerisTimeSpice().
void Isis::SpicePosition::SetTimeBias | ( | double | timeBias | ) |
Apply a time bias when invoking SetEphemerisTime method.
The bias is used only when reading from NAIF kernels. It is added to the ephermeris time passed into SetEphemerisTime and then the body position is read from the NAIF kernels and returned. When the cache is loaded from a table the bias is ignored as it is assumed to have already been applied. If this method is never called the default bias is 0.0 seconds.
timeBias | time bias in seconds |
const std::vector< double > & Isis::SpicePosition::Velocity | ( | ) |
Return the current J2000 velocity.
Return the velocity vector if available.
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::Spice::computeSolarLongitude(), Isis::Spice::instrumentBodyFixedVelocity(), and Isis::IsisIlluminator::velocity().
std::vector< double > Isis::SpicePosition::VelocityPartial | ( | SpicePosition::PartialType | partialVar, |
int | coeffIndex ) |
Compute the derivative of the velocity with respect to the specified variable.
The velocity is the derivative of the coordinate with respect to time.
coordinate = C0 + C1*t + C2*t**2 + ... +Cn*t**n , where t = (time - p_basetime) / p_timeScale. velocity = (1/p_timeScale) * (C1 + 2*C2*t + ... + n*Cn*t**(n-1)) partial(velocity) with respect to C0 = 0. partial(velocity) with respect to C1 = 1/p_timeScale. partial(velocity) with respect to C2 = 2*t/p_timeScale partial(velocity) with respect to CN = n*t**(n-1)/p_timeScale
partialVar | Designated variable of the partial derivative |
|
friend |