Isis 3 Programmer Reference
IsisIlluminator.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "IsisIlluminator.h"
8
9#include "SpicePosition.h"
10
11using namespace std;
12
13namespace Isis {
18 m_pos = pos;
19 }
20
21
25 SensorUtilities::Vec IsisIlluminator::position(double time) {
26 double oldTime = m_pos->EphemerisTime();
27 bool timeChanged = oldTime != time;
28 if (timeChanged) {
29 m_pos->SetEphemerisTime(time);
30 }
31 vector<double> coord = m_pos->Coordinate();
32 if (timeChanged) {
33 m_pos->SetEphemerisTime(oldTime);
34 }
35 // ISIS uses Km, so convert to meters
36 return {coord[0] * 1000.0, coord[1] * 1000.0, coord[2] * 1000.0};
37 }
38
39
43 SensorUtilities::Vec IsisIlluminator::velocity(double time) {
44 double oldTime = m_pos->EphemerisTime();
45 bool timeChanged = oldTime != time;
46 if (timeChanged) {
47 m_pos->SetEphemerisTime(time);
48 }
49 vector<double> vel = m_pos->Velocity();
50 if (timeChanged) {
51 m_pos->SetEphemerisTime(oldTime);
52 }
53 // ISIS uses Km, so convert to meters
54 return {vel[0] * 1000.0, vel[1] * 1000.0, vel[2] * 1000.0};
55 }
56}
IsisIlluminator(SpicePosition *pos)
Create an IsisIlluminator that wraps a SpicePosition.
SensorUtilities::Vec position(double time)
Get the position in meters at a given time.
SensorUtilities::Vec velocity(double time)
Get the velocity in meters at a given time.
Obtain SPICE position information for a body.
const std::vector< double > & Velocity()
Return the current J2000 velocity.
virtual double EphemerisTime() const
Return the current ephemeris time.
virtual const std::vector< double > & SetEphemerisTime(double et)
Return J2000 coordinate at given time.
virtual const std::vector< double > & Coordinate()
Return the current J2000 position.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.