4 #include "NumericalApproximation.h" 8 ShadeAtm::ShadeAtm(Pvl &pvl, PhotoModel &pmodel, AtmosModel &amodel) : NormModel(pvl, pmodel, amodel) {
9 PvlGroup &algorithm = pvl.findObject(
"NormalizationModel").findGroup(
"Algorithm",
Pvl::Traverse);
16 if(algorithm.hasKeyword(
"Incref")) {
20 if(algorithm.hasKeyword(
"Pharef")) {
23 p_normPharef = p_normIncref;
26 if(algorithm.hasKeyword(
"Emaref")) {
30 if(algorithm.hasKeyword(
"Albedo")) {
49 void ShadeAtm::NormModelAlgorithm(
double phase,
double incidence,
double emission,
50 double demincidence,
double dememission,
double dn,
51 double &albedo,
double &mult,
double &base) {
55 static double ahInterp;
63 static double old_phase = -9999;
64 static double old_incidence = -9999;
65 static double old_emission = -9999;
66 static double old_demincidence = -9999;
67 static double old_dememission = -9999;
71 psurfref = GetPhotoModel()->
CalcSurfAlbedo(p_normPharef, p_normIncref, p_normEmaref);
78 std::string msg =
"Divide by zero error";
82 rho = p_normAlbedo / psurfref;
84 if (old_phase != phase || old_incidence != incidence || old_emission != emission ||
85 old_demincidence != demincidence || old_dememission != dememission) {
87 psurf = GetPhotoModel()->
CalcSurfAlbedo(phase, demincidence, dememission);
91 munot = cos(incidence * (
PI / 180.0));
94 old_incidence = incidence;
95 old_emission = emission;
96 old_demincidence = demincidence;
97 old_dememission = dememission;
100 GetAtmosModel()->
CalcAtmEffect(phase, incidence, emission, &pstd, &trans, &trans0, &sbar,
103 albedo = pstd + rho * (ahInterp * munot * trans /
104 (1.0 - rho * GetAtmosModel()->
AtmosAb() * sbar) + (psurf - ahInterp * munot) * trans0);
117 if(pharef < 0.0 || pharef >= 180.0) {
118 std::string msg =
"Invalid value of normalization pharef [" +
123 p_normPharef = pharef;
136 if(incref < 0.0 || incref >= 90.0) {
137 std::string msg =
"Invalid value of normalization incref [" +
142 p_normIncref = incref;
155 if(emaref < 0.0 || emaref >= 90.0) {
156 std::string msg =
"Invalid value of normalization emaref [" +
161 p_normEmaref = emaref;
173 p_normAlbedo = albedo;
void SetNormPharef(const double pharef)
Set parameters needed for albedo normalization.
void SetNormAlbedo(const double albedo)
Set the normalization function parameter.
double CalcSurfAlbedo(double pha, double inc, double ema)
Calculate the surface brightness using photometric angle information.
const double PI
The mathematical constant PI.
void CalcAtmEffect(double pha, double inc, double ema, double *pstd, double *trans, double *trans0, double *sbar, double *transs)
Calculate the atmospheric scattering effect using photometric angle information.
void SetNormPharef(const double pharef)
Set the normalization function parameter.
void SetNormIncref(const double incref)
Set the normalization function parameter.
NumericalApproximation AtmosAhSpline()
If GenerateAhTable() has been called this returns a clamped cubic spline of the data set (p_atmosIncT...
Isotropic atmos scattering model.
void SetNormIncref(const double incref)
Set the normalization function parameter.
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
A type of error that cannot be classified as any of the other error types.
void SetNormAlbedo(const double albedo)
Set the normalization function parameter.
Container for cube-like labels.
void SetNormEmaref(const double emaref)
Set the normalization function parameter.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
double AtmosAb() const
Return atmospheric Ab value.
void GenerateAhTable()
This method computes the values of the atmospheric Ah table and sets the properties of the atmospheri...
void SetNormEmaref(const double emaref)
Set the normalization function parameter.
Evaluate() attempts to extrapolate if a is outside of the domain. This is only valid for NumericalApp...
virtual void SetStandardConditions(bool standard)
Sets whether standard conditions will be used.