Isis 3 Programmer Reference
Camera.h
1#ifndef Camera_h
2#define Camera_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include "Sensor.h"
11
12#include <QList>
13#include <QPointF>
14#include <QString>
15
16#include "AlphaCube.h"
17
18namespace Isis {
19 class Angle;
20 class CameraDetectorMap;
21 class CameraFocalPlaneMap;
22 class CameraDistortionMap;
23 class CameraGroundMap;
24 class CameraSkyMap;
25 class Distance;
26 class Latitude;
27 class Longitude;
28 class Projection;
29 class SurfacePoint;
30
236 class Camera : public Sensor {
237 public:
238 // constructors
239 Camera(Cube &cube);
240
241 // destructor
243 virtual ~Camera();
244
245 // Methods
246 virtual bool SetImage(const double sample, const double line);
247 virtual bool SetImage(const double sample, const double line, const double deltaT);
248
249 virtual bool SetUniversalGround(const double latitude, const double longitude);
250 virtual bool SetUniversalGround(const double latitude, const double longitude,
251 const double radius);
252 virtual bool SetGround(Latitude latitude, Longitude longitude);
253 virtual bool SetGround(const SurfacePoint & surfacePt);
254 virtual bool SetRightAscensionDeclination(const double ra, const double dec);
255
256 void LocalPhotometricAngles(Angle & phase, Angle & incidence,
257 Angle & emission, bool &success);
258 void Slope(double &slope, bool &success);
259
260 void GetLocalNormal(double normal[3]);
261
262 bool HasProjection();
263 virtual bool IsBandIndependent();
264 int ReferenceBand() const;
265 bool HasReferenceBand() const;
266 virtual void SetBand(const int band);
267 virtual double Sample() const;
268 virtual int Band() const;
269 virtual double Line() const;
270
271 bool GroundRange(double &minlat, double &maxlat, double &minlon,
272 double &maxlon, Pvl &pvl);
273 bool ringRange(double &minRingRadius, double &maxRingRadius,
274 double &minRingLongitude, double &maxRingLongitude, Pvl &pvl);
276
277 virtual double PixelResolution();
278 virtual double LineResolution();
279 virtual double SampleResolution();
280 virtual double DetectorResolution();
281
282 virtual double ObliqueDetectorResolution(bool useLocal = true);
283 virtual double ObliqueSampleResolution(bool useLocal = true);
284 virtual double ObliqueLineResolution(bool useLocal = true);
285 virtual double ObliquePixelResolution(bool useLocal = true);
286
287
288 virtual double resolution();
289 double LowestImageResolution();
290 double HighestImageResolution();
293
294 void BasicMapping(Pvl &map);
295 void basicRingMapping(Pvl &map);
296
297 double FocalLength() const;
298 double PixelPitch() const;
299 virtual double exposureDuration() const;
300 virtual double exposureDuration(const double sample,
301 const double line,
302 const int band = -1) const;
303 virtual QList<QPointF> PixelIfovOffsets();
304
305 int Samples() const;
306 int Lines() const;
307 int Bands() const;
308 int ParentLines() const;
309 int ParentSamples() const;
310
312
313 bool RaDecRange(double &minra, double &maxra,
314 double &mindec, double &maxdec);
315 double RaDecResolution();
316
322
323 QString instrumentId();
324
325 QString instrumentNameLong() const;
326 QString instrumentNameShort() const;
327 QString spacecraftNameLong() const;
328 QString spacecraftNameShort() const;
329
330 void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting = true);
333 void SetGroundMap(CameraGroundMap *map);
334 void SetSkyMap(CameraSkyMap *map);
335
336 double NorthAzimuth();
337 double SunAzimuth();
338 double SpacecraftAzimuth();
339 double OffNadirAngle();
340
341 static double GroundAzimuth(double glat, double glon, double slat,
342 double slon);
343
344 void IgnoreProjection(bool ignore);
345
346 void LoadCache();
347 std::pair< double, double > StartEndEphemerisTimes();
348 int CacheSize(double startTime, double endTime);
349
350
351 void GetGeometricTilingHint(int &startSize, int &endSize);
352
353 bool InCube();
354
367
375 virtual CameraType GetCameraType() const = 0;
376
408 virtual int CkFrameId() const = 0;
409
441 virtual int CkReferenceId() const = 0;
442
473 virtual int SpkReferenceId() const = 0;
474 virtual int SpkTargetId() const;
475 virtual int SpkCenterId() const;
476
477
478 protected:
479
480 void SetFocalLength(double v);
481 void SetPixelPitch(double v);
482
483 void SetFocalLength();
484 void SetPixelPitch();
485
486 void SetGeometricTilingHint(int startSize = 128, int endSize = 8);
487
488 // These 2 classes need to be friends of the Camera class because
489 // of the way Radar works - there is no set focal length for the
490 // instrument, so the focal length needs to be set each time the
491 // slant range changes.
492 friend class RadarGroundMap;
493 friend class RadarSlantRangeMap;
494
496
501
503 double p_childLine;
505
507
508 private:
510 void ringRangeResolution();
511 double ComputeAzimuth(const double lat, const double lon);
513 // SetImage helper functions:
514 // bool SetImageNoProjection(const double sample, const double line);
515 bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape);
516 bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape);
517
518
521
522 double p_minlat;
523 double p_maxlat;
524 double p_minlon;
525 double p_maxlon;
526 double p_minres;
527 double p_maxres;
530 double p_minlon180;
531 double p_maxlon180;
534
535
539
541
544
545 double p_mindec;
546 double p_maxdec;
547 double p_minra;
548 double p_maxra;
549 double p_minra180;
550 double p_maxra180;
553
562
563
570
575
576 };
577};
578
579#endif
This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group.
Definition AlphaCube.h:46
Defines an angle and provides unit conversions.
Definition Angle.h:45
Convert between parent image coordinates and detector coordinates.
Distort/undistort focal plane coordinates.
Convert between distorted focal plane and detector coordinates.
Convert between undistorted focal plane and ground coordinates.
double NorthAzimuth()
Returns the North Azimuth.
Definition Camera.cpp:1927
std::pair< double, double > StartEndEphemerisTimes()
Calculates the start and end ephemeris times.
Definition Camera.cpp:2509
virtual double SampleResolution()
Returns the sample resolution at the current position in meters.
Definition Camera.cpp:640
QString m_spacecraftNameLong
Full spacecraft name.
Definition Camera.h:499
double p_maxRingLongitude180
The maximum ring longitude in the 180 domain.
Definition Camera.h:559
static double GroundAzimuth(double glat, double glon, double slat, double slon)
Computes and returns the ground azimuth between the ground point and another point of interest,...
Definition Camera.cpp:2267
AlphaCube * p_alphaCube
A pointer to the AlphaCube.
Definition Camera.h:504
double p_mindec
The minimum declination.
Definition Camera.h:545
Projection * p_projection
A pointer to the Projection.
Definition Camera.h:542
void GroundRangeResolution()
Computes the ground range and min/max resolution.
Definition Camera.cpp:752
double p_maxres
The maximum resolution.
Definition Camera.h:527
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition Camera.cpp:3093
double p_maxobliqueres
The maximum oblique resolution.
Definition Camera.h:529
double p_focalLength
The focal length, in units of millimeters.
Definition Camera.h:519
bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape)
Sets the sample/line values of the image to get the lat/lon values for a Skymap Projected image.
Definition Camera.cpp:357
double p_minra
The minimum right ascension.
Definition Camera.h:547
bool p_raDecRangeComputed
Flag showing if the raDec range has been computed successfully.
Definition Camera.h:552
virtual ~Camera()
Destroys the Camera Object.
Definition Camera.cpp:110
int ParentLines() const
Returns the number of lines in the parent alphacube.
Definition Camera.cpp:2836
void SetSkyMap(CameraSkyMap *map)
Sets the Sky Map.
Definition Camera.cpp:2431
virtual int SpkReferenceId() const =0
Provides reference frame for instruments SPK NAIF kernel.
virtual double DetectorResolution()
Returns the detector resolution at the current position in meters.
Definition Camera.cpp:622
double LowestObliqueImageResolution()
Returns the lowest/worst oblique resolution in the entire image.
Definition Camera.cpp:732
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Definition Camera.cpp:1968
CameraSkyMap * p_skyMap
A pointer to the SkyMap.
Definition Camera.h:569
CameraDetectorMap * DetectorMap()
Returns a pointer to the CameraDetectorMap object.
Definition Camera.cpp:2876
double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
Definition Camera.cpp:3067
double p_maxra
The maxumum right ascension.
Definition Camera.h:548
virtual int CkReferenceId() const =0
Provides the NAIF reference code for an instruments CK kernel.
virtual double Line() const
Returns the current line number.
Definition Camera.cpp:2740
void GetGeometricTilingHint(int &startSize, int &endSize)
This will get the geometric tiling hint; these values are typically used for ProcessRubberSheet::SetT...
Definition Camera.cpp:2635
double RaDecResolution()
Returns the RaDec resolution.
Definition Camera.cpp:1883
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
Definition Camera.cpp:2955
CameraDetectorMap * p_detectorMap
A pointer to the DetectorMap.
Definition Camera.h:567
Camera(Cube &cube)
Constructs the Camera object.
Definition Camera.cpp:56
bool IntersectsLongitudeDomain(Pvl &pvl)
Checks whether the ground range intersects the longitude domain or not.
Definition Camera.cpp:1176
double SunAzimuth()
Returns the Sun Azimuth.
Definition Camera.cpp:1954
double PixelPitch() const
Returns the pixel pitch.
Definition Camera.cpp:2772
double p_minobliqueres
The minimum oblique resolution.
Definition Camera.h:528
double p_minres
The minimum resolution.
Definition Camera.h:526
int ReferenceBand() const
Returns the reference band.
Definition Camera.cpp:2689
double p_maxlon180
The maximum longitude in the 180 domain.
Definition Camera.h:531
double p_maxRingRadius
The maximum ring radius.
Definition Camera.h:555
CameraSkyMap * SkyMap()
Returns a pointer to the CameraSkyMap object.
Definition Camera.cpp:2896
virtual int CkFrameId() const =0
Provides the NAIF frame code for an instruments CK kernel.
bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape)
Sets the sample/line values of the image to get the lat/lon values for a Map Projected image.
Definition Camera.cpp:296
int p_referenceBand
The reference band.
Definition Camera.h:540
QString m_instrumentId
The InstrumentId as it appears on the cube.
Definition Camera.h:495
double p_minRingLongitude180
The minimum ring longitude in the 180 domain.
Definition Camera.h:558
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition Camera.cpp:2846
virtual double ObliquePixelResolution(bool useLocal=true)
Returns the oblique pixel resolution at the current position in meters/pixel.
Definition Camera.cpp:696
void BasicMapping(Pvl &map)
Writes the basic mapping group to the specified Pvl.
Definition Camera.cpp:1367
int Lines() const
Returns the number of lines in the image.
Definition Camera.cpp:2816
CameraType
This enum defines the types of cameras supported in this class.
Definition Camera.h:358
@ PushFrame
Push Frame Camera.
Definition Camera.h:360
@ Framing
Framing Camera.
Definition Camera.h:359
@ Radar
Radar Camera.
Definition Camera.h:362
@ LineScan
Line Scan Camera.
Definition Camera.h:361
@ Csm
Community Sensor Model Camera.
Definition Camera.h:365
@ Point
Point Camera.
Definition Camera.h:363
@ RollingShutter
RollingShutter.
Definition Camera.h:364
int p_geometricTilingEndSize
The ideal geometric tile size to end with when projecting.
Definition Camera.h:574
virtual double Sample() const
Returns the current sample number.
Definition Camera.cpp:2720
void ringRangeResolution()
Analogous to above GroundRangeResolution method.
Definition Camera.cpp:993
QString spacecraftNameLong() const
This method returns the full spacecraft name.
Definition Camera.cpp:2936
bool p_groundRangeComputed
Flag showing if ground range was computed successfully.
Definition Camera.h:533
virtual double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Definition Camera.cpp:681
bool ringRange(double &minRingRadius, double &maxRingRadius, double &minRingLongitude, double &maxRingLongitude, Pvl &pvl)
Analogous to the above Ground Range method.
Definition Camera.cpp:1297
double OffNadirAngle()
Return the off nadir angle in degrees.
Definition Camera.cpp:2229
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition Camera.cpp:156
void SetGeometricTilingHint(int startSize=128, int endSize=8)
This method sets the best geometric tiling size for projecting from this camera model.
Definition Camera.cpp:2584
virtual double LineResolution()
Returns the line resolution at the current position in meters.
Definition Camera.cpp:660
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition Camera.cpp:1422
QString instrumentNameLong() const
This method returns the full instrument name.
Definition Camera.cpp:2916
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition Camera.cpp:1429
double FocalLength() const
Returns the focal length.
Definition Camera.cpp:2762
virtual int Band() const
Returns the current band.
Definition Camera.cpp:2730
void SetDetectorMap(CameraDetectorMap *map)
Sets the Detector Map.
Definition Camera.cpp:2402
double p_maxlat
The maximum latitude.
Definition Camera.h:523
int p_samples
The number of samples in the image.
Definition Camera.h:536
bool HasProjection()
Checks to see if the camera object has a projection.
Definition Camera.cpp:2668
int p_lines
The number of lines in the image.
Definition Camera.h:537
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
Definition Camera.cpp:2649
double p_minlat
The minimum latitude.
Definition Camera.h:522
double p_childSample
Sample value for child.
Definition Camera.h:502
void LoadCache()
This loads the spice cache big enough for this image.
Definition Camera.cpp:2450
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:382
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
double ComputeAzimuth(const double lat, const double lon)
Computes the image azimuth value from your current position (origin) to a point of interest specified...
Definition Camera.cpp:2074
QString instrumentNameShort() const
This method returns the shortened instrument name.
Definition Camera.cpp:2926
bool p_pointComputed
Flag showing if Sample/Line has been computed.
Definition Camera.h:506
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
Definition Camera.cpp:2387
virtual double ObliqueLineResolution(bool useLocal=true)
Returns the oblique line resolution at the current position in meters.
Definition Camera.cpp:672
double p_minra180
The minimum right ascension in the 180 domain.
Definition Camera.h:549
bool p_ignoreProjection
Whether or no to ignore the Projection.
Definition Camera.h:543
QString m_instrumentNameShort
Shortened instrument name.
Definition Camera.h:498
CameraFocalPlaneMap * p_focalPlaneMap
A pointer to the FocalPlaneMap.
Definition Camera.h:566
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
Definition Camera.cpp:1653
void GetLocalNormal(double normal[3])
This method will find the local normal at the current (sample, line) and set it to the passed in arra...
Definition Camera.cpp:1499
QString instrumentId()
This method returns the InstrumentId as it appears in the cube.
Definition Camera.cpp:2906
CameraGroundMap * p_groundMap
A pointer to the GroundMap.
Definition Camera.h:568
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition Camera.cpp:2856
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
Definition Camera.cpp:721
virtual bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:403
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
Definition Camera.cpp:2946
double HighestObliqueImageResolution()
Returns the highest/best oblique resolution in the entire image.
Definition Camera.cpp:743
virtual int SpkTargetId() const
Provides target code for instruments SPK NAIF kernel.
Definition Camera.cpp:2993
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition Camera.h:500
bool p_ringRangeComputed
Flag showing if ring range was computed successfully.
Definition Camera.h:561
double p_minlon
The minimum longitude.
Definition Camera.h:524
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
Definition Camera.cpp:2679
virtual double ObliqueSampleResolution(bool useLocal=true)
Returns the oblique sample resolution at the current position in m.
Definition Camera.cpp:650
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
Definition Camera.cpp:1193
double p_maxRingLongitude
The maximum ring longitude (azimuth)
Definition Camera.h:557
int p_bands
The number of bands in the image.
Definition Camera.h:538
virtual double ObliqueDetectorResolution(bool useLocal=true)
This method returns the Oblique Detector Resolution if the Look Vector intersects the target and if t...
Definition Camera.cpp:583
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
Definition Camera.cpp:2417
bool RaDecRange(double &minra, double &maxra, double &mindec, double &maxdec)
Computes the RaDec range.
Definition Camera.cpp:1741
double p_minRingLongitude
The minimum ring longitude (azimuth)
Definition Camera.h:556
CameraDistortionMap * p_distortionMap
A pointer to the DistortionMap.
Definition Camera.h:565
double p_maxdec
The maximum declination.
Definition Camera.h:546
double p_minRingRadius
The minimum ring radius.
Definition Camera.h:554
void basicRingMapping(Pvl &map)
Writes the basic mapping group for ring plane to the specified Pvl.
Definition Camera.cpp:1396
int CacheSize(double startTime, double endTime)
This method calculates the spice cache size.
Definition Camera.cpp:2557
void Slope(double &slope, bool &success)
Calculates the slope at the current point by computing the angle between the local surface normal and...
Definition Camera.cpp:1706
double p_maxra180
The maximum right ascension in the 180 domain.
Definition Camera.h:550
bool HasReferenceBand() const
Checks to see if the Camera object has a reference band.
Definition Camera.cpp:2700
bool RawFocalPlanetoImage()
Computes the image coordinate for the current universal ground point.
Definition Camera.cpp:457
double p_pixelPitch
The pixel pitch, in millimeters per pixel.
Definition Camera.h:520
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
Definition Camera.cpp:710
int Samples() const
Returns the number of samples in the image.
Definition Camera.cpp:2806
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel, which defaults to the (pixel pitch * summing mod...
Definition Camera.cpp:2785
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition Camera.cpp:2866
virtual bool SetRightAscensionDeclination(const double ra, const double dec)
Sets the right ascension declination.
Definition Camera.cpp:1446
double p_minlon180
The minimum longitude in the 180 domain.
Definition Camera.h:530
void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting=true)
Sets the Distortion Map.
Definition Camera.cpp:2372
int p_childBand
Band value for child.
Definition Camera.h:564
double p_childLine
Line value for child.
Definition Camera.h:503
virtual double resolution()
Returns the resolution of the camera.
Definition Camera.cpp:2750
virtual void SetBand(const int band)
Virtual method that sets the band number.
Definition Camera.cpp:2710
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition Camera.cpp:2886
virtual int SpkCenterId() const
Provides the center of motion body for SPK NAIF kernel.
Definition Camera.cpp:3035
QString m_instrumentNameLong
Full instrument name.
Definition Camera.h:497
double p_maxlon
The maximum longitude.
Definition Camera.h:525
int p_geometricTilingStartSize
The ideal geometric tile size to start with when projecting.
Definition Camera.h:572
int Bands() const
Returns the number of bands in the image.
Definition Camera.cpp:2826
Convert between undistorted focal plane and ra/dec coordinates.
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
Base class for Map Projections.
Definition Projection.h:155
Container for cube-like labels.
Definition Pvl.h:119
Convert between undistorted focal plane coordinate (slant range) and ground coordinates.
Convert between radar ground range and slant range.
Class for computing sensor ground coordinates.
Definition Sensor.h:170
Define shapes and provide utilities for Isis targets.
Definition ShapeModel.h:66
This class defines a body-fixed surface point.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16