|
Isis Developer Reference
|
Go to the documentation of this file. 1 #ifndef SpicePosition_h
2 #define SpicePosition_h
20 #include "ale/States.h"
22 #include <nlohmann/json.hpp>
25 class NumericalApproximation;
216 const std::vector<double> &
Velocity();
220 return p_hasVelocity;
223 void LoadCache(
double startTime,
double endTime,
int size);
238 return (m_state != NULL);
244 return m_state->getStates().size();
252 const std::vector<double>& YC,
253 const std::vector<double>& ZC,
257 std::vector<double>& YC,
258 std::vector<double>& ZC);
300 SpicePosition(
int targetCode,
int observerCode,
bool swapObserverTarget);
305 const QString &refFrame,
306 const QString &abcorr,
307 double state[6],
bool &hasVelocity,
308 double &lightTime)
const;
309 void setStateVector(
const double state[6],
const bool &hasVelocity);
314 void init(
int targetCode,
int observerCode,
315 const bool &swapObserverTarget =
false);
317 void LoadTimeCache();
318 void CacheLabel(
Table &table);
325 QString p_aberrationCorrection;
328 std::vector<double> p_coordinate;
329 std::vector<double> p_velocity;
332 std::vector<double> p_cacheTime;
333 std::vector<double> p_coefficients[3];
337 bool p_degreeApplied;
341 double p_fullCacheStartTime;
342 double p_fullCacheEndTime;
343 double p_fullCacheSize;
346 double p_overrideBaseTime;
347 double p_overrideTimeScale;
350 bool m_swapObserverTarget;
353 ale::States *m_state;
PartialType
Definition: SpicePosition.h:201
@ HermiteCache
Object is reading from splined table.
Definition: SpicePosition.h:182
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:1103
Obtain SPICE position information for a body.
Definition: SpicePosition.h:173
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
void SetEphemerisTimePolyFunction()
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunction.
Definition: SpicePosition.cpp:1355
@ BaseAndScale
Definition: SpicePosition.h:287
int Solve(Isis::LeastSquares::SolveMethod method=SVD)
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
Definition: LeastSquares.cpp:205
virtual void SetEphemerisTimeSpice()
This is a protected method that is called by SetEphemerisTime() when Source type is Spice.
Definition: SpicePosition.cpp:1432
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:1742
virtual QString GetAberrationCorrection() const
Returns current state of stellar aberration correction.
Definition: SpicePosition.cpp:213
double Intercept()
Compute the intercept of the line.
Definition: LineEquation.cpp:87
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Definition: SpicePosition.cpp:186
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:930
virtual ~SpicePosition()
Destructor.
Definition: SpicePosition.cpp:133
void SetCoefficients(const std::vector< double > &coefs)
Set the coefficients for the equation.
Definition: BasisFunction.cpp:42
PvlObject & Label()
The Table's label.
Definition: Table.cpp:260
Source GetSource()
Return the source of the position.
Definition: SpicePosition.h:264
std::vector< double > HermiteCoordinate()
This method returns the Hermite coordinate for the current time for PolyFunctionOverHermiteConstant f...
Definition: SpicePosition.cpp:1646
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:1167
double GetBaseTime()
Return the base time for the position.
Definition: SpicePosition.h:271
@ WRT_X
Definition: SpicePosition.h:201
double getAdjustedEphemerisTime() const
Returns adjusted ephemeris time.
Definition: SpicePosition.cpp:1705
Nth degree Polynomial with one variable.
Definition: PolynomialUnivariate.h:37
const std::vector< double > & Coordinate()
Return the current J2000 position.
Definition: SpicePosition.h:211
int Fields() const
Returns the number of fields that are currently in the record.
Definition: TableRecord.cpp:78
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Definition: SpicePosition.cpp:150
int getTargetCode() const
Returns target code.
Definition: SpicePosition.cpp:1689
void ComputeBaseTime()
Compute the base time using cached times.
Definition: SpicePosition.cpp:1116
double GetTimeBias() const
Returns the value of the time bias added to ET.
Definition: SpicePosition.cpp:161
Utility class for creating and using cartesean line equations.
Definition: LineEquation.h:29
void setStateVector(const double state[6], const bool &hasVelocity)
Sets the state of target relative to observer.
Definition: SpicePosition.cpp:1794
void SetEphemerisTimeMemcache()
This is a protected method that is called by SetEphemerisTime() when Source type is Memcache.
Definition: SpicePosition.cpp:1294
SpicePosition(int targetCode, int observerCode)
Construct an empty SpicePosition class using valid body codes.
Definition: SpicePosition.cpp:37
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
Table LineCache(const QString &tableName)
Return a table with J2000 to reference positions.
Definition: SpicePosition.cpp:704
const std::vector< double > & SetEphemerisTime(double et)
Return J2000 coordinate at given time.
Definition: SpicePosition.cpp:249
Definition: TableRecord.h:38
void SetEphemerisTimePolyFunctionOverHermiteConstant()
This is a protected method that is called by SetEphemerisTime() when Source type is PolyFunctionOverH...
Definition: SpicePosition.cpp:1403
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
void SetEphemerisTimeHermiteCache()
This is a protected method that is called by SetEphemerisTime() when Source type is HermiteCache.
Definition: SpicePosition.cpp:1324
@ Spice
Object is reading directly from the kernels.
Definition: SpicePosition.h:180
const std::vector< double > & GetCenterCoordinate()
Compute and return the coordinate at the center time.
Definition: SpicePosition.cpp:1586
bool HasVelocity()
Return the flag indicating whether the velocity exists.
Definition: SpicePosition.h:219
@ PolyFunctionOverHermiteConstant
Object is reading from splined.
Definition: SpicePosition.h:184
int getObserverCode() const
Returns observer code.
Definition: SpicePosition.cpp:1675
Table LoadHermiteCache(const QString &tableName)
Cache J2000 position over existing cached time range using polynomials stored as Hermite cubic spline...
Definition: SpicePosition.cpp:793
@ PolyFunction
Object is calculated from nth degree polynomial.
Definition: SpicePosition.h:183
void LoadCache(double startTime, double endTime, int size)
Cache J2000 position over a time range.
Definition: SpicePosition.cpp:297
@ ScaleOnly
Definition: SpicePosition.h:287
Generic least square fitting class.
Definition: LeastSquares.h:99
double GetLightTime() const
Return the light time coorection value.
Definition: SpicePosition.cpp:230
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
int cacheSize() const
Get the size of the current cached positions.
Definition: SpicePosition.h:242
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
@ Double
The values in the field are 8 byte doubles.
Definition: TableField.h:54
nlohmann::json json
Definition: PvlObject.cpp:22
Class for storing Table blobs information.
Definition: Table.h:61
QString Name() const
The Table's name.
Definition: Table.cpp:247
Source
This enum indicates the status of the object.
Definition: SpicePosition.h:180
Isis exception class.
Definition: IException.h:91
void setLightTime(const double &lightTime)
Inheritors can set the light time if indicated.
Definition: SpicePosition.cpp:1824
@ NoOverrides
Definition: SpicePosition.h:287
Obtain SPICE information for a spacecraft.
Definition: Spice.h:283
std::vector< double > Extrapolate(double timeEt)
Extrapolate position for a given time assuming a constant velocity.
Definition: SpicePosition.cpp:1626
double EphemerisTime() const
Return the current ephemeris time.
Definition: SpicePosition.h:204
void Memcache2HermiteCache(double tolerance)
This method reduces the cache for position, time and velocity to the minimum number of values needed ...
Definition: SpicePosition.cpp:1463
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
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:1147
const std::vector< double > & Velocity()
Return the current J2000 velocity.
Definition: SpicePosition.cpp:1269
nlohmann::json json
This is free and unencumbered software released into the public domain.
Definition: SpicePosition.cpp:26
@ WRT_Z
Definition: SpicePosition.h:201
OverrideType
Definition: SpicePosition.h:287
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Definition: PvlObject.cpp:177
bool IsCached() const
Is this position cached.
Definition: SpicePosition.h:237
double Slope()
Compute the slope of the line.
Definition: LineEquation.cpp:66
@ WRT_Y
Definition: SpicePosition.h:201
void AddKnown(const std::vector< double > &input, double expected, double weight=1.0)
Invoke this method for each set of knowns.
Definition: LeastSquares.cpp:96
Table Cache(const QString &tableName)
Return a table with J2000 positions.
Definition: SpicePosition.cpp:549
@ Memcache
Object is reading from cached table.
Definition: SpicePosition.h:181
int Records() const
Returns the number of records.
Definition: Table.cpp:313
void ReloadCache()
Cache J2000 positions over existing cached time range using polynomials.
Definition: SpicePosition.cpp:729
double Evaluate(const std::vector< double > &vars)
Compute the equation using the input variables.
Definition: BasisFunction.cpp:64
double GetTimeScale()
Return the time scale for the position.
Definition: SpicePosition.h:278
double DPolynomial(const int coeffIndex)
Evaluate the derivative of the fit polynomial (parabola) defined by the given coefficients with respe...
Definition: SpicePosition.cpp:1244
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
int Coefficients() const
Returns the number of coefficients for the equation.
Definition: BasisFunction.h:64
double Coefficient(int i) const
Returns the ith coefficient.
Definition: BasisFunction.h:107
std::vector< double > VelocityPartial(SpicePosition::PartialType partialVar, int coeffIndex)
Compute the derivative of the velocity with respect to the specified variable.
Definition: SpicePosition.cpp:1208
Class for storing an Isis::Table's field information.
Definition: TableField.h:47
void SetPolynomialDegree(int degree)
Set the polynomial degree.
Definition: SpicePosition.cpp:1502