Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
Camera.h
Go to the documentation of this file.
1#ifndef Camera_h
2#define Camera_h
7
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 AlphaCube;
24 class CameraGroundMap;
25 class CameraSkyMap;
26 class Distance;
27 class Latitude;
28 class Longitude;
29 class Projection;
30 class SurfacePoint;
31
236
237 class Camera : public Sensor {
238 public:
239 // constructors
240 Camera(Cube &cube);
241
242 // destructor
244 virtual ~Camera();
245
246 // Methods
247 virtual bool SetImage(const double sample, const double line);
248 virtual bool SetImage(const double sample, const double line, const double deltaT);
249
250 virtual bool SetUniversalGround(const double latitude, const double longitude);
251 virtual bool SetUniversalGround(const double latitude, const double longitude,
252 const double radius);
253 virtual bool SetGround(Latitude latitude, Longitude longitude);
254 virtual bool SetGround(const SurfacePoint & surfacePt);
255 virtual bool SetRightAscensionDeclination(const double ra, const double dec);
256
257 void LocalPhotometricAngles(Angle & phase, Angle & incidence,
258 Angle & emission, bool &success);
259 void Slope(double &slope, bool &success);
260
261 void GetLocalNormal(double normal[3]);
262
263 bool HasProjection();
264 virtual bool IsBandIndependent();
265 int ReferenceBand() const;
266 bool HasReferenceBand() const;
267 virtual void SetBand(const int band);
268 virtual double Sample() const;
269 virtual int Band() const;
270 virtual double Line() const;
271
272 bool GroundRange(double &minlat, double &maxlat, double &minlon,
273 double &maxlon, Pvl &pvl);
274 bool ringRange(double &minRingRadius, double &maxRingRadius,
275 double &minRingLongitude, double &maxRingLongitude, Pvl &pvl);
276 bool IntersectsLongitudeDomain(Pvl &pvl);
277
278 virtual double PixelResolution();
279 virtual double LineResolution();
280 virtual double SampleResolution();
281 virtual double DetectorResolution();
282
283 virtual double ObliqueDetectorResolution(bool useLocal = true);
284 virtual double ObliqueSampleResolution(bool useLocal = true);
285 virtual double ObliqueLineResolution(bool useLocal = true);
286 virtual double ObliquePixelResolution(bool useLocal = true);
287
288
289 virtual double resolution();
290 double LowestImageResolution();
291 double HighestImageResolution();
294
295 void BasicMapping(Pvl &map);
296 void basicRingMapping(Pvl &map);
297
298 double FocalLength() const;
299 double PixelPitch() const;
300 virtual double exposureDuration() const;
301 virtual double exposureDuration(const double sample,
302 const double line,
303 const int band = -1) const;
305
306 int Samples() const;
307 int Lines() const;
308 int Bands() const;
309 int ParentLines() const;
310 int ParentSamples() const;
311
313
314 bool RaDecRange(double &minra, double &maxra,
315 double &mindec, double &maxdec);
316 double RaDecResolution();
317
323
324 QString instrumentId();
325
326 QString instrumentNameLong() const;
327 QString instrumentNameShort() const;
328 QString spacecraftNameLong() const;
329 QString spacecraftNameShort() const;
330
331 void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting = true);
334 void SetGroundMap(CameraGroundMap *map);
335 void SetSkyMap(CameraSkyMap *map);
336
337 double NorthAzimuth();
338 double SunAzimuth();
339 double SpacecraftAzimuth();
340 double OffNadirAngle();
341
342 static double GroundAzimuth(double glat, double glon, double slat,
343 double slon);
344
345 void IgnoreProjection(bool ignore);
346 bool isProjectionIgnored();
347
348 void LoadCache();
349 std::pair< double, double > StartEndEphemerisTimes();
350 int CacheSize(double startTime, double endTime);
351
352
353 void GetGeometricTilingHint(int &startSize, int &endSize);
354
355 bool InCube();
356
369
377 virtual CameraType GetCameraType() const = 0;
378
410 virtual int CkFrameId() const = 0;
411
443 virtual int CkReferenceId() const = 0;
444
475 virtual int SpkReferenceId() const = 0;
476 virtual int SpkTargetId() const;
477 virtual int SpkCenterId() const;
478
479
480 protected:
481
482 void SetFocalLength(double v);
483 void SetPixelPitch(double v);
484
485 void SetFocalLength();
486 void SetPixelPitch();
487
488 void SetGeometricTilingHint(int startSize = 128, int endSize = 8);
489
490 // These 2 classes need to be friends of the Camera class because
491 // of the way Radar works - there is no set focal length for the
492 // instrument, so the focal length needs to be set each time the
493 // slant range changes.
494 friend class RadarGroundMap;
495 friend class RadarSlantRangeMap;
496
498
503
505 double p_childLine;
507
509
510 private:
511 void GroundRangeResolution();
512 void ringRangeResolution();
513 double ComputeAzimuth(const double lat, const double lon);
514 bool RawFocalPlanetoImage();
515 // SetImage helper functions:
516 // bool SetImageNoProjection(const double sample, const double line);
517 bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape);
518 bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape);
519
520
521 double p_focalLength;
522 double p_pixelPitch;
523
524 double p_minlat;
525 double p_maxlat;
526 double p_minlon;
527 double p_maxlon;
528 double p_minres;
529 double p_maxres;
530 double p_minobliqueres;
531 double p_maxobliqueres;
532 double p_minlon180;
533 double p_maxlon180;
535 bool p_groundRangeComputed;
536
537
538 int p_samples;
539 int p_lines;
540 int p_bands;
541
542 int p_referenceBand;
543
544 Projection *p_projection;
545 bool p_ignoreProjection;
546
547 double p_mindec;
548 double p_maxdec;
549 double p_minra;
550 double p_maxra;
551 double p_minra180;
552 double p_maxra180;
554 bool p_raDecRangeComputed;
555
556 double p_minRingRadius;
557 double p_maxRingRadius;
558 double p_minRingLongitude;
559 double p_maxRingLongitude;
560 double p_minRingLongitude180;
561 double p_maxRingLongitude180;
563 bool p_ringRangeComputed;
564
565
566 int p_childBand;
567 CameraDistortionMap *p_distortionMap;
568 CameraFocalPlaneMap *p_focalPlaneMap;
569 CameraDetectorMap *p_detectorMap;
570 CameraGroundMap *p_groundMap;
571 CameraSkyMap *p_skyMap;
572
574 int p_geometricTilingStartSize;
576 int p_geometricTilingEndSize;
577
578 };
579};
580
581#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.
Definition CameraDetectorMap.h:47
Distort/undistort focal plane coordinates.
Definition CameraDistortionMap.h:41
Convert between distorted focal plane and detector coordinates.
Definition CameraFocalPlaneMap.h:84
Convert between undistorted focal plane and ground coordinates.
Definition CameraGroundMap.h:77
double NorthAzimuth()
Returns the North Azimuth.
Definition Camera.cpp:1907
std::pair< double, double > StartEndEphemerisTimes()
Calculates the start and end ephemeris times.
Definition Camera.cpp:2489
virtual double SampleResolution()
Returns the sample resolution at the current position in meters.
Definition Camera.cpp:620
QString m_spacecraftNameLong
Full spacecraft name.
Definition Camera.h:501
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:2247
AlphaCube * p_alphaCube
A pointer to the AlphaCube.
Definition Camera.h:506
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition Camera.cpp:3082
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:2816
void SetSkyMap(CameraSkyMap *map)
Sets the Sky Map.
Definition Camera.cpp:2411
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:602
double LowestObliqueImageResolution()
Returns the lowest/worst oblique resolution in the entire image.
Definition Camera.cpp:712
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Definition Camera.cpp:1948
CameraDetectorMap * DetectorMap()
Returns a pointer to the CameraDetectorMap object.
Definition Camera.cpp:2856
double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
Definition Camera.cpp:3056
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:2720
void GetGeometricTilingHint(int &startSize, int &endSize)
This will get the geometric tiling hint; these values are typically used for ProcessRubberSheet::SetT...
Definition Camera.cpp:2615
bool isProjectionIgnored()
Whether or not the camera is ignoring the Projection.
Definition Camera.cpp:2944
double RaDecResolution()
Returns the RaDec resolution.
Definition Camera.cpp:1863
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
Definition Camera.cpp:2935
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:1156
double SunAzimuth()
Returns the Sun Azimuth.
Definition Camera.cpp:1934
double PixelPitch() const
Returns the pixel pitch.
Definition Camera.cpp:2752
int ReferenceBand() const
Returns the reference band.
Definition Camera.cpp:2669
CameraSkyMap * SkyMap()
Returns a pointer to the CameraSkyMap object.
Definition Camera.cpp:2876
virtual int CkFrameId() const =0
Provides the NAIF frame code for an instruments CK kernel.
QString m_instrumentId
The InstrumentId as it appears on the cube.
Definition Camera.h:497
friend class RadarGroundMap
A friend class to calculate focal length.
Definition Camera.h:494
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition Camera.cpp:2826
virtual double ObliquePixelResolution(bool useLocal=true)
Returns the oblique pixel resolution at the current position in meters/pixel.
Definition Camera.cpp:676
void BasicMapping(Pvl &map)
Writes the basic mapping group to the specified Pvl.
Definition Camera.cpp:1347
int Lines() const
Returns the number of lines in the image.
Definition Camera.cpp:2796
CameraType
This enum defines the types of cameras supported in this class.
Definition Camera.h:360
@ PushFrame
Push Frame Camera.
Definition Camera.h:362
@ Framing
Framing Camera.
Definition Camera.h:361
@ Radar
Radar Camera.
Definition Camera.h:364
@ LineScan
Line Scan Camera.
Definition Camera.h:363
@ Csm
Community Sensor Model Camera.
Definition Camera.h:367
@ Point
Point Camera.
Definition Camera.h:365
@ RollingShutter
RollingShutter.
Definition Camera.h:366
virtual double Sample() const
Returns the current sample number.
Definition Camera.cpp:2700
QString spacecraftNameLong() const
This method returns the full spacecraft name.
Definition Camera.cpp:2916
virtual double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Definition Camera.cpp:661
bool ringRange(double &minRingRadius, double &maxRingRadius, double &minRingLongitude, double &maxRingLongitude, Pvl &pvl)
Analogous to the above Ground Range method.
Definition Camera.cpp:1277
double OffNadirAngle()
Return the off nadir angle in degrees.
Definition Camera.cpp:2209
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:2564
virtual double LineResolution()
Returns the line resolution at the current position in meters.
Definition Camera.cpp:640
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition Camera.cpp:1402
QString instrumentNameLong() const
This method returns the full instrument name.
Definition Camera.cpp:2896
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition Camera.cpp:1409
double FocalLength() const
Returns the focal length.
Definition Camera.cpp:2742
virtual int Band() const
Returns the current band.
Definition Camera.cpp:2710
void SetDetectorMap(CameraDetectorMap *map)
Sets the Detector Map.
Definition Camera.cpp:2382
bool HasProjection()
Checks to see if the camera object has a projection.
Definition Camera.cpp:2648
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
Definition Camera.cpp:2629
double p_childSample
Sample value for child.
Definition Camera.h:504
void LoadCache()
This loads the spice cache big enough for this image.
Definition Camera.cpp:2430
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:366
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
QString instrumentNameShort() const
This method returns the shortened instrument name.
Definition Camera.cpp:2906
bool p_pointComputed
Flag showing if Sample/Line has been computed.
Definition Camera.h:508
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
Definition Camera.cpp:2367
virtual double ObliqueLineResolution(bool useLocal=true)
Returns the oblique line resolution at the current position in meters.
Definition Camera.cpp:652
QString m_instrumentNameShort
Shortened instrument name.
Definition Camera.h:500
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
Definition Camera.cpp:1633
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:1479
friend class RadarSlantRangeMap
A friend class to calculate focal length.
Definition Camera.h:495
QString instrumentId()
This method returns the InstrumentId as it appears in the cube.
Definition Camera.cpp:2886
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition Camera.cpp:2836
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
Definition Camera.cpp:701
virtual bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:387
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
Definition Camera.cpp:2926
double HighestObliqueImageResolution()
Returns the highest/best oblique resolution in the entire image.
Definition Camera.cpp:723
virtual int SpkTargetId() const
Provides target code for instruments SPK NAIF kernel.
Definition Camera.cpp:2982
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition Camera.h:502
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
Definition Camera.cpp:2659
virtual double ObliqueSampleResolution(bool useLocal=true)
Returns the oblique sample resolution at the current position in m.
Definition Camera.cpp:630
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
Definition Camera.cpp:1173
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:563
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
Definition Camera.cpp:2397
bool RaDecRange(double &minra, double &maxra, double &mindec, double &maxdec)
Computes the RaDec range.
Definition Camera.cpp:1721
void basicRingMapping(Pvl &map)
Writes the basic mapping group for ring plane to the specified Pvl.
Definition Camera.cpp:1376
int CacheSize(double startTime, double endTime)
This method calculates the spice cache size.
Definition Camera.cpp:2537
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:1686
bool HasReferenceBand() const
Checks to see if the Camera object has a reference band.
Definition Camera.cpp:2680
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
Definition Camera.cpp:690
int Samples() const
Returns the number of samples in the image.
Definition Camera.cpp:2786
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel, which defaults to the (pixel pitch * summing mod...
Definition Camera.cpp:2765
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition Camera.cpp:2846
virtual bool SetRightAscensionDeclination(const double ra, const double dec)
Sets the right ascension declination.
Definition Camera.cpp:1426
void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting=true)
Sets the Distortion Map.
Definition Camera.cpp:2352
double p_childLine
Line value for child.
Definition Camera.h:505
virtual double resolution()
Returns the resolution of the camera.
Definition Camera.cpp:2730
virtual void SetBand(const int band)
Virtual method that sets the band number.
Definition Camera.cpp:2690
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition Camera.cpp:2866
virtual int SpkCenterId() const
Provides the center of motion body for SPK NAIF kernel.
Definition Camera.cpp:3024
QString m_instrumentNameLong
Full instrument name.
Definition Camera.h:499
int Bands() const
Returns the number of bands in the image.
Definition Camera.cpp:2806
Convert between undistorted focal plane and ra/dec coordinates.
Definition CameraSkyMap.h:31
IO Handler for Isis Cubes.
Definition Cube.h:168
Distance measurement, usually in meters.
Definition Distance.h:34
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:154
Sensor(Cube &cube)
Constructs a Sensor object and loads SPICE kernels using information from the label object.
Definition Sensor.cpp:45
Define shapes and provide utilities for Isis targets.
Definition ShapeModel.h:65
This class defines a body-fixed surface point.
Definition SurfacePoint.h:132
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16