3#include "NumericalApproximation.h"
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";
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";
177 if(pharef < 0.0 || pharef >= 180.0) {
178 QString msg =
"Invalid value of normalization pharef [" +
196 if(incref < 0.0 || incref >= 90.0) {
197 QString msg =
"Invalid value of normalization incref [" +
215 if(emaref < 0.0 || emaref >= 90.0) {
216 QString msg =
"Invalid value of normalization emaref [" +
Albedo normalization with atmosphere.
void SetNormIncref(const double incref)
Set the normalization function parameter.
double p_normTrans0ref
???
double p_normPharef
The reference phase angle.
void SetNormPharef(const double pharef)
Set parameters needed for albedo normalization.
void SetNormEmaref(const double emaref)
Set the normalization function parameter.
double p_normEmaref
The reference emission angle.
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.
double p_normIncref
The reference incidence angle.
Isotropic atmos scattering model.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
NormModel(Pvl &pvl, PhotoModel &pmodel)
Create a NormModel object.
@ Extrapolate
Evaluate() attempts to extrapolate if a is outside of the domain. This is only valid for NumericalApp...
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Contains multiple PvlContainers.
Container for cube-like labels.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
@ Traverse
Search child objects.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
const double PI
The mathematical constant PI.