22 PvlGroup &algo = pvl.findObject(
"NormalizationModel")
23 .findGroup(
"Algorithm", Pvl::Traverse);
30 if(algo.hasKeyword(
"Incref")) {
34 if(algo.hasKeyword(
"Pharef")) {
40 if(algo.hasKeyword(
"Emaref")) {
46 GetPhotoModel()->SetStandardConditions(
true);
48 GetPhotoModel()->SetStandardConditions(
false);
51 GetAtmosModel()->GenerateAhTable();
58 GetAtmosModel()->SetStandardConditions(
true);
63 GetAtmosModel()->SetStandardConditions(
false);
84 double demincidence,
double dememission,
double dn,
85 double &albedo,
double &mult,
double &base) {
87 static double ahInterp;
103 static double old_phase = -9999;
104 static double old_incidence = -9999;
105 static double old_emission = -9999;
106 static double old_demincidence = -9999;
107 static double old_dememission = -9999;
109 if (old_phase != phase || old_incidence != incidence || old_emission != emission ||
110 old_demincidence != demincidence || old_dememission != dememission) {
112 psurf = GetPhotoModel()->CalcSurfAlbedo(phase, demincidence,
117 munot = cos(incidence * (PI / 180.0));
120 old_incidence = incidence;
121 old_emission = emission;
122 old_demincidence = demincidence;
123 old_dememission = dememission;
126 GetAtmosModel()->CalcAtmEffect(phase, incidence, emission, &pstd, &trans, &trans0, &
p_normSbar,
131 dpm = (psurf - ahInterp * munot) * trans0;
132 q = ahInterp * munot * trans + GetAtmosModel()->AtmosAb() *
p_normSbar * dpo + dpm;
134 if(dpo <= 0.0 && GetAtmosModel()->AtmosNulneg()) {
138 firsterm = GetAtmosModel()->AtmosAb() *
p_normSbar;
139 secondterm = dpo * dpm;
140 thirdterm = firsterm * secondterm;
141 fourthterm = pow(q, 2.0) - 4.0 * thirdterm;
143 if(fourthterm < 0.0) {
144 QString msg =
"Square root of negative (math) encountered";
145 throw IException(IException::Unknown, msg, _FILEINFO_);
148 fifthterm = q + sqrt(fourthterm);
151 rho = 2 * dpo / fifthterm;
155 if((1.0 - rho * GetAtmosModel()->AtmosAb()*
p_normSbar) <= 0.0) {
156 QString msg =
"Divide by zero (math) encountered";
157 throw IException(IException::Unknown, msg, _FILEINFO_);
AlbedoAtm(Pvl &pvl, PhotoModel &pmodel, AtmosModel &amodel)
Constructs AlbedoAtm object using a Pvl, PhotoModel, and AtmosModel.
virtual void NormModelAlgorithm(double pha, double inc, double ema, double dn, double &albedo, double &mult, double &base)
Performs the normalization.