6 LunarLambertEmpirical::LunarLambertEmpirical(Pvl &pvl) : PhotoModel(pvl) {
7 PvlGroup &algo = pvl.findObject(
"PhotometricModel")
11 if (algo.hasKeyword(
"PhaseList")) {
12 SetPhotoPhaseList(algo[
"PhaseList"]);
14 QString msg =
"The empirical Lunar Lambert phase list was not provided by user";
17 if (algo.hasKeyword(
"LList")) {
18 SetPhotoLList(algo[
"LList"]);
20 QString msg =
"The empirical Lunar Lambert l exponent list was not provided by user";
23 if (algo.hasKeyword(
"PhaseCurveList")) {
24 SetPhotoPhaseCurveList(algo[
"PhaseCurveList"]);
26 QString msg =
"The empirical Lunar Lambert phase brightness list was not provided by user";
31 p_photoPhaseAngleCount = (int)p_photoPhaseList.size();
33 if (p_photoPhaseAngleCount != (
int)p_photoLList.size()) {
34 QString msg =
"Number of empirical Lunar Lambert l list values must be equal";
35 msg +=
"to number of phase angles provided";
39 if (p_photoPhaseAngleCount != (
int)p_photoPhaseCurveList.size()) {
40 QString msg =
"Number of empirical Lunar Lambert phase curve list values must be equal";
41 msg +=
"to number of phase angles provided";
46 p_photoLSpline.
Reset();
48 p_photoLSpline.
AddData(p_photoPhaseList,p_photoLList);
50 p_photoBSpline.
Reset();
52 p_photoBSpline.
AddData(p_photoPhaseList,p_photoPhaseCurveList);
56 LunarLambertEmpirical::~LunarLambertEmpirical() {
57 p_photoLSpline.
Reset();
58 p_photoBSpline.
Reset();
59 p_photoPhaseList.clear();
61 p_photoPhaseCurveList.clear();
76 p_photoPhaseList.clear();
78 while (strlist.length()) {
79 phaseangle = strlist.
Token(
",");
80 if (phaseangle < 0.0 || phaseangle > 180.0) {
81 QString msg =
"Invalid value of empirical Lunar Lambert phase angle list value [" +
85 p_photoPhaseList.push_back(phaseangle);
102 p_photoLList.clear();
104 while (strlist.length()) {
105 lvalue = strlist.
Token(
",");
106 p_photoLList.push_back(lvalue);
119 IString strlist(phasecurvestrlist);
120 p_photoPhaseCurveList.clear();
122 while (strlist.length()) {
123 phasecurve = strlist.
Token(
",");
124 p_photoPhaseCurveList.push_back(phasecurve);
130 static double pht_lunarlambert_empirical;
135 double lInterpolated = 0;
136 double bInterpolated = 0;
138 static double old_phase = -9999;
139 static double old_incidence = -9999;
140 static double old_emission= -9999;
143 if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
144 return pht_lunarlambert_empirical;
147 old_incidence = incidence;
148 old_emission = emission;
150 incrad = incidence *
Isis::PI / 180.0;
151 emarad = emission *
Isis::PI / 180.0;
155 if (phase != old_phase) {
161 if(munot <= 0.0 || mu <= 0.0) {
162 pht_lunarlambert_empirical = 0.0;
164 else if(lInterpolated == 0.0) {
165 pht_lunarlambert_empirical = munot * bInterpolated;
167 else if(lInterpolated == 1.0) {
168 pht_lunarlambert_empirical = bInterpolated * 2.0 * munot / (munot + mu);
171 pht_lunarlambert_empirical = bInterpolated * munot * ((1.0 - lInterpolated) + 2.0 * lInterpolated / (munot + mu));
174 return pht_lunarlambert_empirical;