Isis 3 Developer Reference
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 
249  class Camera : public Sensor {
250  public:
251  // constructors
252  Camera(Cube &cube);
253 
254  // destructor
256  virtual ~Camera();
257 
258  // Methods
259  bool SetImage(const double sample, const double line);
260  virtual bool SetImage(const double sample, const double line, const double deltaT);
261 
262  bool SetUniversalGround(const double latitude, const double longitude);
263  bool SetUniversalGround(const double latitude, const double longitude,
264  const double radius);
265  bool SetGround(Latitude latitude, Longitude longitude);
266  bool SetGround(const SurfacePoint & surfacePt);
267  bool SetRightAscensionDeclination(const double ra, const double dec);
268 
269  void LocalPhotometricAngles(Angle & phase, Angle & incidence,
270  Angle & emission, bool &success);
271 
272  void GetLocalNormal(double normal[3]);
273 
274  bool HasProjection();
275  virtual bool IsBandIndependent();
276  int ReferenceBand() const;
277  bool HasReferenceBand() const;
278  virtual void SetBand(const int band);
279  double Sample();
280  int Band();
281  double Line();
282 
283  bool GroundRange(double &minlat, double &maxlat, double &minlon,
284  double &maxlon, Pvl &pvl);
285  bool ringRange(double &minRingRadius, double &maxRingRadius,
286  double &minRingLongitude, double &maxRingLongitude, Pvl &pvl);
287  bool IntersectsLongitudeDomain(Pvl &pvl);
288 
289  double PixelResolution();
290  double LineResolution();
291  double SampleResolution();
292  double DetectorResolution();
293 
294  double ObliqueDetectorResolution();
295  double ObliqueSampleResolution();
296  double ObliqueLineResolution();
297  double ObliquePixelResolution();
298 
299 
300  virtual double resolution();
301  double LowestImageResolution();
302  double HighestImageResolution();
305 
306  void BasicMapping(Pvl &map);
307  void basicRingMapping(Pvl &map);
308 
309  double FocalLength() const;
310  double PixelPitch() const;
311  virtual double exposureDuration() const;
312  virtual double exposureDuration(const double sample,
313  const double line,
314  const int band = -1) const;
316 
317  int Samples() const;
318  int Lines() const;
319  int Bands() const;
320  int ParentLines() const;
321  int ParentSamples() const;
322 
323  double CelestialNorthClockAngle();
324 
325  bool RaDecRange(double &minra, double &maxra,
326  double &mindec, double &maxdec);
327  double RaDecResolution();
328 
333  CameraSkyMap *SkyMap();
334 
335  QString instrumentId();
336 
337  QString instrumentNameLong() const;
338  QString instrumentNameShort() const;
339  QString spacecraftNameLong() const;
340  QString spacecraftNameShort() const;
341 
342  void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting = true);
345  void SetGroundMap(CameraGroundMap *map);
346  void SetSkyMap(CameraSkyMap *map);
347 
348  double NorthAzimuth();
349  double SunAzimuth();
350  double SpacecraftAzimuth();
351  double OffNadirAngle();
352 
353  static double GroundAzimuth(double glat, double glon, double slat,
354  double slon);
355 
356  void IgnoreProjection(bool ignore);
357 
358  void LoadCache();
359  std::pair< double, double > StartEndEphemerisTimes();
360  int CacheSize(double startTime, double endTime);
361 
362 
363  void GetGeometricTilingHint(int &startSize, int &endSize);
364 
365  bool InCube();
366 
370  enum CameraType {
376  };
377 
385  virtual CameraType GetCameraType() const = 0;
386 
418  virtual int CkFrameId() const = 0;
419 
451  virtual int CkReferenceId() const = 0;
452 
483  virtual int SpkReferenceId() const = 0;
484  virtual int SpkTargetId() const;
485  virtual int SpkCenterId() const;
486 
487 
488  protected:
489 
490  void SetFocalLength(double v);
491  void SetPixelPitch(double v);
492 
493  void SetFocalLength();
494  void SetPixelPitch();
495 
496  void SetGeometricTilingHint(int startSize = 128, int endSize = 8);
497 
498  // These 2 classes need to be friends of the Camera class because
499  // of the way Radar works - there is no set focal length for the
500  // instrument, so the focal length needs to be set each time the
501  // slant range changes.
502  friend class RadarGroundMap;
503  friend class RadarSlantRangeMap;
504 
505  QString m_instrumentId;
506 
511 
512 
513  private:
514  void GroundRangeResolution();
515  void ringRangeResolution();
516  double ComputeAzimuth(const double lat, const double lon);
517  bool RawFocalPlanetoImage();
518  // SetImage helper functions:
519  // bool SetImageNoProjection(const double sample, const double line);
520  bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape);
521  bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape);
522 
523 
524  double p_focalLength;
525  double p_pixelPitch;
526 
527  double p_minlat;
528  double p_maxlat;
529  double p_minlon;
530  double p_maxlon;
531  double p_minres;
532  double p_maxres;
533  double p_minobliqueres;
534  double p_maxobliqueres;
535  double p_minlon180;
536  double p_maxlon180;
537 
538  bool p_groundRangeComputed;
539 
540  bool p_pointComputed;
541 
542  int p_samples;
543  int p_lines;
544  int p_bands;
545 
546  int p_referenceBand;
547 
548  Projection *p_projection;
549  bool p_ignoreProjection;
550 
551  double p_mindec;
552  double p_maxdec;
553  double p_minra;
554  double p_maxra;
555  double p_minra180;
556  double p_maxra180;
557 
558  bool p_raDecRangeComputed;
559 
560  double p_minRingRadius;
561  double p_maxRingRadius;
562  double p_minRingLongitude;
563  double p_maxRingLongitude;
564  double p_minRingLongitude180;
565  double p_maxRingLongitude180;
566 
567  bool p_ringRangeComputed;
568 
569  AlphaCube *p_alphaCube;
570  double p_childSample;
571  double p_childLine;
572  int p_childBand;
573  CameraDistortionMap *p_distortionMap;
574  CameraFocalPlaneMap *p_focalPlaneMap;
575  CameraDetectorMap *p_detectorMap;
576  CameraGroundMap *p_groundMap;
577  CameraSkyMap *p_skyMap;
578 
580  int p_geometricTilingStartSize;
582  int p_geometricTilingEndSize;
583 
584  };
585 };
586 
587 #endif
588 
589 
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:148
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
Definition: Camera.cpp:1661
QString instrumentNameShort() const
This method returns the shortened instrument name.
Definition: Camera.cpp:2908
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1430
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:2858
Push Frame Camera.
Definition: Camera.h:372
int CacheSize(double startTime, double endTime)
This method calculates the spice cache size.
Definition: Camera.cpp:2539
void SetSkyMap(CameraSkyMap *map)
Sets the Sky Map.
Definition: Camera.cpp:2413
Line Scan Camera.
Definition: Camera.h:373
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:679
virtual int SpkTargetId() const
Provides target code for instruments SPK NAIF kernel.
Definition: Camera.cpp:2975
double SunAzimuth()
Returns the Sun Azimuth.
Definition: Camera.cpp:1939
bool ringRange(double &minRingRadius, double &maxRingRadius, double &minRingLongitude, double &maxRingLongitude, Pvl &pvl)
Analogous to the above Ground Range method.
Definition: Camera.cpp:1305
void SetDetectorMap(CameraDetectorMap *map)
Sets the Detector Map.
Definition: Camera.cpp:2384
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition: Camera.cpp:2838
Camera(Cube &cube)
Constructs the Camera object.
Definition: Camera.cpp:70
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
Definition: Camera.cpp:2399
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:507
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Definition: Camera.cpp:1953
bool SetRightAscensionDeclination(const double ra, const double dec)
Sets the right ascension declination.
Definition: Camera.cpp:1454
bool HasProjection()
Checks to see if the camera object has a projection.
Definition: Camera.cpp:2650
void basicRingMapping(Pvl &map)
Writes the basic mapping group for ring plane to the specified Pvl.
Definition: Camera.cpp:1404
double OffNadirAngle()
Return the off nadir angle in degrees.
Definition: Camera.cpp:2214
virtual double resolution()
Returns the resolution of the camera.
Definition: Camera.cpp:2732
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
Definition: Camera.cpp:2631
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1437
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:63
Class for computing sensor ground coordinates.
Definition: Sensor.h:183
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:704
virtual ~Camera()
Destroys the Camera Object.
Definition: Camera.cpp:124
QString instrumentNameLong() const
This method returns the full instrument name.
Definition: Camera.cpp:2898
double ObliqueSampleResolution()
Returns the oblique sample resolution at the current position in m.
Definition: Camera.cpp:656
bool IntersectsLongitudeDomain(Pvl &pvl)
Checks whether the ground range intersects the longitude domain or not.
Definition: Camera.cpp:1184
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:2256
bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:417
int ParentLines() const
Returns the number of lines in the parent alphacube.
Definition: Camera.cpp:2818
This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group...
Definition: AlphaCube.h:62
CameraSkyMap * SkyMap()
Returns a pointer to the CameraSkyMap object.
Definition: Camera.cpp:2878
Radar Camera.
Definition: Camera.h:374
Definition: Camera.h:249
bool HasReferenceBand() const
Checks to see if the Camera object has a reference band.
Definition: Camera.cpp:2682
bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:396
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:170
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:64
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
Base class for Map Projections.
Definition: Projection.h:171
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:90
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:101
Convert between undistorted focal plane coordinate (slant range) and ground coordinates.
Definition: RadarGroundMap.h:111
CameraType
This enum defines the types of cameras supported in this class.
Definition: Camera.h:370
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:508
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition: Camera.cpp:2868
QString instrumentId()
This method returns the InstrumentId as it appears in the cube.
Definition: Camera.cpp:2888
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
Definition: Camera.cpp:729
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
Definition: Camera.cpp:1201
bool RaDecRange(double &minra, double &maxra, double &mindec, double &maxdec)
Computes the RaDec range.
Definition: Camera.cpp:1726
double Sample()
Returns the current sample number.
Definition: Camera.cpp:2702
QString m_instrumentId
The InstrumentId as it appears on the cube.
Definition: Camera.h:505
double FocalLength() const
Returns the focal length.
Definition: Camera.cpp:2744
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
Definition: Camera.cpp:2369
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:1507
double HighestObliqueImageResolution()
Returns the highest/best oblique resolution in the entire image.
Definition: Camera.cpp:751
QString spacecraftNameLong() const
This method returns the full spacecraft name.
Definition: Camera.cpp:2918
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:57
double NorthAzimuth()
Returns the North Azimuth.
Definition: Camera.cpp:1912
std::pair< double, double > StartEndEphemerisTimes()
Calculates the start and end ephemeris times.
Definition: Camera.cpp:2491
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2754
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition: Camera.cpp:2828
void BasicMapping(Pvl &map)
Writes the basic mapping group to the specified Pvl.
Definition: Camera.cpp:1375
Container for cube-like labels.
Definition: Pvl.h:135
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition: Camera.cpp:2848
int Band()
Returns the current band.
Definition: Camera.cpp:2712
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2432
Define shapes and provide utilities for Isis3 targets.
Definition: ShapeModel.h:78
double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
Definition: Camera.cpp:3049
Defines an angle and provides unit conversions.
Definition: Angle.h:62
double LowestObliqueImageResolution()
Returns the lowest/worst oblique resolution in the entire image.
Definition: Camera.cpp:740
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:509
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
Definition: Camera.cpp:2661
void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting=true)
Sets the Distortion Map.
Definition: Camera.cpp:2354
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
Definition: Camera.cpp:718
int Bands() const
Returns the number of bands in the image.
Definition: Camera.cpp:2808
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
Definition: Camera.cpp:2928
double Line()
Returns the current line number.
Definition: Camera.cpp:2722
int Lines() const
Returns the number of lines in the image.
Definition: Camera.cpp:2798
int Samples() const
Returns the number of samples in the image.
Definition: Camera.cpp:2788
Convert between radar ground range and slant range.
Definition: RadarSlantRangeMap.h:69
double RaDecResolution()
Returns the RaDec resolution.
Definition: Camera.cpp:1868
double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Definition: Camera.cpp:689
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
double LineResolution()
Returns the line resolution at the current position in meters.
Definition: Camera.cpp:667
virtual int SpkCenterId() const
Provides the center of motion body for SPK NAIF kernel.
Definition: Camera.cpp:3017
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:48
Framing Camera.
Definition: Camera.h:371
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:510
Point Camera.
Definition: Camera.h:375
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
Definition: Camera.cpp:2937
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel, which defaults to the (pixel pitch * summing mod...
Definition: Camera.cpp:2767
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3075
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:2566
int ReferenceBand() const
Returns the reference band.
Definition: Camera.cpp:2671
double SampleResolution()
Returns the sample resolution at the current position in meters.
Definition: Camera.cpp:645
virtual void SetBand(const int band)
Virtual method that sets the band number.
Definition: Camera.cpp:2692
virtual int CkFrameId() const =0
Provides the NAIF frame code for an instruments CK kernel.
void GetGeometricTilingHint(int &startSize, int &endSize)
This will get the geometric tiling hint; these values are typically used for ProcessRubberSheet::SetT...
Definition: Camera.cpp:2617
double DetectorResolution()
Returns the detector resolution at the current position in meters.
Definition: Camera.cpp:624
double ObliqueDetectorResolution()
This method returns the Oblique Detector Resolution if the Look Vector intersects the target and if t...
Definition: Camera.cpp:598
IO Handler for Isis Cubes.
Definition: Cube.h:170