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) {
47 GetPhotoModel()->SetStandardConditions(
true);
48 psurfref = GetPhotoModel()->CalcSurfAlbedo(p_normPharef, p_normIncref, p_normEmaref);
49 GetPhotoModel()->SetStandardConditions(
false);
52 std::string msg =
"Divide by zero error";
53 throw IException(IException::Unknown, msg, _FILEINFO_);
56 rho = p_normAlbedo / psurfref;
58 albedo = rho * GetPhotoModel()->CalcSurfAlbedo(phase, demincidence, dememission);
70 void Shade::SetNormPharef(
const double pharef) {
71 if(pharef < 0.0 || pharef >= 180.0) {
72 std::string msg =
"Invalid value of normalization pharef [" +
IString(pharef) +
"]";
73 throw IException(IException::User, msg, _FILEINFO_);
76 p_normPharef = pharef;
88 void Shade::SetNormIncref(
const double incref) {
89 if(incref < 0.0 || incref >= 90.0) {
90 std::string msg =
"Invalid value of normalization incref [" +
IString(incref) +
"]";
91 throw IException(IException::User, msg, _FILEINFO_);
94 p_normIncref = incref;
106 void Shade::SetNormEmaref(
const double emaref) {
107 if(emaref < 0.0 || emaref >= 90.0) {
108 std::string msg =
"Invalid value of normalization emaref [" +
IString(emaref) +
"]";
109 throw IException(IException::User, msg, _FILEINFO_);
112 p_normEmaref = emaref;
124 void Shade::SetNormAlbedo(
const double albedo) {
125 p_normAlbedo = albedo;
Adds specific functionality to C++ strings.
Container for cube-like labels.
This is free and unencumbered software released into the public domain.