Isis 3 Programmer Reference
Isis::LightTimeCorrectionState Class Reference

Provides interface to user configurable Light Time correction feature. More...

#include <LightTimeCorrectionState.h>

Collaboration diagram for Isis::LightTimeCorrectionState:
Collaboration graph

Public Member Functions

 LightTimeCorrectionState ()
 Default constructor sets default state of light time corrections. More...
 
 LightTimeCorrectionState (int ikCode, Spice *spice)
 Constructor that gathers state of light time correction. More...
 
bool operator== (const LightTimeCorrectionState &state) const
 Compare two instances of the LightTimeCorrectionState objects. More...
 
bool checkAberrationCorrection (int ikCode, Spice *spice)
 Apply instrument (team) specific light time/stellar aborration option. More...
 
void setAberrationCorrection (const QString &correction)
 Sets the aberration correction directly. More...
 
QString getAberrationCorrection () const
 Returns the value of the current stellar aberration state. More...
 
bool checkSpkKernelsForAberrationCorrection ()
 Check for light time/stellar aberration tag in SPK comments. More...
 
bool isLightTimeCorrected () const
 Is light time to target corrected? More...
 
bool checkObserverTargetSwap (int ikCode, Spice *spice)
 Check status of target/observer swap specification. More...
 
bool isObserverTargetSwapped () const
 Returns state swap observer/target. More...
 
void setSwapObserverTarget ()
 Turns on swapping of observer/target. More...
 
void setNoSwapObserverTarget ()
 Turns off swapping of observer/target (default) More...
 
bool checkLightTimeToSurfaceCorrect (int ikCode, Spice *spice)
 Determines state of surface to s/c light time correction. More...
 
bool isLightTimeToSurfaceCorrected () const
 Returns state of light time from surface to center body correction. More...
 
void setCorrectLightTimeToSurface ()
 Sets state of light time from surface to center body for orrection. More...
 
void setNoCorrectLightTimeToSurface ()
 Disables state of light time from surface to center body for correction. More...
 

Private Member Functions

void setDefaultState ()
 Set default conditions for light time correction state. More...
 

Private Attributes

QString m_abcorr
 
bool m_swapObserverTarget
 
bool m_sc_to_surf_ltcorr
 

Detailed Description

Provides interface to user configurable Light Time correction feature.

This class provides a comprehensive container for the state of the observer/target swapping to correct a long term issue that applied the wrong order of observer/target to the NAIF spkez_c/spkezp_c routines that provide body state vectors.

In addition, it also contains parameters that provide determination of the type and extent of stellar aberration and light time correction to the surface of the target body. This is a recent addition to address accuracy issues in determining these vectors.

See also
Spice
SpacecraftPosition
SpicePosition
Author
2012-10-11 Kris Becker
History:

2012-10-31 Kris Becker - New class iprovides support for swapping of observer/target and light time correction to surface. Fixes (mostly) #0909, #1136 and #1223.

2012-11-01 Kris Becker - Fixed isLightTimeCorrected() as it was returning exactly opposite what it should be. References #1136.

2012-12-04 Kris Becker - Corrected documentation

2015-07-21 Kristin Berry - Added NaifStatus::CheckErrors() to see if any NAIF errors were signaled. References #2248.

Definition at line 62 of file LightTimeCorrectionState.h.

Constructor & Destructor Documentation

◆ LightTimeCorrectionState() [1/2]

Isis::LightTimeCorrectionState::LightTimeCorrectionState ( )

Default constructor sets default state of light time corrections.

The default state of the stellar aberration correction, swap of observer/target and correction of light time to the surface of a target body are set here. The current state of these conditions are set to preserve preexisting behavior.

Initial state of these conditions are "LT+S" for stellar aberration, false for observer/target swap and no light time to surface correction.

Author
2012-10-28 Kris Becker

Definition at line 57 of file LightTimeCorrectionState.cpp.

References setDefaultState().

◆ LightTimeCorrectionState() [2/2]

Isis::LightTimeCorrectionState::LightTimeCorrectionState ( int  ikCode,
Spice spice 
)

