Isis 3 Programmer Reference
PhotometricFunction.h
1 #ifndef PhotometricFunction_h
2 #define PhotometricFunction_h
3 
4 #include "IString.h"
5 #include "Camera.h"
6 #include "DbProfile.h"
7 #include "SpecialPixel.h"
8 
9 #include <iostream>
10 #include <sstream>
11 #include <iomanip>
12 
13 namespace Isis {
14 
26  template<typename T> inline T MIN( const T &A, const T &B ) {
27  if (A < B) {
28  return (A);
29  }
30  else {
31  return (B);
32  }
33  }
34 
46  template<typename T> inline T MAX( const T &A, const T &B ) {
47  if (A > B) {
48  return (A);
49  }
50  else {
51  return (B);
52  }
53  }
54 
55  class PvlObject;
56  class Camera;
57 
71 
72  public:
73  PhotometricFunction(PvlObject &pvl, Cube &cube, bool useCamera);
74  virtual ~PhotometricFunction();
75 
76  void setCamera(Camera *cam);
77  static QString algorithmName( const PvlObject &pvl );
78  virtual double compute( const double &line, const double &sample, int band = 1, bool useDem = false);
79  virtual double photometry( double i, double e, double g, int band = 1 ) const = 0;
80  virtual void report( PvlContainer &pvl ) = 0;
81  virtual void setMinimumIncidenceAngle( double angle );
82  virtual void setMaximumIncidenceAngle( double angle );
83  virtual void setMinimumEmissionAngle( double angle );
84  virtual void setMaximumEmissionAngle( double angle );
85  virtual void setMinimumPhaseAngle( double angle );
86  virtual void setMaximumPhaseAngle( double angle );
87  virtual double minimumIncidenceAngle();
88  virtual double maximumIncidenceAngle();
89  virtual double minimumEmissionAngle();
90  virtual double maximumEmissionAngle();
91  virtual double minimumPhaseAngle();
92  virtual double maximumPhaseAngle();
93 
94 
95  protected:
96 
97  Camera *m_camera; //<! Camera used for calculating photmetric angles
98  double m_iRef; //<! Incidence refernce angle
99  double m_eRef; //<! Emission reference angle
100  double m_gRef; //<! Phase reference angle
101  double m_minimumIncidenceAngle; //<! The minimum incidence angle to perform computations
102  double m_maximumIncidenceAngle; //<! The maximum incidence angle to perform computations
103  double m_minimumEmissionAngle; //<! The minimum emission angle to perform computations
104  double m_maximumEmissionAngle; //<! The maximum emission angle to perform computations
105  double m_minimumPhaseAngle; //<! The minimum phase angle to perform computations
106  double m_maximumPhaseAngle; //<! The maximum phase angle to perform computations
107  DbProfile m_normProf; //<! Parameters for the normalization model
108 
124  template<typename T>
125  T ConfKey( const DbProfile &conf, const QString &keyname, const T &defval, int index = 0 ) const {
126  if (!conf.exists(keyname)) {
127  return (defval);
128  }
129  if (conf.count(keyname) < index) {
130  return (defval);
131  }
132  return conf.value(keyname, index);
133  }
134  };
135 };
136 #endif
T ConfKey(const DbProfile &conf, const QString &keyname, const T &defval, int index=0) const
Helper template to initialize parameters.
Contains more than one keyword-value pair.
Definition: PvlContainer.h:63
virtual double maximumIncidenceAngle()
Accessor method to access maximum incidence angle.
int count(const QString &key) const
Report number of values in keyword.
Definition: DbProfile.cpp:141
virtual double minimumPhaseAngle()
Accessor method to access minimum phase angle.
bool exists(const QString &key) const
Checks for the existance of a keyword.
Definition: DbProfile.h:129
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:65
virtual ~PhotometricFunction()
Destructor.
virtual double compute(const double &line, const double &sample, int band=1, bool useDem=false)
Computes Photometric function from cube attributes.
virtual void setMinimumIncidenceAngle(double angle)
Mutator function to set minimum incidence angle.
An abstract implementation of the photometric function.
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
Definition: DbProfile.cpp:160
virtual void setMaximumIncidenceAngle(double angle)
Mutator function to set maximum incidence angle.
virtual void setMaximumEmissionAngle(double angle)
Mutator function to set maximum emission angle.
static QString algorithmName(const PvlObject &pvl)
Finds the name of the algorithm defined in a PVL object.
virtual double minimumIncidenceAngle()
Accessor method to access minimum incidence angle.
virtual void setMinimumEmissionAngle(double angle)
Mutator function to set minimum emission angle.
virtual double maximumEmissionAngle()
Accessor method to access maximum emission angle.
virtual double maximumPhaseAngle()
Accessor method to access maximum phase angle.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setCamera(Camera *cam)
Set the camera used to compute photometric angles.
virtual void setMinimumPhaseAngle(double angle)
Mutator function to set minimum phase angle.
PhotometricFunction(PvlObject &pvl, Cube &cube, bool useCamera)
Construct Photometric function from Pvl and Cube file.
virtual void setMaximumPhaseAngle(double angle)
Mutator function to set maximum phase angle.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
virtual double minimumEmissionAngle()
Accessor method to access minimum emission angle.
T MIN(const T &A, const T &B)
Implement templatized MIN fumnction.
IO Handler for Isis Cubes.
Definition: Cube.h:170
T MAX(const T &A, const T &B)
Implement templatized MAX fumnction.