Isis Developer Reference
Sensor.h
Go to the documentation of this file.
1 #ifndef Sensor_h
2 #define Sensor_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "Spice.h"
10 
11 #include <QList>
12 #include <QPointF>
13 #include <QString>
14 
15 #include "Cube.h"
16 #include "Interpolator.h"
17 #include "Portal.h"
18 #include "ProjectionFactory.h"
19 
20 namespace Isis {
21  class Distance;
22  class EllipsoidShape;
23  class iTime;
24  class Latitude;
25  class Longitude;
26  class ShapeModel;
27  class SurfacePoint;
28  class Target;
29 
170  class Sensor : public Spice {
171  public:
172  Sensor(Cube &cube);
173 
174  virtual ~Sensor();
175 
176  void setTime(const iTime &time);
177  bool SetLookDirection(const double v[3]);
178  bool SetRightAscensionDeclination(const double ra, const double dec);
179  bool SetUniversalGround(const double latitude, const double longitude,
180  bool backCheck = true);
181  bool SetUniversalGround(const double latitude, const double longitude,
182  const double radius, bool backCheck = true);
183  bool SetGround(const SurfacePoint &surfacePt, bool backCheck = true);
184  bool HasSurfaceIntersection() const;
185  void Coordinate(double p[3]) const;
186 
187  virtual double UniversalLatitude() const;
188  Latitude GetLatitude() const;
189  virtual double UniversalLongitude() const;
190  Longitude GetLongitude() const;
192 
193  Distance LocalRadius() const;
195  Distance LocalRadius(double lat, double lon);
196 
197  virtual double PhaseAngle() const;
198  virtual double EmissionAngle() const;
199  virtual double IncidenceAngle() const;
200 
201  void LookDirection(double v[3]) const;
202  std::vector<double> lookDirectionJ2000() const;
203  std::vector<double> lookDirectionBodyFixed() const;
204 
205  virtual double RightAscension();
206  virtual double Declination();
207 
208  // Return vector between spacecraft and surface point in body-fixed
209  void SpacecraftSurfaceVector(double scSurfaceVector[3]) const;
210  virtual double SlantDistance() const;
211  double LocalSolarTime();
212  virtual double SolarDistance() const;
213  double SpacecraftAltitude();
214 
215  // Return local radius from dem
216 // Distance DemRadius(const SurfacePoint &pt);
217 // Distance DemRadius(const Latitude &lat, const Longitude
218 // &lon); bool HasElevationModel() {
219 
226  virtual double resolution() {
227  return 1.0;
228  };
229  void IgnoreElevationModel(bool ignore);
230 
232 
233  virtual QString instrumentNameLong() const = 0;
234  virtual QString instrumentNameShort() const = 0;
235  virtual QString spacecraftNameLong() const = 0;
236  virtual QString spacecraftNameShort() const = 0;
237 
238  protected:
239  SpiceDouble m_lookB[3];
240  bool m_newLookB;
241 
242  private:
243  // This version of DemRadius is for SetLookDirection ONLY. Do not call.
244  // DAC TODO Why is next declaration here? Don't move until I know
245 // double DemRadius(double lat, double lon);
246  void CommonInitialize(const std::string &demCube);
247 
248 
249  SpiceDouble m_ra;
250  SpiceDouble m_dec;
251  void computeRaDec();
252  bool SetGroundLocal(bool backCheck);
253  };
254 };
255 
256 #endif
Isis::Distance::kilometers
double kilometers() const
Get the distance in kilometers.
Definition: Distance.cpp:106
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
Isis::Spice::setTime
virtual void setTime(const iTime &time)
Sets the ephemeris time and reads the spacecraft and sun position from the kernels at that instant in...
Definition: Spice.cpp:780
Isis::Spice::time
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition: Spice.cpp:884
Isis::ShapeModel::emissionAngle
virtual double emissionAngle(const std::vector< double > &sB)
Computes and returns emission angle, in degrees, given the observer position.
Definition: ShapeModel.cpp:185
Isis::Target::setShapeEllipsoid
void setShapeEllipsoid()
Set the shape to the ellipsoid and save the original shape.
Definition: Target.cpp:603
Isis::Sensor::SpacecraftSurfaceVector
void SpacecraftSurfaceVector(double scSurfaceVector[3]) const
Sets the vector between the spacecraft and surface point in body-fixed.
Definition: Sensor.cpp:625
ProjectionFactory.h
Portal.h
Isis::Target::shape
ShapeModel * shape() const
Return the shape.
Definition: Target.cpp:655
Isis::Spice::subSolarPoint
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
Definition: Spice.cpp:1329
Cube.h
Isis::ShapeModel::clearSurfacePoint
virtual void clearSurfacePoint()
Clears or resets the current surface point.
Definition: ShapeModel.cpp:386
EllipsoidShape.h
Isis::Sensor::instrumentNameShort
virtual QString instrumentNameShort() const =0
Isis::Spice::subSpacecraftPoint
virtual void subSpacecraftPoint(double &lat, double &lon)
Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east,...
Definition: Spice.cpp:1278
Isis::SurfacePoint::GetX
Displacement GetX() const
Definition: SurfacePoint.cpp:1436
Isis::Spice::instrumentPosition
virtual SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
Definition: Spice.cpp:1600
Isis::Sensor::~Sensor
virtual ~Sensor()
Destroys the Sensor.
Definition: Sensor.cpp:51
Isis::PI
const double PI
The mathematical constant PI.
Definition: Constants.h:40
Isis::Sensor::SpacecraftAltitude
double SpacecraftAltitude()
Returns the distance from the spacecraft to the subspacecraft point in km.
Definition: Sensor.cpp:701
Isis::Sensor::SetUniversalGround
bool SetUniversalGround(const double latitude, const double longitude, bool backCheck=true)
This is the opposite routine for SetLookDirection.
Definition: Sensor.cpp:359
QList< QPointF >
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::ShapeModel::surfaceIntersection
SurfacePoint * surfaceIntersection() const
Returns the surface intersection for this ShapeModel.
Definition: ShapeModel.cpp:358
Isis::Sensor::HasSurfaceIntersection
bool HasSurfaceIntersection() const
Returns if the last call to either SetLookDirection or SetUniversalGround had a valid intersection wi...
Definition: Sensor.cpp:186
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
SpecialPixel.h
ShapeModel.h
Isis::Sensor::lookDirectionJ2000
std::vector< double > lookDirectionJ2000() const
Returns the look direction in the camera coordinate system.
Definition: Sensor.cpp:549
Isis::ShapeModel::setHasIntersection
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
Definition: ShapeModel.cpp:554
Isis::ShapeModel::localRadius
virtual Distance localRadius(const Latitude &lat, const Longitude &lon)=0
Target.h
Isis::Sensor::spacecraftNameLong
virtual QString spacecraftNameLong() const =0
Sensor.h
Isis::ShapeModel::incidenceAngle
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position.
Definition: ShapeModel.cpp:232
Spice.h
Isis::Sensor::Declination
virtual double Declination()
Returns the declination angle (sky latitude).
Definition: Sensor.cpp:574
Longitude.h
Isis::Sensor::GetLongitude
Longitude GetLongitude() const
Returns a positive east, 0-360 domain longitude object at the surface intersection point in the body ...
Definition: Sensor.cpp:245
NaifStatus.h
Isis::SurfacePoint::GetZ
Displacement GetZ() const
Definition: SurfacePoint.cpp:1450
Isis::SurfacePoint::GetLatitude
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Definition: SurfacePoint.cpp:1665
Isis::Sensor::PixelIfovOffsets
virtual QList< QPointF > PixelIfovOffsets()
This method is implemented in Camera which defaults to the (pixel pitch * summing mode ) / 2.
Definition: Sensor.cpp:81
Isis::Sensor::LocalSolarTime
double LocalSolarTime()
Return the local solar time in hours.
Definition: Sensor.cpp:660
Isis::Spice::sunPosition
virtual SpicePosition * sunPosition() const
Accessor method for the sun position.
Definition: Spice.cpp:1589
Isis::Sensor::GetSurfacePoint
SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
Definition: Sensor.cpp:255
Isis::ShapeModel::intersectSurface
virtual bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)=0
Isis::SpiceRotation::J2000Vector
std::vector< double > J2000Vector(const std::vector< double > &rVec)
Given a direction vector in the reference frame, return a J2000 direction.
Definition: SpiceRotation.cpp:1408
Isis::Sensor::RightAscension
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
Definition: Sensor.cpp:561
IString.h
Isis::Sensor::IgnoreElevationModel
void IgnoreElevationModel(bool ignore)
This allows you to ignore the cube elevation model and use the ellipse.
Definition: Sensor.cpp:60
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::Sensor::lookDirectionBodyFixed
std::vector< double > lookDirectionBodyFixed() const
Returns the look direction in the body fixed coordinate system.
Definition: Sensor.cpp:535
Isis::Spice::target
virtual Target * target() const
Returns a pointer to the target object.
Definition: Spice.cpp:1368
Isis::Spice::instrumentRotation
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1622
Isis::Sensor::setTime
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
Definition: Sensor.cpp:97
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Latitude.h
Isis::Sensor::UniversalLongitude
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Definition: Sensor.cpp:233
Isis::Sensor::LookDirection
void LookDirection(double v[3]) const
Returns the look direction in the camera coordinate system.
Definition: Sensor.cpp:523
Isis::Sensor::spacecraftNameShort
virtual QString spacecraftNameShort() const =0
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Spice::m_uB
SpiceDouble m_uB[3]
This contains the sun position (u) in the bodyfixed reference frame (B).
Definition: Spice.h:369
SurfacePoint.h
Isis::Sensor::Sensor
Sensor(Cube &cube)
Constructs a Sensor object and loads SPICE kernels using information from the label object.
Definition: Sensor.cpp:45
Isis::Target::restoreShape
void restoreShape()
Restores the shape to the original after setShapeEllipsoid has overridden it.
Definition: Target.cpp:585
Isis::Spice::bodyRotation
virtual SpiceRotation * bodyRotation() const
Accessor method for the body rotation.
Definition: Spice.cpp:1611
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Sensor::IncidenceAngle
virtual double IncidenceAngle() const
Returns the incidence angle in degrees.
Definition: Sensor.cpp:335
Isis::Sensor::instrumentNameLong
virtual QString instrumentNameLong() const =0
Isis::Spice
Obtain SPICE information for a spacecraft.
Definition: Spice.h:283
Isis::Sensor::GetLatitude
Latitude GetLatitude() const
Returns a planetocentric latitude object at the surface intersection point in body fixed.
Definition: Sensor.cpp:221
Isis::SurfacePoint::GetLongitude
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Definition: SurfacePoint.cpp:1685
Isis::Displacement::kilometers
double kilometers() const
Get the displacement in kilometers.
Definition: Displacement.cpp:94
Isis::Sensor
Class for computing sensor ground coordinates.
Definition: Sensor.h:170
Isis::Sensor::SolarDistance
virtual double SolarDistance() const
Returns the distance between the sun and surface point in AU.
Definition: Sensor.cpp:677
IException.h
Isis::SurfacePoint::GetLocalRadius
Distance GetLocalRadius() const
Return the radius of the surface point.
Definition: SurfacePoint.cpp:1732
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::Sensor::m_newLookB
bool m_newLookB
flag to indicate we need to recompute ra/dec
Definition: Sensor.h:240
Isis::ShapeModel
Define shapes and provide utilities for Isis targets.
Definition: ShapeModel.h:62
Isis::Sensor::SetLookDirection
bool SetLookDirection(const double v[3])
Sets the look direction of the spacecraft.
Definition: Sensor.cpp:141
Isis::Sensor::SetRightAscensionDeclination
bool SetRightAscensionDeclination(const double ra, const double dec)
Given the ra/dec compute the look direction.
Definition: Sensor.cpp:608
Isis::ShapeModel::phaseAngle
virtual double phaseAngle(const std::vector< double > &sB, const std::vector< double > &uB)
Computes and returns phase angle, in degrees, given the positions of the observer and illuminator.
Definition: ShapeModel.cpp:324
Angle.h
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Isis::Sensor::PhaseAngle
virtual double PhaseAngle() const
Returns the phase angle in degrees.
Definition: Sensor.cpp:312
Projection.h
Isis::ShapeModel::hasIntersection
bool hasIntersection()
Returns intersection status.
Definition: ShapeModel.cpp:368
Isis::Sensor::Coordinate
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Definition: Sensor.cpp:196
iTime.h
Isis::Sensor::EmissionAngle
virtual double EmissionAngle() const
Returns the emission angle in degrees.
Definition: Sensor.cpp:324
Constants.h
Isis::SpiceRotation::ReferenceVector
std::vector< double > ReferenceVector(const std::vector< double > &jVec)
Given a direction vector in J2000, return a reference frame direction.
Definition: SpiceRotation.cpp:1700
Distance.h
CubeManager.h
Isis::Sensor::m_lookB
SpiceDouble m_lookB[3]
Look direction in body fixed.
Definition: Sensor.h:239
Interpolator.h
UniqueIOCachingAlgorithm.h
Isis::ShapeModel::isVisibleFrom
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Default occulsion implementation.
Definition: ShapeModel.cpp:431
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis::SurfacePoint::GetY
Displacement GetY() const
Definition: SurfacePoint.cpp:1443
Isis::Sensor::resolution
virtual double resolution()
Virtual method that returns the pixel resolution of the sensor in meters/pix.
Definition: Sensor.h:226
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Sensor::SlantDistance
virtual double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
Definition: Sensor.cpp:637
Isis::Sensor::LocalRadius
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition: Sensor.cpp:267
Isis::Sensor::SetGround
bool SetGround(const SurfacePoint &surfacePt, bool backCheck=true)
This overloaded method has the opposite function as SetLookDirection.
Definition: Sensor.cpp:443
Isis::Sensor::UniversalLatitude
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Definition: Sensor.cpp:210