8 #include "IException.h"
12 Shade::Shade(Pvl &pvl, PhotoModel &pmodel) : NormModel(pvl, pmodel) {
13 PvlGroup &algorithm = pvl.findObject(
"NormalizationModel").findGroup(
"Algorithm",
Pvl::Traverse);
20 if(algorithm.hasKeyword(
"Incref")) {
21 SetNormIncref(algorithm[
"Incref"]);
24 if(algorithm.hasKeyword(
"Pharef")) {
25 SetNormPharef(algorithm[
"Pharef"]);
28 p_normPharef = p_normIncref;
31 if(algorithm.hasKeyword(
"Emaref")) {
32 SetNormEmaref(algorithm[
"Emaref"]);
35 if(algorithm.hasKeyword(
"Albedo")) {
36 SetNormAlbedo(algorithm[
"Albedo"]);
40 void Shade::NormModelAlgorithm(
double phase,
double incidence,
double emission,
41 double demincidence,
double dememission,
double dn,
42 double &albedo,
double &mult,
double &base) {
48 psurfref = GetPhotoModel()->
CalcSurfAlbedo(p_normPharef, p_normIncref, p_normEmaref);
52 std::string msg =
"Divide by zero error";
56 rho = p_normAlbedo / psurfref;
58 albedo = rho * GetPhotoModel()->
CalcSurfAlbedo(phase, demincidence, dememission);
71 if(pharef < 0.0 || pharef >= 180.0) {
72 std::string msg =
"Invalid value of normalization pharef [" +
IString(pharef) +
"]";
76 p_normPharef = pharef;
89 if(incref < 0.0 || incref >= 90.0) {
90 std::string msg =
"Invalid value of normalization incref [" +
IString(incref) +
"]";
94 p_normIncref = incref;
107 if(emaref < 0.0 || emaref >= 90.0) {
108 std::string msg =
"Invalid value of normalization emaref [" +
IString(emaref) +
"]";
112 p_normEmaref = emaref;
125 p_normAlbedo = albedo;