6 MinnaertEmpirical::MinnaertEmpirical(Pvl &pvl) : PhotoModel(pvl) {
7 PvlGroup &algo = pvl.findObject(
"PhotometricModel")
11 if (algo.hasKeyword(
"PhaseList")) {
12 SetPhotoPhaseList(algo[
"PhaseList"]);
14 std::string msg =
"The empirical Minnaert phase list was not provided by user";
17 if (algo.hasKeyword(
"KList")) {
18 SetPhotoKList(algo[
"KList"]);
20 std::string msg =
"The empirical Minnaert k exponent list was not provided by user";
23 if (algo.hasKeyword(
"PhaseCurveList")) {
24 SetPhotoPhaseCurveList(algo[
"PhaseCurveList"]);
26 std::string msg =
"The empirical Minnaert phase brightness list was not provided by user";
31 p_photoPhaseAngleCount = (int)p_photoPhaseList.size();
33 if (p_photoPhaseAngleCount != (
int)p_photoKList.size()) {
34 std::string msg =
"Number of empirical Minnaert k list values must be equal";
35 msg +=
"to number of phase angles provided";
39 if (p_photoPhaseAngleCount != (
int)p_photoPhaseCurveList.size()) {
40 std::string msg =
"Number of empirical Minnaert phase curve list values must be equal";
41 msg +=
"to number of phase angles provided";
46 p_photoKSpline.
Reset();
48 p_photoKSpline.
AddData(p_photoPhaseList,p_photoKList);
50 p_photoBSpline.
Reset();
52 p_photoBSpline.
AddData(p_photoPhaseList,p_photoPhaseCurveList);
56 MinnaertEmpirical::~MinnaertEmpirical() {
57 p_photoKSpline.
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 std::string msg =
"Invalid value of empirical Minnaert phase angle list value [" +
85 p_photoPhaseList.push_back(phaseangle);
101 p_photoKList.clear();
103 while (strlist.length()) {
104 kvalue = strlist.
Token(
",");
106 std::string msg =
"Invalid value of Minnaert k list value [" +
110 p_photoKList.push_back(kvalue);
123 IString strlist(phasecurvestrlist);
124 p_photoPhaseCurveList.clear();
126 while (strlist.length()) {
127 phasecurve = strlist.
Token(
",");
128 p_photoPhaseCurveList.push_back(phasecurve);
134 static double pht_minnaert_empirical;
139 double kInterpolated = 0;
140 double bInterpolated = 0;
142 static double old_phase = -9999;
143 static double old_incidence = -9999;
144 static double old_emission= -9999;
147 if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
148 return pht_minnaert_empirical;
151 old_incidence = incidence;
152 old_emission = emission;
154 incrad = incidence *
Isis::PI / 180.0;
155 emarad = emission *
Isis::PI / 180.0;
159 if (phase != old_phase) {
165 if(munot <= 0.0 || mu <= 0.0 || incidence == 90.0 ||
167 pht_minnaert_empirical = 0.0;
169 else if(kInterpolated == 1.0) {
170 pht_minnaert_empirical = munot * bInterpolated;
173 pht_minnaert_empirical = bInterpolated * munot * pow((munot * mu), (kInterpolated - 1.0));
176 return pht_minnaert_empirical;
void SetPhotoKList(QString kstrlist)
Set the empirical Minnaert function K exponent list.
const double PI
The mathematical constant PI.
void SetPhotoPhaseCurveList(QString phasecurvestrlist)
Set the empirical Minnaert function phase curve list.
virtual double PhotoModelAlgorithm(double phase, double incidence, double emission)
Return photometric phase angle 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.
void SetPhotoPhaseList(QString phasestrlist)
Set the empirical Minnaert function phase angle list.
Namespace for ISIS/Bullet specific routines.
Empirical Minnaert photometric model Derive model albedo using phase dependent Minnaert equation and ...
Evaluate() attempts to extrapolate if a is outside of the domain. This is only valid for NumericalApp...