6 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
7 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
10 Albedo::Albedo(Pvl &pvl, PhotoModel &pmodel) : NormModel(pvl, pmodel) {
11 PvlGroup &algorithm = pvl.findObject(
"NormalizationModel").findGroup(
"Algorithm",
Pvl::Traverse);
21 if(algorithm.hasKeyword(
"Incref")) {
22 SetNormIncref(algorithm[
"Incref"]);
25 if(algorithm.hasKeyword(
"Pharef")) {
26 SetNormPharef(algorithm[
"Pharef"]);
28 p_normPharef = p_normIncref;
31 if(algorithm.hasKeyword(
"Emaref")) {
32 SetNormEmaref(algorithm[
"Emaref"]);
35 if(algorithm.hasKeyword(
"Incmat")) {
36 SetNormIncmat(algorithm[
"Incmat"]);
39 if(algorithm.hasKeyword(
"Thresh")) {
40 SetNormThresh(algorithm[
"Thresh"]);
43 if(algorithm.hasKeyword(
"Albedo")) {
44 SetNormAlbedo(algorithm[
"Albedo"]);
48 GetPhotoModel()->SetStandardConditions(
true);
49 p_normPsurfref = GetPhotoModel()->CalcSurfAlbedo(p_normPharef, p_normIncref, p_normEmaref);
50 GetPhotoModel()->SetStandardConditions(
false);
53 void Albedo::NormModelAlgorithm(
double phase,
double incidence,
54 double emission,
double demincidence,
double dememission,
55 double dn,
double &albedo,
double &mult,
double &base) {
60 psurf = GetPhotoModel()->
CalcSurfAlbedo(phase, demincidence, dememission);
63 if(p_normPsurfref > psurf * p_normThresh) {
71 QString msg =
"Albedo math divide by zero error";
75 result = dn * p_normPsurfref / psurf;
77 mult = p_normPsurfref / psurf;
93 if(pharef < 0.0 || pharef >= 180.0) {
94 QString msg =
"Invalid value of normalization pharef [" +
98 p_normPharef = pharef;
111 if(incref < 0.0 || incref >= 90.0) {
112 QString msg =
"Invalid value of normalization incref [" +
116 p_normIncref = incref;
129 if(emaref < 0.0 || emaref >= 90.0) {
130 QString msg =
"Invalid value of normalization emaref [" +
134 p_normEmaref = emaref;
144 if(incmat < 0.0 || incmat >= 90.0) {
145 QString msg =
"Invalid value of normalization incmat [" +
149 p_normIncmat = incmat;
161 p_normAlbedo = albedo;
179 p_normThresh = thresh;