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;
virtual double PhotoModelAlgorithm(double phase, double incidence, double emission)
Return photometric phase angle list.
void SetPhotoPhaseList(QString phasestrlist)
Set the empirical Lunar Lambert function phase angle list.
Empirical Lunar Lambert photometric model Derive model albedo using phase dependent Minnaert equation...
const double PI
The mathematical constant PI.
void SetPhotoLList(QString kstrlist)
Set the empirical Lunar Lambert function L exponent list.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void SetPhotoPhaseCurveList(QString phasecurvestrlist)
Set the empirical Lunar Lambert function phase curve list.
double Evaluate(const double a, const ExtrapType &etype=ThrowError)
Calculates interpolated or extrapolated value of tabulated data set for given domain value...
IString Token(const IString &separator)
Returns the first token in the IString.
void Reset()
Resets the state of the object.
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
void SetCubicClampedEndptDeriv(const double yp1, const double ypn)
Sets the values for the first derivatives of the endpoints of the data set.
Cubic Spline interpolation with clamped boundary conditions.
Container for cube-like labels.
void SetInterpType(NumericalApproximation::InterpType itype)
Sets interpolation type.
void AddData(const double x, const double y)
Add a datapoint to the set.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
Evaluate() attempts to extrapolate if a is outside of the domain. This is only valid for NumericalApp...