Isis Developer Reference
CSMCamera.h
Go to the documentation of this file.
1 #ifndef CSMCamera_h
2 #define CSMCamera_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 #include "Camera.h"
12 #include "iTime.h"
13 #include "Target.h"
14 
15 #include <vector>
16 
17 #include <QList>
18 #include <QPointF>
19 #include <QStringList>
20 
21 #include "csm/csm.h"
22 #include "csm/RasterGM.h"
23 
24 namespace Isis {
25  class CSMCamera : public Camera {
26 
27  public:
28  // constructors
29  CSMCamera(Cube &cube);
30 // CSMCamera(Cube &cube, QString pluginName, QString modelName, QString stateString);
31 
33  ~CSMCamera() {};
34 
40  virtual CameraType GetCameraType() const {
41  return Csm;
42  }
43 
50  virtual int CkFrameId() const { return (-1); }
51 
58  virtual int CkReferenceId() const { return (-1); }
59 
66  virtual int SpkCenterId() const { return -1; }
67 
74  virtual int SpkReferenceId() const { return (-1); }
75 
77 
78  virtual bool SetImage(const double sample, const double line);
79 
80  virtual bool SetGround(Latitude latitude, Longitude longitude);
81  virtual bool SetGround(const SurfacePoint &surfacePt);
82  virtual bool SetUniversalGround(const double latitude, const double longitude);
83  virtual bool SetUniversalGround(const double latitude, const double longitude, double radius);
84 
85  virtual void setTime(const iTime &time);
86 
87  virtual double LineResolution();
88  virtual double SampleResolution();
89  virtual double DetectorResolution();
90  virtual double ObliqueLineResolution();
91  virtual double ObliqueSampleResolution();
92  virtual double ObliqueDetectorResolution();
93 
94  virtual double parentLine() const;
95  virtual double parentSample() const;
96 
97  virtual void subSpacecraftPoint(double &lat, double &lon);
98  virtual void subSpacecraftPoint(double &lat, double &lon, double line, double sample);
99  virtual void subSolarPoint(double &lat, double &lon);
100 
101  virtual double PhaseAngle() const;
102  virtual double EmissionAngle() const;
103  virtual double IncidenceAngle() const;
104 
105  virtual SpicePosition *sunPosition() const;
106  virtual SpicePosition *instrumentPosition() const;
107  virtual SpiceRotation *bodyRotation() const;
108  virtual SpiceRotation *instrumentRotation() const;
109 
110  virtual void instrumentBodyFixedPosition(double p[3]) const;
111  virtual void sunPosition(double p[3]) const;
112  virtual double SolarDistance() const;
113 
114  virtual double SlantDistance() const;
115  virtual double targetCenterDistance() const;
116 
117  virtual double RightAscension();
118  virtual double Declination();
119 
120  std::vector<int> getParameterIndices(csm::param::Set paramSet) const;
121  std::vector<int> getParameterIndices(csm::param::Type paramType) const;
122  std::vector<int> getParameterIndices(QStringList paramList) const;
123  void applyParameterCorrection(int index, double correction);
124  double getParameterCovariance(int index1, int index2);
125  QString getParameterName(int index);
126  QString getParameterUnits(int index);
127  double getParameterValue(int index);
128 
129  std::vector<double> getSensorPartials(int index, SurfacePoint groundPoint);
130  virtual std::vector<double> GroundPartials(SurfacePoint groundPoint);
131  virtual std::vector<double> GroundPartials();
132 
133  QString getModelState() const;
134 
135  protected:
136  void setTarget(Pvl label);
137 
138  std::vector<double> sensorPositionBodyFixed() const;
139  std::vector<double> sensorPositionBodyFixed(double line, double sample) const;
140 
141  virtual void computeSolarLongitude(iTime et);
142 
143  private:
144  void init(Cube &cube, QString pluginName, QString modelName, QString stateString);
145 
146  csm::RasterGM *m_model;
147  iTime m_refTime;
148 
149  void isisToCsmPixel(double line, double sample, csm::ImageCoord &csmPixel) const;
150  void csmToIsisPixel(csm::ImageCoord csmPixel, double &line, double &sample) const;
151  csm::EcefCoord isisToCsmGround(const SurfacePoint &groundPt) const;
152  SurfacePoint csmToIsisGround(const csm::EcefCoord &groundPt) const;
153 
154  virtual std::vector<double> ImagePartials(SurfacePoint groundPoint);
155  virtual std::vector<double> ImagePartials();
156  };
157 };
158 #endif
Isis::CSMCamera::computeSolarLongitude
virtual void computeSolarLongitude(iTime et)
Computes the solar longitude for the given ephemeris time.
Definition: CSMCamera.cpp:1098
Isis::Spice::radii
void radii(Distance r[3]) const
Returns the radii of the body in km.
Definition: Spice.cpp:930
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::CSMCamera::targetCenterDistance
virtual double targetCenterDistance() const
Calculates and returns the distance from the spacecraft to the target center at the currently set tim...
Definition: CSMCamera.cpp:820
Displacement.h
Isis::CSMCamera::PixelIfovOffsets
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel.
Definition: CSMCamera.cpp:1011
FileName.h
Isis::CSMCamera::sunPosition
virtual SpicePosition * sunPosition() const
Get the SpicePosition object that contains the state information for the sun in J2000.
Definition: CSMCamera.cpp:1039
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::Spice::m_et
iTime * m_et
Ephemeris time (read NAIF documentation for a detailed description)
Definition: Spice.h:382
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::CSMCamera::getSensorPartials
std::vector< double > getSensorPartials(int index, SurfacePoint groundPoint)
Definition: CSMCamera.cpp:918
Isis::SpicePosition
Obtain SPICE position information for a body.
Definition: SpicePosition.h:173
Isis::CSMCamera::SpkCenterId
virtual int SpkCenterId() const
SPK Center ID - 6 (Saturn)
Definition: CSMCamera.h:66
Isis::Target::shape
ShapeModel * shape() const
Return the shape.
Definition: Target.cpp:655
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Isis::ShapeModel::clearSurfacePoint
virtual void clearSurfacePoint()
Clears or resets the current surface point.
Definition: ShapeModel.cpp:386
Isis::CSMCamera::ObliqueDetectorResolution
virtual double ObliqueDetectorResolution()
Compute the oblique detector resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:424
Isis::CSMCamera::getParameterCovariance
double getParameterCovariance(int index1, int index2)
Get the covariance between two parameters.
Definition: CSMCamera.cpp:913
Isis::SurfacePoint::GetX
Displacement GetX() const
Definition: SurfacePoint.cpp:1436
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::CSMCamera::IncidenceAngle
virtual double IncidenceAngle() const
Compute the incidence angle at the currently set ground point.
Definition: CSMCamera.cpp:778
Isis::Displacement::Meters
@ Meters
The distance is being specified in meters.
Definition: Displacement.h:40
QList< QPointF >
Isis::Camera::p_childLine
double p_childLine
Line value for child.
Definition: Camera.h:502
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::Target::setRadii
void setRadii(std::vector< Distance > radii)
Sets the radii of the body.
Definition: Target.cpp:615
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
SpecialPixel.h
Isis::CSMCamera::instrumentRotation
virtual SpiceRotation * instrumentRotation() const
Get the SpiceRotation object the contains the orientation of the sensor relative to J2000.
Definition: CSMCamera.cpp:1084
Isis::Camera::Sample
virtual double Sample() const
Returns the current sample number.
Definition: Camera.cpp:2690
Isis::CSMCamera::ObliqueSampleResolution
virtual double ObliqueSampleResolution()
Compute the oblique sample resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:409
Isis::ShapeModel::setHasIntersection
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
Definition: ShapeModel.cpp:554
Isis::Target::setSpice
void setSpice(Spice *spice)
Set the Spice pointer for the Target.
Definition: Target.cpp:647
Isis::CSMCamera::SetImage
virtual bool SetImage(const double sample, const double line)
Set the image sample and line for the Camera Model and then compute the corresponding image time,...
Definition: CSMCamera.cpp:123
Target.h
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::CSMCamera::applyParameterCorrection
void applyParameterCorrection(int index, double correction)
Adjust the value of a parameter.
Definition: CSMCamera.cpp:901
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
Isis::AlphaCube::AlphaLine
double AlphaLine(double betaLine)
Returns an alpha line given a beta line.
Definition: AlphaCube.h:109
Isis::CSMCamera::SolarDistance
virtual double SolarDistance() const
Computes the distance to the sun from the currently set ground point.
Definition: CSMCamera.cpp:1111
Isis::CSMCamera::EmissionAngle
virtual double EmissionAngle() const
Compute the emission angle at the currently set ground point.
Definition: CSMCamera.cpp:768
Longitude.h
Isis::ShapeModel::name
QString name() const
Gets the shape name.
Definition: ShapeModel.cpp:543
NaifStatus.h
Isis::CSMCamera::subSpacecraftPoint
virtual void subSpacecraftPoint(double &lat, double &lon)
Get the latitude and longitude of the sub-spacecraft point at the currently set time.
Definition: CSMCamera.cpp:510
Isis::CSMCamera::SlantDistance
virtual double SlantDistance() const
Compute the slant distance from the sensor to the ground point at the currently set time.
Definition: CSMCamera.cpp:798
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::SurfacePoint::GetZ
Displacement GetZ() const
Definition: SurfacePoint.cpp:1450
CameraDetectorMap.h
Isis::CSMCamera::GroundPartials
virtual std::vector< double > GroundPartials()
Compute the partial derivatives of the sample, line with respect to the x, y, z coordinates of the gr...
Definition: CSMCamera.cpp:622
Isis::AlphaCube::AlphaSample
double AlphaSample(double betaSample)
Returns an alpha sample given a beta sample.
Definition: AlphaCube.h:121
Isis::SurfacePoint::GetLatitude
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Definition: SurfacePoint.cpp:1665
Isis::CSMCamera::PhaseAngle
virtual double PhaseAngle() const
Compute the phase angle at the currently set ground point.
Definition: CSMCamera.cpp:749
Isis::Sensor::GetSurfacePoint
SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
Definition: Sensor.cpp:255
Isis::Camera
Definition: Camera.h:236
Isis::ShapeModel::intersectSurface
virtual bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)=0
Isis::CSMCamera::bodyRotation
virtual SpiceRotation * bodyRotation() const
Get the SpiceRotation object the contains the orientation of the target body relative to J2000.
Definition: CSMCamera.cpp:1069
Isis::LinearAlgebra::Matrix
boost::numeric::ublas::matrix< double > Matrix
Definition for an Isis::LinearAlgebra::Matrix of doubles.
Definition: LinearAlgebra.h:100
QStringList
IString.h
Isis::CSMCamera::LineResolution
virtual double LineResolution()
Compute the line resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:337
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::CSMCamera::getParameterValue
double getParameterValue(int index)
Get the value of a parameter.
Definition: CSMCamera.cpp:947
Isis::CSMCamera::ObliqueLineResolution
virtual double ObliqueLineResolution()
Compute the oblique line resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:394
Isis::AlphaCube::BetaLine
double BetaLine(double alphaLine)
Returns a beta line given an alpha line.
Definition: AlphaCube.h:133
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::Spice::target
virtual Target * target() const
Returns a pointer to the target object.
Definition: Spice.cpp:1368
Isis::CSMCamera::parentLine
virtual double parentLine() const
Returns the currently set parent line for the camera model.
Definition: CSMCamera.cpp:437
Isis::CSMCamera::setTime
virtual void setTime(const iTime &time)
Set the time and update the sensor position and orientation.
Definition: CSMCamera.cpp:982
Isis::Distance::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Distance.h:45
Isis::Displacement
Displacement is a signed length, usually in meters.
Definition: Displacement.h:31
Isis::CSMCamera::setTarget
void setTarget(Pvl label)
Set the Target object for the camera model.
Definition: CSMCamera.cpp:657
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Latitude.h
Isis::CSMCamera::DetectorResolution
virtual double DetectorResolution()
Compute the detector resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:371
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::CSMCamera::CkReferenceId
virtual int CkReferenceId() const
CK Reference ID - J2000.
Definition: CSMCamera.h:58
Isis::Camera::CameraType
CameraType
This enum defines the types of cameras supported in this class.
Definition: Camera.h:357
Isis::CSMCamera::SetGround
virtual bool SetGround(Latitude latitude, Longitude longitude)
Set the latitude and longitude for the Camera Model and then compute the corresponding image time,...
Definition: CSMCamera.cpp:228
Isis::SurfacePoint::Valid
bool Valid() const
Definition: SurfacePoint.cpp:947
Isis::CSMCamera::~CSMCamera
~CSMCamera()
Destroys the CSMCamera object.
Definition: CSMCamera.h:33
Isis::CSMCamera::subSolarPoint
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
Definition: CSMCamera.cpp:998
Isis::CSMCamera::SpkReferenceId
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
Definition: CSMCamera.h:74
Isis::Blob::getBuffer
char * getBuffer()
Get the internal data buff of the Blob.
Definition: Blob.cpp:546
Isis::Blob::Label
PvlObject & Label()
Accessor method that returns a PvlObject containing the Blob label.
Definition: Blob.cpp:151
SurfacePoint.h
Blob.h
Isis::Camera::p_childSample
double p_childSample
Sample value for child.
Definition: Camera.h:501
CameraDistortionMap.h
Isis::CSMCamera::GetCameraType
virtual CameraType GetCameraType() const
The CSM camera needs a bogus type for now.
Definition: CSMCamera.h:40
Isis::Distance::isValid
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:192
Isis::CSMCamera::SetUniversalGround
virtual bool SetUniversalGround(const double latitude, const double longitude)
Set the latitude and longitude for the Camera Model and then compute the corresponding image time,...
Definition: CSMCamera.cpp:193
Isis::CSMCamera::CkFrameId
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
Definition: CSMCamera.h:50
Isis::LinearAlgebra::pseudoinverse
static Matrix pseudoinverse(const Matrix &matrix)
Returns the pseudoinverse of a matrix.
Definition: LinearAlgebra.cpp:339
Isis::CSMCamera::parentSample
virtual double parentSample() const
Returns the currently set parent sample for the camera model.
Definition: CSMCamera.cpp:449
Isis::Camera::p_alphaCube
AlphaCube * p_alphaCube
A pointer to the AlphaCube.
Definition: Camera.h:503
CameraFocalPlaneMap.h
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Spice::m_target
Target * m_target
Target of the observation.
Definition: Spice.h:381
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
Isis::CSMCamera::Declination
virtual double Declination()
Computes the Declination of the currently set image coordinate.
Definition: CSMCamera.cpp:1139
Isis::SurfacePoint::GetLongitude
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Definition: SurfacePoint.cpp:1685
Camera.h
Isis::AlphaCube::BetaSample
double BetaSample(double alphaSample)
Returns a beta sample given an alpha sample.
Definition: AlphaCube.h:145
Isis::Camera::Csm
@ Csm
Community Sensor Model Camera.
Definition: Camera.h:364
Isis::CSMCamera::getModelState
QString getModelState() const
Get the CSM Model state string to re-create the CSM Model.
Definition: CSMCamera.cpp:969
Isis::Blob::Size
int Size() const
Accessor method that returns the number of bytes in the blob data.
Definition: Blob.cpp:142
Isis::Displacement::kilometers
double kilometers() const
Get the displacement in kilometers.
Definition: Displacement.cpp:94
Isis::Camera::p_pointComputed
bool p_pointComputed
Flag showing if Sample/Line has been computed.
Definition: Camera.h:505
Isis::CSMCamera::getParameterIndices
std::vector< int > getParameterIndices(csm::param::Set paramSet) const
Get the indices of the parameters that belong to a set.
Definition: CSMCamera.cpp:836
IException.h
Isis::CSMCamera::CSMCamera
CSMCamera(Cube &cube)
Constructor for an ISIS Camera model that uses a Community Sensor Model (CSM) for the principal trans...
Definition: CSMCamera.cpp:56
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::CSMCamera::getParameterUnits
QString getParameterUnits(int index)
Get the units of the parameter at a particular index.
Definition: CSMCamera.cpp:959
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
CSMCamera.h
Isis::ShapeModel
Define shapes and provide utilities for Isis targets.
Definition: ShapeModel.h:62
Isis::Camera::m_instrumentNameShort
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:497
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
LinearAlgebra.h
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::CSMCamera::sensorPositionBodyFixed
std::vector< double > sensorPositionBodyFixed() const
Get the position of the sensor in the body fixed coordinate system at the currently set time.
Definition: CSMCamera.cpp:475
Isis::CSMCamera::getParameterName
QString getParameterName(int index)
Get the name of the parameter.
Definition: CSMCamera.cpp:935
Isis::iTime::setUtc
void setUtc(QString utcString)
Definition: iTime.cpp:432
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Isis::CSMCamera::instrumentBodyFixedPosition
virtual void instrumentBodyFixedPosition(double p[3]) const
Get the position of the sensor in the body fixed coordinate system at the currently set time.
Definition: CSMCamera.cpp:461
Isis::ShapeModel::hasIntersection
bool hasIntersection()
Returns intersection status.
Definition: ShapeModel.cpp:368
Isis::PvlObject::findKeyword
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
Isis::CSMCamera
Definition: CSMCamera.h:25
Isis::CSMCamera::instrumentPosition
virtual SpicePosition * instrumentPosition() const
Get the SpicePosition object the contains the state information for the sensor in J2000.
Definition: CSMCamera.cpp:1054
iTime.h
Constants.h
Isis::Camera::Line
virtual double Line() const
Returns the current line number.
Definition: Camera.cpp:2710
Distance.h
Isis::Blob
Definition: Blob.h:51
Isis::Sensor::m_lookB
SpiceDouble m_lookB[3]
Look direction in body fixed.
Definition: Sensor.h:239
Isis::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
Isis::Target
This class is used to create and store valid Isis targets.
Definition: Target.h:63
Isis::Displacement::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Displacement.h:42
Isis::CSMCamera::SampleResolution
virtual double SampleResolution()
Compute the sample resolution in meters per pixel for the current set point.
Definition: CSMCamera.cpp:354
Isis::CSMCamera::RightAscension
virtual double RightAscension()
Computes the Right Ascension of the currently set image coordinate.
Definition: CSMCamera.cpp:1125
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
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
CameraSkyMap.h
Isis::Sensor::LocalRadius
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition: Sensor.cpp:267
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::SpiceRotation
Obtain SPICE rotation information for a body.
Definition: SpiceRotation.h:209