1 #ifndef SpicePosition_h 2 #define SpicePosition_h 36 class NumericalApproximation;
226 const std::vector<double> &
Velocity();
230 return p_hasVelocity;
233 void LoadCache(
double startTime,
double endTime,
int size);
247 return (p_cache.size() > 0);
253 const std::vector<double>& YC,
254 const std::vector<double>& ZC,
258 std::vector<double>& YC,
259 std::vector<double>& ZC);
299 std::vector<int>
HermiteIndices(
double tol, std::vector <int> indexList);
303 SpicePosition(
int targetCode,
int observerCode,
bool swapObserverTarget);
308 const QString &refFrame,
309 const QString &abcorr,
310 double state[6],
bool &hasVelocity,
311 double &lightTime)
const;
312 void setStateVector(
const double state[6],
const bool &hasVelocity);
317 void init(
int targetCode,
int observerCode,
318 const bool &swapObserverTarget =
false);
320 void LoadTimeCache();
321 void CacheLabel(
Table &table);
328 QString p_aberrationCorrection;
331 std::vector<double> p_coordinate;
332 std::vector<double> p_velocity;
342 std::vector<double> p_cacheTime;
343 std::vector<std::vector<double> > p_cache;
344 std::vector<std::vector<double> > p_cacheVelocity;
345 std::vector<double> p_coefficients[3];
349 bool p_degreeApplied;
353 double p_fullCacheStartTime;
354 double p_fullCacheEndTime;
355 double p_fullCacheSize;
358 double p_overrideBaseTime;
359 double p_overrideTimeScale;
362 bool m_swapObserverTarget;
int getObserverCode() const
Returns observer code.
Definition: SpicePosition.cpp:1812
Definition: SpicePosition.h:288
Object is reading from splined table.
Definition: SpicePosition.h:192
const std::vector< double > & GetCenterCoordinate()
Compute and return the coordinate at the center time.
Definition: SpicePosition.cpp:1723
double GetLightTime() const
Return the light time coorection value.
Definition: SpicePosition.cpp:223
virtual ~SpicePosition()
Destructor.
Definition: SpicePosition.cpp:126
Object is calculated from nth degree polynomial.
Definition: SpicePosition.h:193
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Definition: SpicePosition.cpp:179
std::vector< double > Extrapolate(double timeEt)
Extrapolate position for a given time assuming a constant velocity.
Definition: SpicePosition.cpp:1763
Definition: SpicePosition.h:211
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Definition: SpicePosition.cpp:143
Object is reading from cached table.
Definition: SpicePosition.h:191
double EphemerisTime() const
Return the current ephemeris time.
Definition: SpicePosition.h:214
int getTargetCode() const
Returns target code.
Definition: SpicePosition.cpp:1826
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 ...
Definition: SpicePosition.cpp:1091
Definition: SpicePosition.h:288
void ComputeBaseTime()
Compute the base time using cached times.
Definition: SpicePosition.cpp:1040
NumericalApproximation provides various numerical analysis methods of interpolation, extrapolation and approximation of a tabulated set of x, y data.
Definition: NumericalApproximation.h:720
void SetEphemerisTimePolyFunctionOverHermiteConstant()
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunctionOverH...
Definition: SpicePosition.cpp:1418
void LoadCache(double startTime, double endTime, int size)
Cache J2000 position over a time range.
Definition: SpicePosition.cpp:287
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.
Definition: SpicePosition.cpp:1879
bool IsCached() const
Is this position cached.
Definition: SpicePosition.h:246
void ReloadCache()
Cache J2000 positions over existing cached time range using polynomials.
Definition: SpicePosition.cpp:660
OverrideType
Definition: SpicePosition.h:288
Table Cache(const QString &tableName)
Return a table with J2000 positions.
Definition: SpicePosition.cpp:479
void SetEphemerisTimePolyFunction()
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunction...
Definition: SpicePosition.cpp:1369
Source GetSource()
Return the source of the position.
Definition: SpicePosition.h:265
Object is reading from splined.
Definition: SpicePosition.h:194
virtual QString GetAberrationCorrection() const
Returns current state of stellar aberration correction.
Definition: SpicePosition.cpp:206
double getAdjustedEphemerisTime() const
Returns adjusted ephemeris time.
Definition: SpicePosition.cpp:1842
bool HasVelocity()
Return the flag indicating whether the velocity exists.
Definition: SpicePosition.h:229
Definition: SpicePosition.h:288
PartialType
Definition: SpicePosition.h:211
void setStateVector(const double state[6], const bool &hasVelocity)
Sets the state of target relative to observer.
Definition: SpicePosition.cpp:1931
const std::vector< double > & Coordinate()
Return the current J2000 position.
Definition: SpicePosition.h:221
void SetPolynomialDegree(int degree)
Set the polynomial degree.
Definition: SpicePosition.cpp:1640
void SetOverrideBaseTime(double baseTime, double timeScale)
Set an override base time to be used with observations on scanners to allow all images in an observat...
Definition: SpicePosition.cpp:1071
std::vector< int > HermiteIndices(double tol, std::vector< int > indexList)
This method is called by Memcache2HermiteCache() to determine which indices from the orginal cache sh...
Definition: SpicePosition.cpp:1540
void SetEphemerisTimeHermiteCache()
This is a protected method that is called by SetEphemerisTime() when Source type is HermiteCache...
Definition: SpicePosition.cpp:1281
Definition: SpicePosition.h:211
void Memcache2HermiteCache(double tolerance)
This method reduces the cache for position, time and velocity to the minimum number of values needed ...
Definition: SpicePosition.cpp:1480
double DPolynomial(const int coeffIndex)
Evaluate the derivative of the fit polynomial (parabola) defined by the given coefficients with respe...
Definition: SpicePosition.cpp:1168
void SetEphemerisTimeMemcache()
This is a protected method that is called by SetEphemerisTime() when Source type is Memcache...
Definition: SpicePosition.cpp:1218
Class for storing Table blobs information.
Definition: Table.h:77
double GetTimeScale()
Return the time scale for the position.
Definition: SpicePosition.h:279
std::vector< double > VelocityPartial(SpicePosition::PartialType partialVar, int coeffIndex)
Compute the derivative of the velocity with respect to the specified variable.
Definition: SpicePosition.cpp:1132
Obtain SPICE position information for a body.
Definition: SpicePosition.h:183
const std::vector< double > & Velocity()
Return the current J2000 velocity.
Definition: SpicePosition.cpp:1193
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Table LineCache(const QString &tableName)
Return a table with J2000 to reference positions.
Definition: SpicePosition.cpp:635
void setLightTime(const double &lightTime)
Inheritors can set the light time if indicated.
Definition: SpicePosition.cpp:1961
double GetBaseTime()
Return the base time for the position.
Definition: SpicePosition.h:272
Table LoadHermiteCache(const QString &tableName)
Cache J2000 position over existing cached time range using polynomials stored as Hermite cubic spline...
Definition: SpicePosition.cpp:720
const std::vector< double > & SetEphemerisTime(double et)
Return J2000 coordinate at given time.
Definition: SpicePosition.cpp:242
Definition: SpicePosition.h:211
std::vector< double > HermiteCoordinate()
This method returns the Hermite coordinate for the current time for PolyFunctionOverHermiteConstant f...
Definition: SpicePosition.cpp:1783
SpicePosition(int targetCode, int observerCode)
Construct an empty SpicePosition class using valid body codes.
Definition: SpicePosition.cpp:29
Object is reading directly from the kernels.
Definition: SpicePosition.h:190
virtual void SetEphemerisTimeSpice()
This is a protected method that is called by SetEphemerisTime() when Source type is Spice...
Definition: SpicePosition.cpp:1449
double GetTimeBias() const
Returns the value of the time bias added to ET.
Definition: SpicePosition.cpp:154
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 ...
Definition: SpicePosition.cpp:1027
Source
This enum indicates the status of the object.
Definition: SpicePosition.h:190
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 f...
Definition: SpicePosition.cpp:855