Isis Developer Reference
CSMCamera.h
Go to the documentation of this file.
1#ifndef CSMCamera_h
2#define CSMCamera_h
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
24namespace 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
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
76 virtual QList<QPointF> PixelIfovOffsets();
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 virtual bool SetRightAscensionDeclination(const double ra, const double dec);
85 virtual void setTime(const iTime &time);
86 virtual bool SetLookDirection(const std::vector<double> lookB);
87 virtual double CelestialNorthClockAngle();
88
89 virtual double LineResolution();
90 virtual double SampleResolution();
91 virtual double DetectorResolution();
92 virtual double ObliqueLineResolution(bool useLocal = true);
93 virtual double ObliqueSampleResolution(bool useLocal = true);
94 virtual double ObliqueDetectorResolution(bool useLocal = true);
95
96 virtual double parentLine() const;
97 virtual double parentSample() const;
98
99 virtual void subSpacecraftPoint(double &lat, double &lon);
100 virtual void subSpacecraftPoint(double &lat, double &lon, double line, double sample);
101 virtual void subSolarPoint(double &lat, double &lon);
102
103 virtual double PhaseAngle() const;
104 virtual double EmissionAngle() const;
105 virtual double IncidenceAngle() const;
106
107 virtual SpicePosition *sunPosition() const;
108 virtual SpicePosition *instrumentPosition() const;
109 virtual SpiceRotation *bodyRotation() const;
110 virtual SpiceRotation *instrumentRotation() const;
111
112 virtual void instrumentBodyFixedPosition(double p[3]) const;
113 virtual void sunPosition(double p[3]) const;
114 virtual double SolarDistance() const;
115
116 virtual double SlantDistance() const;
117 virtual double targetCenterDistance() const;
118
119 virtual double RightAscension();
120 virtual double Declination();
121
122 std::vector<int> getParameterIndices(csm::param::Set paramSet) const;
123 std::vector<int> getParameterIndices(csm::param::Type paramType) const;
124 std::vector<int> getParameterIndices(QStringList paramList) const;
125 void applyParameterCorrection(int index, double correction);
126 double getParameterCovariance(int index1, int index2);
127 QString getParameterName(int index);
128 QString getParameterUnits(int index);
129 double getParameterValue(int index);
130
131 std::vector<double> getSensorPartials(int index, SurfacePoint groundPoint);
132 virtual std::vector<double> GroundPartials(SurfacePoint groundPoint);
133 virtual std::vector<double> GroundPartials();
134
135 QString getModelState() const;
136
137 protected:
138 void setTarget(Pvl label);
139
140 std::vector<double> sensorPositionBodyFixed() const;
141 std::vector<double> sensorPositionBodyFixed(double line, double sample) const;
142
143 virtual void computeSolarLongitude(iTime et);
144
145 private:
146 void init(Cube &cube, QString pluginName, QString modelName, QString stateString);
147
148 csm::RasterGM *m_model;
149 iTime m_refTime;
150 SpiceRotation *m_bodyRotation = NULL;
151 SpiceRotation *m_instrumentRotation = NULL;
152 Longitude *m_solarLongitude = NULL;
153
154 void isisToCsmPixel(double line, double sample, csm::ImageCoord &csmPixel) const;
155 void csmToIsisPixel(csm::ImageCoord csmPixel, double &line, double &sample) const;
156 csm::EcefCoord isisToCsmGround(const SurfacePoint &groundPt) const;
157 SurfacePoint csmToIsisGround(const csm::EcefCoord &groundPt) const;
158
159 virtual std::vector<double> ImagePartials(SurfacePoint groundPoint);
160 virtual std::vector<double> ImagePartials();
161 };
162};
163#endif
Definition CSMCamera.h:25
QString getModelState() const
Get the CSM Model state string to re-create the CSM Model.
Definition CSMCamera.cpp:1089
virtual void computeSolarLongitude(iTime et)
Computes the solar longitude for the given ephemeris time.
Definition CSMCamera.cpp:1217
virtual double DetectorResolution()
Compute the detector resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:487
std::vector< int > getParameterIndices(csm::param::Set paramSet) const
Get the indices of the parameters that belong to a set.
Definition CSMCamera.cpp:956
CSMCamera(Cube &cube)
Constructor for an ISIS Camera model that uses a Community Sensor Model (CSM) for the principal trans...
Definition CSMCamera.cpp:62
void setTarget(Pvl label)
Set the Target object for the camera model.
Definition CSMCamera.cpp:777
QString getParameterUnits(int index)
Get the units of the parameter at a particular index.
Definition CSMCamera.cpp:1079
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
Definition CSMCamera.h:50
double getParameterCovariance(int index1, int index2)
Get the covariance between two parameters.
Definition CSMCamera.cpp:1033
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:130
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel.
Definition CSMCamera.cpp:1131
virtual void setTime(const iTime &time)
Set the time and update the sensor position and orientation.
Definition CSMCamera.cpp:1102
virtual double parentLine() const
Returns the currently set parent line for the camera model.
Definition CSMCamera.cpp:557
virtual SpicePosition * sunPosition() const
Get the SpicePosition object that contains the state information for the sun in J2000.
Definition CSMCamera.cpp:1159
~CSMCamera()
Destroys the CSMCamera object.
Definition CSMCamera.h:33
double getParameterValue(int index)
Get the value of a parameter.
Definition CSMCamera.cpp:1067
virtual double SampleResolution()
Compute the sample resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:466
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:630
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:201
virtual double LineResolution()
Compute the line resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:445
virtual double ObliqueLineResolution(bool useLocal=true)
Compute the oblique line resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:514
virtual CameraType GetCameraType() const
The CSM camera needs a bogus type for now.
Definition CSMCamera.h:40
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
Definition CSMCamera.h:74
virtual double IncidenceAngle() const
Compute the incidence angle at the currently set ground point.
Definition CSMCamera.cpp:898
virtual double RightAscension()
Computes the Right Ascension of the currently set image coordinate.
Definition CSMCamera.cpp:1241
std::vector< double > getSensorPartials(int index, SurfacePoint groundPoint)
Definition CSMCamera.cpp:1038
virtual int CkReferenceId() const
CK Reference ID - J2000.
Definition CSMCamera.h:58
QString getParameterName(int index)
Get the name of the parameter.
Definition CSMCamera.cpp:1055
virtual double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
Definition CSMCamera.cpp:336
virtual double Declination()
Computes the Declination of the currently set image coordinate.
Definition CSMCamera.cpp:1259
void applyParameterCorrection(int index, double correction)
Adjust the value of a parameter.
Definition CSMCamera.cpp:1021
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
Definition CSMCamera.cpp:1118
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:742
virtual bool SetRightAscensionDeclination(const double ra, const double dec)
Given the ra/dec compute the look direction.
Definition CSMCamera.cpp:265
virtual SpicePosition * instrumentPosition() const
Get the SpicePosition object the contains the state information for the sensor in J2000.
Definition CSMCamera.cpp:1174
virtual double PhaseAngle() const
Compute the phase angle at the currently set ground point.
Definition CSMCamera.cpp:869
virtual double ObliqueSampleResolution(bool useLocal=true)
Compute the oblique sample resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:529
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:595
virtual double EmissionAngle() const
Compute the emission angle at the currently set ground point.
Definition CSMCamera.cpp:888
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:581
virtual SpiceRotation * instrumentRotation() const
Get the SpiceRotation object the contains the orientation of the sensor relative to J2000.
Definition CSMCamera.cpp:1203
virtual double parentSample() const
Returns the currently set parent sample for the camera model.
Definition CSMCamera.cpp:569
virtual double ObliqueDetectorResolution(bool useLocal=true)
Compute the oblique detector resolution in meters per pixel for the current set point.
Definition CSMCamera.cpp:544
virtual SpiceRotation * bodyRotation() const
Get the SpiceRotation object the contains the orientation of the target body relative to J2000.
Definition CSMCamera.cpp:1188
virtual double SolarDistance() const
Computes the distance to the sun from the currently set ground point.
Definition CSMCamera.cpp:1230
virtual double SlantDistance() const
Compute the slant distance from the sensor to the ground point at the currently set time.
Definition CSMCamera.cpp:918
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:236
virtual bool SetLookDirection(const std::vector< double > lookB)
Sets the look direction of the spacecraft.
Definition CSMCamera.cpp:306
virtual int SpkCenterId() const
SPK Center ID - 6 (Saturn)
Definition CSMCamera.h:66
virtual double targetCenterDistance() const
Calculates and returns the distance from the spacecraft to the target center at the currently set tim...
Definition CSMCamera.cpp:940
Definition Camera.h:236
CameraType
This enum defines the types of cameras supported in this class.
Definition Camera.h:358
@ Csm
Community Sensor Model Camera.
Definition Camera.h:365
IO Handler for Isis Cubes.
Definition Cube.h:168
This class is designed to encapsulate the concept of a Latitude.
Definition Latitude.h:51
This class is designed to encapsulate the concept of a Longitude.
Definition Longitude.h:40
Container for cube-like labels.
Definition Pvl.h:119
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
Obtain SPICE position information for a body.
Definition SpicePosition.h:176
Obtain SPICE rotation information for a body.
Definition SpiceRotation.h:208
This class defines a body-fixed surface point.
Definition SurfacePoint.h:132
Parse and return pieces of a time string.
Definition iTime.h:65
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16