USGS

Isis 3.0 Developer's Reference (API)

Home

Camera.h

Go to the documentation of this file.
00001 #ifndef Camera_h
00002 #define Camera_h
00003 
00026 #include "Sensor.h"
00027 #include "AlphaCube.h"
00028 
00029 namespace Isis {
00030   class Angle;
00031   class CameraDetectorMap;
00032   class CameraFocalPlaneMap;
00033   class CameraDistortionMap;
00034   class CameraGroundMap;
00035   class CameraSkyMap;
00036   class Distance;
00037   class Latitude;
00038   class Longitude;
00039   class Projection;
00040   class SurfacePoint;
00041 
00229   class Camera : public Sensor {
00230     public:
00231       // constructors
00232       Camera(Pvl &lab);
00233 
00234       // destructor
00236       virtual ~Camera();
00237 
00238       // Methods
00239       bool SetImage(const double sample, const double line);
00240       bool SetUniversalGround(const double latitude, const double longitude);
00241       bool SetUniversalGround(const double latitude, const double longitude,
00242                               const double radius);
00243       bool SetGround(Latitude latitude, Longitude longitude);
00244       bool SetGround(const SurfacePoint & surfacePt);
00245       bool SetRightAscensionDeclination(const double ra, const double dec);
00246 
00247       void LocalPhotometricAngles(Angle & phase, Angle & incidence,
00248                                   Angle & emission, bool &success);
00249 
00250       void GetLocalNormal(double normal[3]);
00251 
00252       bool HasProjection();
00253       virtual bool IsBandIndependent();
00254       int ReferenceBand() const;
00255       bool HasReferenceBand() const;
00256       virtual void SetBand(const int band);
00257       double Sample();
00258       int Band();
00259       double Line();
00260 
00261       bool GroundRange(double &minlat, double &maxlat,
00262                        double &minlon, double &maxlon, Pvl &pvl);
00263       bool IntersectsLongitudeDomain(Pvl &pvl);
00264 
00265       double PixelResolution();
00266       double LineResolution();
00267       double SampleResolution();
00268       double DetectorResolution();
00269 
00270       virtual double resolution();
00271       double LowestImageResolution();
00272       double HighestImageResolution();
00273 
00274       void BasicMapping(Pvl &map);
00275 
00276       double FocalLength() const;
00277       double PixelPitch() const;
00278       int Samples() const;
00279       int Lines() const;
00280       int Bands() const;
00281       int ParentLines() const;
00282       int ParentSamples() const;
00283 
00284       bool RaDecRange(double &minra, double &maxra,
00285                       double &mindec, double &maxdec);
00286       double RaDecResolution();
00287 
00288       CameraDistortionMap *DistortionMap();
00289       CameraFocalPlaneMap *FocalPlaneMap();
00290       CameraDetectorMap *DetectorMap();
00291       CameraGroundMap *GroundMap();
00292       CameraSkyMap *SkyMap();
00293 
00294       void SetDistortionMap(CameraDistortionMap *map);
00295       void SetFocalPlaneMap(CameraFocalPlaneMap *map);
00296       void SetDetectorMap(CameraDetectorMap *map);
00297       void SetGroundMap(CameraGroundMap *map);
00298       void SetSkyMap(CameraSkyMap *map);
00299 
00300       double NorthAzimuth();
00301       double SunAzimuth();
00302       double SpacecraftAzimuth();
00303       double OffNadirAngle();
00304 
00305       static double GroundAzimuth(double glat, double glon, double slat,
00306                                   double slon);
00307 
00308       void IgnoreProjection(bool ignore);
00309 
00310       void LoadCache();
00311       std::pair< double, double > StartEndEphemerisTimes();
00312       int CacheSize(double startTime, double endTime);
00313 
00314 
00315       void GetGeometricTilingHint(int &startSize, int &endSize);
00316 
00317       bool InCube();
00318 
00322       enum CameraType {
00323         Framing,    
00324         PushFrame,  
00325         LineScan,   
00326         Radar,      
00327         Point       
00328       };
00329 
00337       virtual CameraType GetCameraType() const = 0;
00338 
00372       virtual int CkFrameId() const = 0;
00373 
00406       virtual int CkReferenceId() const = 0;
00407 
00439       virtual int SpkReferenceId() const = 0;
00440       virtual int SpkTargetId() const;
00441       virtual int SpkCenterId() const;
00442 
00443 
00444     protected:
00445 
00446       void SetFocalLength(double v);
00447       void SetPixelPitch(double v);
00448 
00449       void SetFocalLength();
00450       void SetPixelPitch();
00451 
00452       void SetGeometricTilingHint(int startSize = 128, int endSize = 8);
00453 
00454       // These 2 classes need to be friends of the Camera class because
00455       // of the way Radar works - there is no set focal length for the
00456       // instrument, so the focal length needs to be set each time the
00457       // slant range changes.
00458       friend class RadarGroundMap;
00459       friend class RadarSlantRangeMap;
00460       
00461       
00462     private:
00463       double p_focalLength;                  
00464       double p_pixelPitch;                   
00465 
00466       void GroundRangeResolution();
00467       double p_minlat;                       
00468       double p_maxlat;                       
00469       double p_minlon;                       
00470       double p_maxlon;                       
00471       double p_minres;                       
00472       double p_maxres;                       
00473       double p_minlon180;                    
00474       double p_maxlon180;                    
00475       bool p_groundRangeComputed;            
00478       bool p_pointComputed;                  
00479 
00480       int p_samples;                         
00481       int p_lines;                           
00482       int p_bands;                           
00483 
00484       int p_referenceBand;                   
00485 
00486       Projection *p_projection;              
00487       bool p_ignoreProjection;               
00488 
00489       double p_mindec;                       
00490       double p_maxdec;                       
00491       double p_minra;                        
00492       double p_maxra;                        
00493       double p_minra180;                     
00494       double p_maxra180;                     
00495       bool p_raDecRangeComputed;             
00498       AlphaCube *p_alphaCube;          
00499       double p_childSample;                  
00500       double p_childLine;                    
00501       int p_childBand;                       
00502       CameraDistortionMap *p_distortionMap;  
00503       CameraFocalPlaneMap *p_focalPlaneMap;  
00504       CameraDetectorMap *p_detectorMap;      
00505       CameraGroundMap *p_groundMap;          
00506       CameraSkyMap *p_skyMap;                
00507 
00508       double ComputeAzimuth(Distance radius,
00509                             const double lat, const double lon);
00510 
00511       bool RawFocalPlanetoImage();
00512 
00513       int p_geometricTilingStartSize; 
00514       int p_geometricTilingEndSize;   
00515   };
00516 };
00517 
00518 #endif