18#include "CubeManager.h"
20#include "EllipsoidShape.h"
21#include "IException.h"
26#include "NaifStatus.h"
27#include "Projection.h"
28#include "ShapeModel.h"
29#include "SpecialPixel.h"
30#include "SurfacePoint.h"
32#include "UniqueIOCachingAlgorithm.h"
34#define MAX(x,y) (((x) > (y)) ? (x) : (y))
69 target()->setShapeEllipsoid();
85 QString message =
"Pixel Ifov offsets not implemented for this camera.";
101 target()->shape()->clearSurfacePoint();
151 vector<double> lookC(v, v + 3);
155 const vector<double> &lookB =
bodyRotation()->ReferenceVector(lookJ);
161 memcpy(
m_lookB, &lookB[0],
sizeof(
double) * 3);
166 target()->shape()->setHasIntersection(
false);
171 const vector<double> &sB =
bodyRotation()->ReferenceVector(
176 return target()->shape()->intersectSurface(sB, lookB);
189 return target()->shape()->hasIntersection();
224 return target()->shape()->surfaceIntersection()->GetLatitude();
248 return target()->shape()->surfaceIntersection()->GetLongitude();
258 return *(
target()->shape()->surfaceIntersection());
272 return target()->shape()->surfaceIntersection()->GetLocalRadius();
288 return target()->shape()->localRadius(lat, lon);
315 double sensorPosBf[3];
317 double groundPtBf[3];
319 return RAD2DEG * SensorUtilities::sepAngle(sensorPosBf, groundPtBf,
m_uB);
329 return target()->shape()->emissionAngle(
340 std::vector<double> sunB(
m_uB,
m_uB+3);
341 return target()->shape()->incidenceAngle(sunB);
364 const double longitude,
379 shape->intersectSurface(lat, lon,
406 const double longitude,
457 shape->intersectSurface(surfacePt,
493 const vector<double> &sB =
540 vector<double> lookB(3);
592 vector<double> lookJ =
bodyRotation()->J2000Vector(lookB);
594 SensorUtilities::GroundPt3D sphericalPt = SensorUtilities::rectToSpherical(&lookJ[0]);
595 m_ra = sphericalPt.lon;
618 SensorUtilities::GroundPt3D sphericalPt = {decRad, raRad, 1};
619 SensorUtilities::Vec rectPt = SensorUtilities::sphericalToRect(sphericalPt);
635 scSurfaceVector[0] =
m_lookB[0];
636 scSurfaceVector[1] =
m_lookB[1];
637 scSurfaceVector[2] =
m_lookB[2];
651 SensorUtilities::Vec groundPt = {
652 surfPoint->GetX().kilometers(),
653 surfPoint->GetY().kilometers(),
654 surfPoint->GetZ().kilometers()};
656 return SensorUtilities::distance(sensorPos, groundPt);
671 if (lst < 0.0) lst += 24.0;
672 if (lst > 24.0) lst -= 24.0;
688 SensorUtilities::Vec groundPt = {
693 return SensorUtilities::distance(groundPt, sB) / 149597870.691;
716 return SensorUtilities::magnitude(sensorPos) - rad.kilometers();
double degrees() const
Get the angle in units of Degrees.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
IO Handler for Isis Cubes.
double kilometers() const
Get the displacement in kilometers.
Distance measurement, usually in meters.
@ Meters
The distance is being specified in meters.
@ Programmer
This error is for when a programmer made an API call that was illegal.
This class is designed to encapsulate the concept of a Latitude.
This class is designed to encapsulate the concept of a Longitude.
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
virtual SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
bool SetUniversalGround(const double latitude, const double longitude, bool backCheck=true)
This is the opposite routine for SetLookDirection.
double LocalSolarTime()
Return the local solar time in hours.
SpiceDouble m_lookB[3]
Look direction in body fixed.
SpiceDouble m_dec
Decliation (sky latitude)
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
Longitude GetLongitude() const
Returns a positive east, 0-360 domain longitude object at the surface intersection point in the body ...
virtual double SolarDistance() const
Returns the distance between the sun and surface point in AU.
bool HasSurfaceIntersection() const
Returns if the last call to either SetLookDirection or SetUniversalGround had a valid intersection wi...
virtual double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
void SpacecraftSurfaceVector(double scSurfaceVector[3]) const
Sets the vector between the spacecraft and surface point in body-fixed.
bool m_newLookB
flag to indicate we need to recompute ra/dec
virtual QList< QPointF > PixelIfovOffsets()
This method is implemented in Camera which defaults to the (pixel pitch * summing mode ) / 2.
Latitude GetLatitude() const
Returns a planetocentric latitude object at the surface intersection point in body fixed.
SpiceDouble m_ra
Right ascension (sky longitude)
double SpacecraftAltitude()
Returns the distance from the spacecraft to the subspacecraft point in km.
virtual ~Sensor()
Destroys the Sensor.
virtual std::vector< double > lookDirectionBodyFixed() const
Returns the look direction in the body fixed coordinate system.
bool SetGround(const SurfacePoint &surfacePt, bool backCheck=true)
This overloaded method has the opposite function as SetLookDirection.
bool SetGroundLocal(bool backCheck)
Computes look vector.
virtual std::vector< double > lookDirectionJ2000() const
Returns the look direction in the camera coordinate system.
void IgnoreElevationModel(bool ignore)
This allows you to ignore the cube elevation model and use the ellipse.
virtual double PhaseAngle() const
Returns the phase angle in degrees.
bool SetRightAscensionDeclination(const double ra, const double dec)
Given the ra/dec compute the look direction.
virtual double IncidenceAngle() const
Returns the incidence angle in degrees.
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Sensor(Cube &cube)
Constructs a Sensor object and loads SPICE kernels using information from the label object.
Distance LocalRadius() const
Returns the local radius at the intersection point.
virtual double Declination()
Returns the declination angle (sky latitude).
virtual double EmissionAngle() const
Returns the emission angle in degrees.
void LookDirection(double v[3]) const
Returns the look direction in the camera coordinate system.
bool SetLookDirection(const double v[3])
Sets the look direction of the spacecraft.
void computeRaDec()
Computes the ra/dec from the look direction.
Define shapes and provide utilities for Isis targets.
virtual void clearSurfacePoint()
Clears or resets the current surface point.
bool hasIntersection()
Returns intersection status.
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
virtual SurfacePoint * surfaceIntersection() const
Returns the surface intersection for this ShapeModel.
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Default occulsion implementation.
Obtain SPICE information for a spacecraft.
virtual void setTime(const iTime &time)
Sets the ephemeris time and reads the spacecraft and sun position from the kernels at that instant in...
virtual SpiceRotation * bodyRotation() const
Accessor method for the body rotation.
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
virtual void instrumentBodyFixedPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
virtual Target * target() const
Returns a pointer to the target object.
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
virtual SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
SpiceDouble m_uB[3]
This contains the sun position (u) in the bodyfixed reference frame (B).
virtual SpicePosition * sunPosition() const
Accessor method for the sun position.
virtual void subSpacecraftPoint(double &lat, double &lon)
Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east,...
This class defines a body-fixed surface point.
Parse and return pieces of a time string.
This is free and unencumbered software released into the public domain.
const double DEG2RAD
Multiplier for converting from degrees to radians.
const double RAD2DEG
Multiplier for converting from radians to degrees.
const double PI
The mathematical constant PI.
Namespace for the standard library.