Isis 3.0
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;
520  double p_minobliqueres;
521  double p_maxobliqueres;
522  double p_minlon180;
523  double p_maxlon180;
524  bool p_groundRangeComputed;
527  bool p_pointComputed;
528 
529  int p_samples;
530  int p_lines;
531  int p_bands;
532 
533  int p_referenceBand;
534 
535  Projection *p_projection;
536  bool p_ignoreProjection;
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;
547  double p_minRingRadius;
548  double p_maxRingRadius;
549  double p_minRingLongitude;
550  double p_maxRingLongitude;
551  double p_minRingLongitude180;
552  double p_maxRingLongitude180;
553  bool p_ringRangeComputed;
556  AlphaCube *p_alphaCube;
557  double p_childSample;
558  double p_childLine;
559  int p_childBand;
560  CameraDistortionMap *p_distortionMap;
561  CameraFocalPlaneMap *p_focalPlaneMap;
562  CameraDetectorMap *p_detectorMap;
563  CameraGroundMap *p_groundMap;
564  CameraSkyMap *p_skyMap;
565 
566  int p_geometricTilingStartSize;
568  int p_geometricTilingEndSize;
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
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
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
Definition: Camera.cpp:2966
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
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
Definition: Camera.cpp:2456
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:494
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
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
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 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
bool IntersectsLongitudeDomain(Pvl &pvl)
Checks whether the ground range intersects the longitude domain or not.
Definition: Camera.cpp:1239
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
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3113
Definition: Camera.h:240
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.
Definition: CameraDetectorMap.h:63
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
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.
Definition: CameraGroundMap.h:85
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:100
Convert between undistorted focal plane coordinate (slant range) and ground coordinates.
Definition: RadarGroundMap.h:108
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
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
Definition: Camera.cpp:784
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
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
Definition: Camera.cpp:2426
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.
Definition: CameraDistortionMap.h:54
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
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 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 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
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
Definition: Camera.cpp:2711
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
Definition: Camera.cpp:773
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2804
double Line()
Returns the current line number.
Definition: Camera.cpp:2772
Convert between radar ground range and slant range.
Definition: RadarSlantRangeMap.h:66
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 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
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
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
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition: Camera.cpp:2876
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.
int Lines() const
Returns the number of lines in the image.
Definition: Camera.cpp:2846
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
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