Constructor that gathers state of light time correction.

This constructor checks observer/target swap and light time correction states for an instrument indicated by the ikCode parameter (assumed to be a valid NAIF instrument code). The Spice object is required so these values are properly recorded (in the label) for subsequent use.

Author
2012-10-11 Kris Becker
Parameters
ikCodeNAIF code for instrument
spiceSpice object associated with geometry

Definition at line 75 of file LightTimeCorrectionState.cpp.

References checkAberrationCorrection(), checkLightTimeToSurfaceCorrect(), checkObserverTargetSwap(), and setDefaultState().

Member Function Documentation

◆ checkAberrationCorrection()

bool Isis::LightTimeCorrectionState::checkAberrationCorrection ( int  ikCode,
Spice spice 
)

Apply instrument (team) specific light time/stellar aborration option.

This method checks for the value of the INS-XXXXXX_LIGHTTIME_CORRECTION kernel pool keyword to determine the value (if specified) of the light time and stellar aborration correction parameter provided to NAIF routines.

Author
2012-10-09 Kris Becker
Parameters
ikCodeInstrument code to check for keyword specification of correction
spiceSpice class is required in order to check kernel pool for keywords
Returns
bool True if a value was found and applied

Definition at line 122 of file LightTimeCorrectionState.cpp.

References Isis::Spice::getString(), and Isis::toString().

Referenced by LightTimeCorrectionState().

◆ checkLightTimeToSurfaceCorrect()

bool Isis::LightTimeCorrectionState::checkLightTimeToSurfaceCorrect ( int  ikCode,
Spice spice 
)

Determines state of surface to s/c light time correction.

This state specifies the radius of the target is to be taken into consideraton when correcting for the time it takes light to travel from surface to center of target body.

This method checks for the value of the INS-XXXXXX_LT_SURFACE_CORRECT kernel pool keyword to determine if correction adjustments for light time from surface to center body are to be applied in the SpicePosition class.

Author
2012-10-28 Kris Becker
Parameters
ikCodeCode of instrument to check for
spiceSpice instance to interface virtual NAIF kernel pool
Returns
bool State of light time from surface to center body correction as determined.

Definition at line 321 of file LightTimeCorrectionState.cpp.

References Isis::Spice::getString(), and Isis::toString().

Referenced by LightTimeCorrectionState().

◆ checkObserverTargetSwap()

bool Isis::LightTimeCorrectionState::checkObserverTargetSwap ( int  ikCode,
Spice spice 
)

Check status of target/observer swap specification.

This method checks for the value of the INS-XXXXXX_SWAP_OBSERVER_TARGET kernel pool keyword to determine if a swap of the observer/target order in the SpicePosition class is requested/needed by the instrument specified by the ikCode parameter (this is assumed to be a valid NAIF instrument code).

A values of TRUE will result in the switch of the order of the target and observer codes in the SpicePosition constructor.

Author
2012-10-05 Kris Becker
Parameters
ikCodeInstrument code to check for
spiceSpice class is required in order to check kernel pool for keywords
Returns
true if swap of observer/target is requested via kernel pool variables

Definition at line 269 of file LightTimeCorrectionState.cpp.

References Isis::Spice::getString(), and Isis::toString().

Referenced by LightTimeCorrectionState().

◆ checkSpkKernelsForAberrationCorrection()

bool Isis::LightTimeCorrectionState::checkSpkKernelsForAberrationCorrection ( )

Check for light time/stellar aberration tag in SPK comments.

This function will search through all SPK kernel file comments section looking for a specified tag called "ID:USGS_SPK_ABCORR". If the tag is found in any of the loaded SPK files, then true is returned. This is intended to indicate that the light time and stellar aberration correction option needs to be overridden when querying NAIF position states.

This tag is generated by the spkwriter application when recording new SPK kernels from ISIS corrected SPICE tables. The SPKs generated from that application has had all the light time correction states incorporated so we must ensure that if such kernels are loaded, no corrections are applied.

Note that this routine is reentrant and can be called multiple times from multiple sources to make this determination.

