Isis 3 Programmer Reference
LommelSeeliger.cpp
1 #include <cmath>
2 #include "LommelSeeliger.h"
3 
4 namespace Isis {
5  double LommelSeeliger::PhotoModelAlgorithm(double phase, double incidence,
6  double emission) {
7  static double pht_lomsel;
8  double incrad;
9  double emarad;
10  double munot;
11  double mu;
12 
13  static double old_phase = -9999;
14  static double old_incidence = -9999;
15  static double old_emission= -9999;
16 
17  if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
18  return pht_lomsel;
19  }
20 
21  old_phase = phase;
22  old_incidence = incidence;
23  old_emission = emission;
24 
25  incrad = incidence * Isis::PI / 180.0;
26  emarad = emission * Isis::PI / 180.0;
27  munot = cos(incrad);
28  mu = cos(emarad);
29 
30  if(munot <= 0.0 || mu <= 0.0 || incidence == 90.0 ||
31  emission == 90.0) {
32  pht_lomsel = 0.0;
33  }
34  else {
35  pht_lomsel = 2.0 * munot / (munot + mu);
36  }
37 
38  return pht_lomsel;
39  }
40 }
41 
42 extern "C" Isis::PhotoModel *LommelSeeligerPlugin(Isis::Pvl &pvl) {
43  return new Isis::LommelSeeliger(pvl);
44 }
const double PI
The mathematical constant PI.
Definition: Constants.h:56
Container for cube-like labels.
Definition: Pvl.h:135
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31