Isis 3 Programmer Reference
PhotometricFunction.h
1 #ifndef PhotometricFunction_h
2 #define PhotometricFunction_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include "IString.h"
13 #include "Camera.h"
14 #include "DbProfile.h"
15 #include "SpecialPixel.h"
16 
17 #include <iostream>
18 #include <sstream>
19 #include <iomanip>
20 
21 namespace Isis {
22 
34  template<typename T> inline T MIN( const T &A, const T &B ) {
35  if (A < B) {
36  return (A);
37  }
38  else {
39  return (B);
40  }
41  }
42 
54  template<typename T> inline T MAX( const T &A, const T &B ) {
55  if (A > B) {
56  return (A);
57  }
58  else {
59  return (B);
60  }
61  }
62 
63  class PvlObject;
64  class Camera;
65 
79 
80  public:
81  PhotometricFunction(PvlObject &pvl, Cube &cube, bool useCamera);
82  virtual ~PhotometricFunction();
83 
84  void setCamera(Camera *cam);
85  static QString algorithmName( const PvlObject &pvl );
86  virtual double compute( const double &line, const double &sample, int band = 1, bool useDem = false);
87  virtual double photometry( double i, double e, double g, int band = 1 ) const = 0;
88  virtual void report( PvlContainer &pvl ) = 0;
89  virtual void setMinimumIncidenceAngle( double angle );
90  virtual void setMaximumIncidenceAngle( double angle );
91  virtual void setMinimumEmissionAngle( double angle );
92  virtual void setMaximumEmissionAngle( double angle );
93  virtual void setMinimumPhaseAngle( double angle );
94  virtual void setMaximumPhaseAngle( double angle );
95  virtual double minimumIncidenceAngle();
96  virtual double maximumIncidenceAngle();
97  virtual double minimumEmissionAngle();
98  virtual double maximumEmissionAngle();
99  virtual double minimumPhaseAngle();
100  virtual double maximumPhaseAngle();
101 
102 
103  protected:
104 
105  Camera *m_camera; //<! Camera used for calculating photmetric angles
106  double m_iRef; //<! Incidence refernce angle
107  double m_eRef; //<! Emission reference angle
108  double m_gRef; //<! Phase reference angle
109  double m_minimumIncidenceAngle; //<! The minimum incidence angle to perform computations
110  double m_maximumIncidenceAngle; //<! The maximum incidence angle to perform computations
111  double m_minimumEmissionAngle; //<! The minimum emission angle to perform computations
112  double m_maximumEmissionAngle; //<! The maximum emission angle to perform computations
113  double m_minimumPhaseAngle; //<! The minimum phase angle to perform computations
114  double m_maximumPhaseAngle; //<! The maximum phase angle to perform computations
115  DbProfile m_normProf; //<! Parameters for the normalization model
116 
132  template<typename T>
133  T ConfKey( const DbProfile &conf, const QString &keyname, const T &defval, int index = 0 ) const {
134  if (!conf.exists(keyname)) {
135  return (defval);
136  }
137  if (conf.count(keyname) < index) {
138  return (defval);
139  }
140  return conf.value(keyname, index);
141  }
142  };
143 };
144 #endif
Isis::MAX
T MAX(const T &A, const T &B)
Implement templatized MAX fumnction.
Definition: PhotometricFunction.h:54
Isis::PhotometricFunction::compute
virtual double compute(const double &line, const double &sample, int band=1, bool useDem=false)
Computes Photometric function from cube attributes.
Definition: PhotometricFunction.cpp:85
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::DbProfile::exists
bool exists(const QString &key) const
Checks for the existance of a keyword.
Definition: DbProfile.h:115
Isis::PhotometricFunction::setMinimumIncidenceAngle
virtual void setMinimumIncidenceAngle(double angle)
Mutator function to set minimum incidence angle.
Definition: PhotometricFunction.cpp:131
Isis::DbProfile::count
int count(const QString &key) const
Report number of values in keyword.
Definition: DbProfile.cpp:127
Isis::PhotometricFunction::setMaximumIncidenceAngle
virtual void setMaximumIncidenceAngle(double angle)
Mutator function to set maximum incidence angle.
Definition: PhotometricFunction.cpp:147
Isis::PhotometricFunction::algorithmName
static QString algorithmName(const PvlObject &pvl)
Finds the name of the algorithm defined in a PVL object.
Definition: PhotometricFunction.cpp:64
Isis::Camera
Definition: Camera.h:236
Isis::PhotometricFunction::ConfKey
T ConfKey(const DbProfile &conf, const QString &keyname, const T &defval, int index=0) const
Helper template to initialize parameters.
Definition: PhotometricFunction.h:133
Isis::PhotometricFunction::~PhotometricFunction
virtual ~PhotometricFunction()
Destructor.
Definition: PhotometricFunction.cpp:44
Isis::PhotometricFunction
An abstract implementation of the photometric function.
Definition: PhotometricFunction.h:78
Isis::PhotometricFunction::setMaximumEmissionAngle
virtual void setMaximumEmissionAngle(double angle)
Mutator function to set maximum emission angle.
Definition: PhotometricFunction.cpp:179
Isis::PhotometricFunction::setMinimumPhaseAngle
virtual void setMinimumPhaseAngle(double angle)
Mutator function to set minimum phase angle.
Definition: PhotometricFunction.cpp:195
Isis::PhotometricFunction::setMaximumPhaseAngle
virtual void setMaximumPhaseAngle(double angle)
Mutator function to set maximum phase angle.
Definition: PhotometricFunction.cpp:211
Isis::MIN
T MIN(const T &A, const T &B)
Implement templatized MIN fumnction.
Definition: PhotometricFunction.h:34
Isis::DbProfile
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:51
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::PhotometricFunction::minimumEmissionAngle
virtual double minimumEmissionAngle()
Accessor method to access minimum emission angle.
Definition: PhotometricFunction.cpp:259
Isis::PhotometricFunction::maximumPhaseAngle
virtual double maximumPhaseAngle()
Accessor method to access maximum phase angle.
Definition: PhotometricFunction.cpp:307
Isis::PhotometricFunction::setCamera
void setCamera(Camera *cam)
Set the camera used to compute photometric angles.
Definition: PhotometricFunction.cpp:52
Isis::PhotometricFunction::maximumIncidenceAngle
virtual double maximumIncidenceAngle()
Accessor method to access maximum incidence angle.
Definition: PhotometricFunction.cpp:243
Isis::PhotometricFunction::minimumIncidenceAngle
virtual double minimumIncidenceAngle()
Accessor method to access minimum incidence angle.
Definition: PhotometricFunction.cpp:227
Isis::PhotometricFunction::PhotometricFunction
PhotometricFunction(PvlObject &pvl, Cube &cube, bool useCamera)
Construct Photometric function from Pvl and Cube file.
Definition: PhotometricFunction.cpp:34
Isis::PhotometricFunction::maximumEmissionAngle
virtual double maximumEmissionAngle()
Accessor method to access maximum emission angle.
Definition: PhotometricFunction.cpp:275
Isis::PvlContainer
Contains more than one keyword-value pair.
Definition: PvlContainer.h:49
Isis::DbProfile::value
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
Definition: DbProfile.cpp:146
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::PhotometricFunction::minimumPhaseAngle
virtual double minimumPhaseAngle()
Accessor method to access minimum phase angle.
Definition: PhotometricFunction.cpp:291
Isis::PhotometricFunction::setMinimumEmissionAngle
virtual void setMinimumEmissionAngle(double angle)
Mutator function to set minimum emission angle.
Definition: PhotometricFunction.cpp:163