Returns
bool Returns true if the tag is found anywhere in the comments section of the SPK, otherwise false if it is not found. When false, the existing value is retained.

Definition at line 188 of file LightTimeCorrectionState.cpp.

References Isis::NaifStatus::CheckErrors(), Isis::Kernels::Discover(), and Isis::Kernels::getKernelList().

Referenced by Isis::Spice::init().

◆ getAberrationCorrection()

QString Isis::LightTimeCorrectionState::getAberrationCorrection ( ) const

Returns the value of the current stellar aberration state.

Author
Kris Becker - 10/28/2012
Returns
QString Value of correction

Definition at line 162 of file LightTimeCorrectionState.cpp.

Referenced by Isis::SpacecraftPosition::GetAberrationCorrection(), and operator==().

◆ isLightTimeCorrected()

bool Isis::LightTimeCorrectionState::isLightTimeCorrected ( ) const

Is light time to target corrected?

Definition at line 245 of file LightTimeCorrectionState.cpp.

Referenced by Isis::SpacecraftPosition::SetEphemerisTimeSpice().

◆ isLightTimeToSurfaceCorrected()

bool Isis::LightTimeCorrectionState::isLightTimeToSurfaceCorrected ( ) const

Returns state of light time from surface to center body correction.

Definition at line 338 of file LightTimeCorrectionState.cpp.

Referenced by operator==(), and Isis::SpacecraftPosition::SetEphemerisTimeSpice().

◆ isObserverTargetSwapped()

bool Isis::LightTimeCorrectionState::isObserverTargetSwapped ( ) const

Returns state swap observer/target.

Definition at line 287 of file LightTimeCorrectionState.cpp.

Referenced by operator==().

◆ operator==()

bool Isis::LightTimeCorrectionState::operator== ( const LightTimeCorrectionState state) const

Compare two instances of the LightTimeCorrectionState objects.

Author
Kris Becker - 10/28/2012
Parameters
stateOther state to compare to
Returns
bool false if all values aren't the same, true otherwise.

Definition at line 93 of file LightTimeCorrectionState.cpp.

References getAberrationCorrection(), isLightTimeToSurfaceCorrected(), and isObserverTargetSwapped().

◆ setAberrationCorrection()

void Isis::LightTimeCorrectionState::setAberrationCorrection ( const QString &  correction)

Sets the aberration correction directly.

Provides programmer direct setting of this value. This is typically required by camera models that fix this value for a specific reason.

Author
2012-10-28 Kris Becker
Parameters
correctionUser specified abcorr correction option as defined by the NAIF routine found at http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkez_c.html.

Definition at line 149 of file LightTimeCorrectionState.cpp.

Referenced by Isis::SpacecraftPosition::SetAberrationCorrection().

◆ setCorrectLightTimeToSurface()

void Isis::LightTimeCorrectionState::setCorrectLightTimeToSurface ( )

Sets state of light time from surface to center body for orrection.

Definition at line 343 of file LightTimeCorrectionState.cpp.

◆ setDefaultState()

void Isis::LightTimeCorrectionState::setDefaultState ( )
private

Set default conditions for light time correction state.

This method sets the default conditions for light time correction. See the default constructor for full description.

Default preserves existing behavior at the time of this implementation.

Author
2012-10-28 Kris Becker

Definition at line 364 of file LightTimeCorrectionState.cpp.

Referenced by LightTimeCorrectionState().

◆ setNoCorrectLightTimeToSurface()

void Isis::LightTimeCorrectionState::setNoCorrectLightTimeToSurface ( )

Disables state of light time from surface to center body for correction.

Definition at line 349 of file LightTimeCorrectionState.cpp.

◆ setNoSwapObserverTarget()

void Isis::LightTimeCorrectionState::setNoSwapObserverTarget ( )

Turns off swapping of observer/target (default)

Definition at line 297 of file LightTimeCorrectionState.cpp.

◆ setSwapObserverTarget()

void Isis::LightTimeCorrectionState::setSwapObserverTarget ( )

Turns on swapping of observer/target.

Definition at line 292 of file LightTimeCorrectionState.cpp.


The documentation for this class was generated from the following files: