Isis 3 Programmer Reference
LommelSeeliger.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include <cmath>
8#include "LommelSeeliger.h"
9
10namespace Isis {
11 double LommelSeeliger::PhotoModelAlgorithm(double phase, double incidence,
12 double emission) {
13 static double pht_lomsel;
14 double incrad;
15 double emarad;
16 double munot;
17 double mu;
18
19 static double old_phase = -9999;
20 static double old_incidence = -9999;
21 static double old_emission= -9999;
22
23 if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
24 return pht_lomsel;
25 }
26
27 old_phase = phase;
28 old_incidence = incidence;
29 old_emission = emission;
30
31 incrad = incidence * Isis::PI / 180.0;
32 emarad = emission * Isis::PI / 180.0;
33 munot = cos(incrad);
34 mu = cos(emarad);
35
36 if(munot <= 0.0 || mu <= 0.0 || incidence == 90.0 ||
37 emission == 90.0) {
38 pht_lomsel = 0.0;
39 }
40 else {
41 pht_lomsel = 2.0 * munot / (munot + mu);
42 }
43
44 return pht_lomsel;
45 }
46}
47
48extern "C" Isis::PhotoModel *LommelSeeligerPlugin(Isis::Pvl &pvl) {
49 return new Isis::LommelSeeliger(pvl);
50}
Container for cube-like labels.
Definition Pvl.h:119
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
const double PI
The mathematical constant PI.
Definition Constants.h:40