8 #include "MinnaertEmpirical.h"
9 #include "IException.h"
12 MinnaertEmpirical::MinnaertEmpirical(Pvl &pvl) : PhotoModel(pvl) {
13 PvlGroup &algo = pvl.findObject(
"PhotometricModel")
17 if (algo.hasKeyword(
"PhaseList")) {
18 SetPhotoPhaseList(algo[
"PhaseList"]);
20 std::string msg =
"The empirical Minnaert phase list was not provided by user";
23 if (algo.hasKeyword(
"KList")) {
24 SetPhotoKList(algo[
"KList"]);
26 std::string msg =
"The empirical Minnaert k exponent list was not provided by user";
29 if (algo.hasKeyword(
"PhaseCurveList")) {
30 SetPhotoPhaseCurveList(algo[
"PhaseCurveList"]);
32 std::string msg =
"The empirical Minnaert phase brightness list was not provided by user";
37 p_photoPhaseAngleCount = (int)p_photoPhaseList.size();
39 if (p_photoPhaseAngleCount != (
int)p_photoKList.size()) {
40 std::string msg =
"Number of empirical Minnaert k list values must be equal";
41 msg +=
"to number of phase angles provided";
45 if (p_photoPhaseAngleCount != (
int)p_photoPhaseCurveList.size()) {
46 std::string msg =
"Number of empirical Minnaert phase curve list values must be equal";
47 msg +=
"to number of phase angles provided";
52 p_photoKSpline.
Reset();
54 p_photoKSpline.
AddData(p_photoPhaseList,p_photoKList);
56 p_photoBSpline.
Reset();
58 p_photoBSpline.
AddData(p_photoPhaseList,p_photoPhaseCurveList);
62 MinnaertEmpirical::~MinnaertEmpirical() {
63 p_photoKSpline.
Reset();
64 p_photoBSpline.
Reset();
65 p_photoPhaseList.clear();
67 p_photoPhaseCurveList.clear();
82 p_photoPhaseList.clear();
84 while (strlist.length()) {
85 phaseangle = strlist.
Token(
",");
86 if (phaseangle < 0.0 || phaseangle > 180.0) {
87 std::string msg =
"Invalid value of empirical Minnaert phase angle list value [" +
91 p_photoPhaseList.push_back(phaseangle);
107 p_photoKList.clear();
109 while (strlist.length()) {
110 kvalue = strlist.
Token(
",");
112 std::string msg =
"Invalid value of Minnaert k list value [" +
116 p_photoKList.push_back(kvalue);
129 IString strlist(phasecurvestrlist);
130 p_photoPhaseCurveList.clear();
132 while (strlist.length()) {
133 phasecurve = strlist.
Token(
",");
134 p_photoPhaseCurveList.push_back(phasecurve);
140 static double pht_minnaert_empirical;
145 double kInterpolated = 0;
146 double bInterpolated = 0;
148 static double old_phase = -9999;
149 static double old_incidence = -9999;
150 static double old_emission= -9999;
153 if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
154 return pht_minnaert_empirical;
157 old_incidence = incidence;
158 old_emission = emission;
160 incrad = incidence *
Isis::PI / 180.0;
161 emarad = emission *
Isis::PI / 180.0;
165 if (phase != old_phase) {
171 if(munot <= 0.0 || mu <= 0.0 || incidence == 90.0 ||
173 pht_minnaert_empirical = 0.0;
175 else if(kInterpolated == 1.0) {
176 pht_minnaert_empirical = munot * bInterpolated;
179 pht_minnaert_empirical = bInterpolated * munot * pow((munot * mu), (kInterpolated - 1.0));
182 return pht_minnaert_empirical;