Isis 3.0 Programmer Reference
Back | Home
Camera.h
Go to the documentation of this file.
1 #ifndef Camera_h
2 #define Camera_h
3 
26 #include "Sensor.h"
27 
28 #include <QList>
29 #include <QPointF>
30 #include <QString>
31 
32 #include "AlphaCube.h"
33 
34 namespace Isis {
35  class Angle;
36  class CameraDetectorMap;
37  class CameraFocalPlaneMap;
38  class CameraDistortionMap;
39  class CameraGroundMap;
40  class CameraSkyMap;
41  class Distance;
42  class Latitude;
43  class Longitude;
44  class Projection;
45  class SurfacePoint;
46 
240  class Camera : public Sensor {
241  public:
242  // constructors
243  Camera(Cube &cube);
244 
245  // destructor
247  virtual ~Camera();
248 
249  // Methods
250  bool SetImage(const double sample, const double line);
251  virtual bool SetImage(const double sample, const double line, const double deltaT);
252 
253  bool SetUniversalGround(const double latitude, const double longitude);
254  bool SetUniversalGround(const double latitude, const double longitude,
255  const double radius);
256  bool SetGround(Latitude latitude, Longitude longitude);
257  bool SetGround(const SurfacePoint & surfacePt);
258  bool SetRightAscensionDeclination(const double ra, const double dec);
259 
260  void LocalPhotometricAngles(Angle & phase, Angle & incidence,
261  Angle & emission, bool &success);
262 
263  void GetLocalNormal(double normal[3]);
264 
265  bool HasProjection();
266  virtual bool IsBandIndependent();
267  int ReferenceBand() const;
268  bool HasReferenceBand() const;
269  virtual void SetBand(const int band);
270  double Sample();
271  int Band();
272  double Line();
273 
274  bool GroundRange(double &minlat, double &maxlat, double &minlon,
275  double &maxlon, Pvl &pvl);
276  bool ringRange(double &minRingRadius, double &maxRingRadius,
277  double &minRingLongitude, double &maxRingLongitude, Pvl &pvl);
278  bool IntersectsLongitudeDomain(Pvl &pvl);
279 
280  double PixelResolution();
281  double LineResolution();
282  double SampleResolution();
283  double DetectorResolution();
284 
285  double ObliqueDetectorResolution();
286  double ObliqueSampleResolution();
287  double ObliqueLineResolution();
288  double ObliquePixelResolution();
289 
290 
291  virtual double resolution();
292  double LowestImageResolution();
293  double HighestImageResolution();
296 
297  void BasicMapping(Pvl &map);
298  void basicRingMapping(Pvl &map);
299 
300  double FocalLength() const;
301  double PixelPitch() const;
302  virtual double exposureDuration() const;
303  virtual double exposureDuration(const double sample,
304  const double line,
305  const int band = -1) const;
307 
308  int Samples() const;
309  int Lines() const;
310  int Bands() const;
311  int ParentLines() const;
312  int ParentSamples() const;
313 
314  double CelestialNorthClockAngle();
315 
316  bool RaDecRange(double &minra, double &maxra,
317  double &mindec, double &maxdec);
318  double RaDecResolution();
319 
324  CameraSkyMap *SkyMap();
325 
326  QString instrumentNameLong() const;
327  QString instrumentNameShort() const;
328  QString spacecraftNameLong() const;
329  QString spacecraftNameShort() const;
330 
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 
347  void LoadCache();
348  std::pair< double, double > StartEndEphemerisTimes();
349  int CacheSize(double startTime, double endTime);
350 
351 
352  void GetGeometricTilingHint(int &startSize, int &endSize);
353 
354  bool InCube();
355 
359  enum CameraType {
365  };
366 
374  virtual CameraType GetCameraType() const = 0;
375 
407  virtual int CkFrameId() const = 0;
408 
440  virtual int CkReferenceId() const = 0;
441 
472  virtual int SpkReferenceId() const = 0;
473  virtual int SpkTargetId() const;
474  virtual int SpkCenterId() const;
475 
476 
477  protected:
478 
479  void SetFocalLength(double v);
480  void SetPixelPitch(double v);
481 
482  void SetFocalLength();
483  void SetPixelPitch();
484 
485  void SetGeometricTilingHint(int startSize = 128, int endSize = 8);
486 
487  // These 2 classes need to be friends of the Camera class because
488  // of the way Radar works - there is no set focal length for the
489  // instrument, so the focal length needs to be set each time the
490  // slant range changes.
491  friend class RadarGroundMap;
492  friend class RadarSlantRangeMap;
493 
498 
499 
500  private:
501  void GroundRangeResolution();
502  void ringRangeResolution();
503  double ComputeAzimuth(const double lat, const double lon);
504  bool RawFocalPlanetoImage();
505  // SetImage helper functions:
506  // bool SetImageNoProjection(const double sample, const double line);
507  bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape);
508  bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape);
509 
510 
511  double p_focalLength;
512  double p_pixelPitch;
513 
514  double p_minlat;
515  double p_maxlat;
516  double p_minlon;
517  double p_maxlon;
518  double p_minres;
519  double p_maxres;
522  double p_minlon180;
523  double p_maxlon180;
524  bool p_groundRangeComputed;
528 
529  int p_samples;
530  int p_lines;
531  int p_bands;
532 
534 
537 
538  double p_mindec;
539  double p_maxdec;
540  double p_minra;
541  double p_maxra;
542  double p_minra180;
543  double p_maxra180;
544  bool p_raDecRangeComputed;
553  bool p_ringRangeComputed;
557  double p_childSample;
558  double p_childLine;
565 
571  };
572 };
573 
574 #endif
575 
576 
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:86
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
Definition: Camera.cpp:1717
double p_maxlat
The maximum latitude.
Definition: Camera.h:515
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1485
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
CameraDetectorMap * DetectorMap()
Returns a pointer to the CameraDetectorMap object.
Definition: Camera.cpp:2906
Push Frame Camera.
Definition: Camera.h:361
int CacheSize(double startTime, double endTime)
This method calculates the spice cache size.
Definition: Camera.cpp:2589
void SetSkyMap(CameraSkyMap *map)
Sets the Sky Map.
Definition: Camera.cpp:2470
Line Scan Camera.
Definition: Camera.h:362
virtual int SpkReferenceId() const =0
Provides reference frame for instruments SPK NAIF kernel.
double ObliqueLineResolution()
Returns the oblique line resolution at the current position in meters.
Definition: Camera.cpp:734
double p_mindec
The minimum declination.
Definition: Camera.h:538
double p_minlon
The minimum longitude.
Definition: Camera.h:516
double p_minobliqueres
The minimum oblique resolution.
Definition: Camera.h:520
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
Definition: Camera.cpp:2966
int p_referenceBand
The reference band.
Definition: Camera.h:533
double p_minra180
The minimum right ascension in the 180 domain.
Definition: Camera.h:542
double SunAzimuth()
Returns the Sun Azimuth.
Definition: Camera.cpp:1995
bool ringRange(double &minRingRadius, double &maxRingRadius, double &minRingLongitude, double &maxRingLongitude, Pvl &pvl)
Analogous to the above Ground Range method.
Definition: Camera.cpp:1360
void SetDetectorMap(CameraDetectorMap *map)
Sets the Detector Map.
Definition: Camera.cpp:2441
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition: Camera.cpp:2886
Camera(Cube &cube)
Constructs the Camera object.
Definition: Camera.cpp:70
virtual int SpkTargetId() const
Provides target code for instruments SPK NAIF kernel.
Definition: Camera.cpp:3013
int p_lines
The number of lines in the image.
Definition: Camera.h:530
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
Definition: Camera.cpp:2456
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:494
double p_maxRingLongitude
The maximum ring longitude (azimuth)
Definition: Camera.h:550
QString spacecraftNameLong() const
This method returns the full spacecraft name.
Definition: Camera.cpp:2956
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Definition: Camera.cpp:2009
bool SetRightAscensionDeclination(const double ra, const double dec)
Sets the right ascension declination.
Definition: Camera.cpp:1509
bool HasProjection()
Checks to see if the camera object has a projection.
Definition: Camera.cpp:2700
double p_maxra180
The maximum right ascension in the 180 domain.
Definition: Camera.h:543
void basicRingMapping(Pvl &map)
Writes the basic mapping group for ring plane to the specified Pvl.
Definition: Camera.cpp:1459
double OffNadirAngle()
Return the off nadir angle in degrees.
Definition: Camera.cpp:2271
virtual double resolution()
Returns the resolution of the camera.
Definition: Camera.cpp:2782
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
Definition: Camera.cpp:2681
int ReferenceBand() const
Returns the reference band.
Definition: Camera.cpp:2721
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1492
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:59
Class for computing sensor ground coordinates.
Definition: Sensor.h:179
double p_maxlon180
The maximum longitude in the 180 domain.
Definition: Camera.h:523
double p_focalLength
The focal length, in units of millimeters.
Definition: Camera.h:511
virtual int CkReferenceId() const =0
Provides the NAIF reference code for an instruments CK kernel.
double ObliquePixelResolution()
Returns the oblique pixel resolution at the current position in meters/pixel.
Definition: Camera.cpp:759
virtual ~Camera()
Destroys the Camera Object.
Definition: Camera.cpp:120
double p_maxobliqueres
The maximum oblique resolution.
Definition: Camera.h:521
CameraDistortionMap * p_distortionMap
A pointer to the DistortionMap.
Definition: Camera.h:560
double ObliqueSampleResolution()
Returns the oblique sample resolution at the current position in m.
Definition: Camera.cpp:711
double FocalLength() const
Returns the focal length.
Definition: Camera.cpp:2794
double p_minRingLongitude180
The minimum ring longitude in the 180 domain.
Definition: Camera.h:551
bool IntersectsLongitudeDomain(Pvl &pvl)
Checks whether the ground range intersects the longitude domain or not.
Definition: Camera.cpp:1239
bool RawFocalPlanetoImage()
Computes the image coordinate for the current universal ground point.
Definition: Camera.cpp:468
double p_maxres
The maximum resolution.
Definition: Camera.h:519
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:2313
bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:413
int Bands() const
Returns the number of bands in the image.
Definition: Camera.cpp:2856
This class is used to rewrite the &quot;alpha&quot; keywords out of the AlphaCube group or Instrument group...
Definition: AlphaCube.h:61
CameraSkyMap * SkyMap()
Returns a pointer to the CameraSkyMap object.
Definition: Camera.cpp:2926
Radar Camera.
Definition: Camera.h:363
bool HasReferenceBand() const
Checks to see if the Camera object has a reference band.
Definition: Camera.cpp:2732
double p_minRingLongitude
The minimum ring longitude (azimuth)
Definition: Camera.h:549
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3113
int p_bands
The number of bands in the image.
Definition: Camera.h:531
bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:392
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:166
Convert between parent image coordinates and detector coordinates.
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
bool p_ignoreProjection
Whether or no to ignore the Projection.
Definition: Camera.h:536
CameraDetectorMap * p_detectorMap
A pointer to the DetectorMap.
Definition: Camera.h:562
QString instrumentNameLong() const
This method returns the full instrument name.
Definition: Camera.cpp:2936
Base class for Map Projections.
Definition: Projection.h:169
Convert between undistorted focal plane and ground coordinates.
double p_minlat
The minimum latitude.
Definition: Camera.h:514
Convert between distorted focal plane and detector coordinates.
Convert between undistorted focal plane coordinate (slant range) and ground coordinates.
CameraType
This enum defines the types of cameras supported in this class.
Definition: Camera.h:359
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:495
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition: Camera.cpp:2916
int Samples() const
Returns the number of samples in the image.
Definition: Camera.cpp:2836
void ringRangeResolution()
Analogous to above GroundRangeResolution method.
Definition: Camera.cpp:1056
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
Definition: Camera.cpp:784
double p_pixelPitch
The pixel pitch, in millimeters per pixel.
Definition: Camera.h:512
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
Definition: Camera.cpp:1256
bool RaDecRange(double &minra, double &maxra, double &mindec, double &maxdec)
Computes the RaDec range.
Definition: Camera.cpp:1782
double Sample()
Returns the current sample number.
Definition: Camera.cpp:2752
CameraFocalPlaneMap * p_focalPlaneMap
A pointer to the FocalPlaneMap.
Definition: Camera.h:561
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
Definition: Camera.cpp:2426
int p_childBand
Band value for child.
Definition: Camera.h:559
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:1562
double HighestObliqueImageResolution()
Returns the highest/best oblique resolution in the entire image.
Definition: Camera.cpp:806
Distort/undistort focal plane coordinates.
double NorthAzimuth()
Returns the North Azimuth.
Definition: Camera.cpp:1968
std::pair< double, double > StartEndEphemerisTimes()
Calculates the start and end ephemeris times.
Definition: Camera.cpp:2546
double p_childSample
Sample value for child.
Definition: Camera.h:557
AlphaCube * p_alphaCube
!&lt; Flag showing if ring range was computed successfully.
Definition: Camera.h:556
void BasicMapping(Pvl &map)
Writes the basic mapping group to the specified Pvl.
Definition: Camera.cpp:1430
Container for cube-like labels.
Definition: Pvl.h:135
QString instrumentNameShort() const
This method returns the shortened instrument name.
Definition: Camera.cpp:2946
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition: Camera.cpp:2896
int Band()
Returns the current band.
Definition: Camera.cpp:2762
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2489
Define shapes and provide utilities for Isis3 targets.
Definition: ShapeModel.h:68
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:2116
double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
Definition: Camera.cpp:3087
Defines an angle and provides unit conversions.
Definition: Angle.h:58
double p_maxra
The maxumum right ascension.
Definition: Camera.h:541
double LowestObliqueImageResolution()
Returns the lowest/worst oblique resolution in the entire image.
Definition: Camera.cpp:795
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:496
int p_samples
The number of samples in the image.
Definition: Camera.h:529
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
Definition: Camera.cpp:2711
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:306
double p_maxlon
The maximum longitude.
Definition: Camera.h:517
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
Definition: Camera.cpp:773
CameraGroundMap * p_groundMap
A pointer to the GroundMap.
Definition: Camera.h:563
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2804
double p_maxRingLongitude180
The maximum ring longitude in the 180 domain.
Definition: Camera.h:552
double Line()
Returns the current line number.
Definition: Camera.cpp:2772
Convert between radar ground range and slant range.
double RaDecResolution()
Returns the RaDec resolution.
Definition: Camera.cpp:1924
double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Definition: Camera.cpp:744
double p_minres
The minimum resolution.
Definition: Camera.h:518
double p_minlon180
The minimum longitude in the 180 domain.
Definition: Camera.h:522
double p_minra
The minimum right ascension.
Definition: Camera.h:540
double LineResolution()
Returns the line resolution at the current position in meters.
Definition: Camera.cpp:722
void SetDistortionMap(CameraDistortionMap *map)
Sets the Distortion Map.
Definition: Camera.cpp:2411
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:47
Framing Camera.
Definition: Camera.h:360
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:497
Point Camera.
Definition: Camera.h:364
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
Definition: Camera.cpp:2975
double p_maxRingRadius
The maximum ring radius.
Definition: Camera.h:548
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel, which defaults to the (pixel pitch * summing mod...
Definition: Camera.cpp:2815
virtual int SpkCenterId() const
Provides the center of motion body for SPK NAIF kernel.
Definition: Camera.cpp:3055
int ParentLines() const
Returns the number of lines in the parent alphacube.
Definition: Camera.cpp:2866
Projection * p_projection
A pointer to the Projection.
Definition: Camera.h:535
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:2616
double p_minRingRadius
!&lt; Flag showing if the raDec range has been computed successfully.
Definition: Camera.h:547
double p_maxdec
The maximum declination.
Definition: Camera.h:539
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:367
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition: Camera.cpp:2876
int p_geometricTilingStartSize
The ideal geometric tile size to start with when projecting.
Definition: Camera.h:566
CameraSkyMap * p_skyMap
A pointer to the SkyMap.
Definition: Camera.h:564
double SampleResolution()
Returns the sample resolution at the current position in meters.
Definition: Camera.cpp:700
virtual void SetBand(const int band)
Virtual method that sets the band number.
Definition: Camera.cpp:2742
virtual int CkFrameId() const =0
Provides the NAIF frame code for an instruments CK kernel.
bool p_pointComputed
!&lt; Flag showing if ground range was computed successfully.
Definition: Camera.h:527
int Lines() const
Returns the number of lines in the image.
Definition: Camera.cpp:2846
double p_childLine
Line value for child.
Definition: Camera.h:558
void GetGeometricTilingHint(int &startSize, int &endSize)
This will get the geometric tiling hint; these values are typically used for ProcessRubberSheet::SetT...
Definition: Camera.cpp:2667
double DetectorResolution()
Returns the detector resolution at the current position in meters.
Definition: Camera.cpp:679
void GroundRangeResolution()
Computes the ground range and min/max resolution.
Definition: Camera.cpp:815
int p_geometricTilingEndSize
The ideal geometric tile size to end with when projecting.
Definition: Camera.h:568
double ObliqueDetectorResolution()
This function provides an improved estimate of the detector resolution (in meters) when the target is...
Definition: Camera.cpp:641
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:15:28