Isis 3 Programmer Reference
AtmosModel.h
1#ifndef AtmosModel_h
2#define AtmosModel_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <string>
11#include <vector>
12#include "PhotoModel.h"
13#include "NumericalApproximation.h"
14#include "NumericalAtmosApprox.h"
15
16using namespace std;
17namespace Isis {
18 class Pvl;
19
60 class AtmosModel {
61 public:
62 AtmosModel(Pvl &pvl, PhotoModel &pmodel);
64 virtual ~AtmosModel() {};
65
66 // These methods were moved here from the NumericalMethods class
67 static double G11Prime(double tau);
68 static double Ei(double x);
69 static double En(unsigned int n, double x);
70 // Calculate atmospheric scattering effect
71 void CalcAtmEffect(double pha, double inc, double ema, double *pstd,
72 double *trans, double *trans0, double *sbar, double *transs);
73 // Used to calculate atmosphere at standard conditions
74 virtual void SetStandardConditions(bool standard);
75 // Obtain hemispheric and bihemispheric albedo by integrating the photometric function
76 void GenerateAhTable();
77 // Perform integration for Hapke Henyey-Greenstein atmosphere correction
78 void GenerateHahgTables();
79 // Perform integration for Hapke Henyey-Greenstein atmosphere correction. This
80 // version is used for shadow modeling and does not tabulate the first and third
81 // integrals like GenerateHahgTables. It only evaluates the middle integral
82 // that corrects the sbar variable (which is the illumination of the ground
83 // by the sky).
85 // Set parameters needed for atmospheric correction
86 void SetAtmosAtmSwitch(const int atmswitch);
87 void SetAtmosBha(const double bha);
88 void SetAtmosHga(const double hga);
89 void SetAtmosInc(const double inc);
90 void SetAtmosNulneg(const string nulneg);
91 void SetAtmosPhi(const double phi);
92 void SetAtmosTau(const double tau);
93 void SetAtmosTauref(const double tauref);
94 void SetAtmosWha(const double wha);
95 void SetAtmosHnorm(const double hnorm);
96 void SetAtmosIord(const string offset);
97 void SetAtmosEstTau(const string esttau);
98
100 string AlgorithmName() const {
101 return p_atmosAlgorithmName;
102 };
103
105 bool AtmosAdditiveOffset() const {
106 return p_atmosAddOffset;
107 };
108
110 double AtmosHnorm() const {
111 return p_atmosHnorm;
112 };
113
115 double AtmosBha() const {
116 return p_atmosBha;
117 };
119 double AtmosTau() const {
120 return p_atmosTau;
121 };
123 double AtmosWha() const {
124 return p_atmosWha;
125 };
127 double AtmosHga() const {
128 return p_atmosHga;
129 };
131 double AtmosTauref() const {
132 return p_atmosTauref;
133 };
135 bool AtmosNulneg() const {
136 return p_atmosNulneg;
137 };
139 double AtmosAb() const {
140 return p_atmosAb;
141 };
143 double AtmosHahgsb() const {
144 return p_atmosHahgsb;
145 };
147 int AtmosNinc() const {
148 return p_atmosNinc;
149 };
151 double AtmosMunot() const {
152 return p_atmosMunot;
153 };
154
156 vector <double> AtmosIncTable() {
157 return p_atmosIncTable;
158 };
160 vector <double> AtmosAhTable() {
161 return p_atmosAhTable;
162 };
164 vector <double> AtmosHahgtTable() {
165 return p_atmosHahgtTable;
166 };
168 vector <double> AtmosHahgt0Table() {
169 return p_atmosHahgt0Table;
170 };
171
214
215 protected:
216 virtual void AtmosModelAlgorithm(double phase, double incidence, double emission) = 0;
217
218 void SetAlgorithmName(string name) {
219 p_atmosAlgorithmName = name;
220 }
221 void SetAtmosNulneg(bool nulneg) {
222 p_atmosNulneg = nulneg;
223 }
224 void SetAtmosIord(bool offset) {
225 p_atmosAddOffset = offset;
226 }
227 void SetAtmosEstTau(bool esttau) {
228 p_atmosEstTau = esttau;
229 }
230 void SetOldTau(double tau) {
231 p_atmosTauold = tau;
232 }
233 void SetOldWha(double wha) {
234 p_atmosWhaold = wha;
235 }
236
237 PhotoModel *GetPhotoModel() const {
238 return p_atmosPM;
239 }
240 bool StandardConditions() const {
241 return p_standardConditions;
242 }
243 bool TauOrWhaChanged() const;
244 double Eulgam() const {
245 return p_atmosEulgam;
246 }
247
248 int p_atmosAtmSwitch;
249 int p_atmosNinc;
250
251 double p_atmosBha;
252 double p_atmosBhasave;
253 double p_atmosHgasave;
254 double p_atmosTauref;
255 double p_atmosTausave;
256 double p_atmosWhasave;
257
258 double p_pstd;
259 double p_trans;
260 double p_trans0;
261 double p_transs;
262 double p_sbar;
263 double p_atmosHga;
264 double p_atmosTau;
265 double p_atmosWha;
266 double p_atmosAb;
270 vector <double> p_atmosIncTable;
271 vector <double> p_atmosAhTable;
272 double p_atmosHahgsb;
273 vector <double> p_atmosHahgtTable;
274 vector <double> p_atmosHahgt0Table;
275 double p_atmosInc;
276 double p_atmosPhi;
277 double p_atmosMunot;
278 double p_atmosSini;
279 double p_atmosCosphi;
280 double p_atmosEulgam;
281
288
289 private:
290 bool p_standardConditions;
291
292 string p_atmosAlgorithmName;
293
294 PhotoModel *p_atmosPM;
295
296 bool p_atmosNulneg;
297
298 double p_atmosTauold;
299 double p_atmosWhaold;
300 friend class NumericalAtmosApprox;
301 };
302};
303
304#endif
Isotropic atmos scattering model.
Definition AtmosModel.h:60
double p_trans
Transmission of surface reflected light through the atmosphere overall.
Definition AtmosModel.h:259
static double En(unsigned int n, double x)
This routine evaluates the generalized exponential integral, En(x).
void SetAtmosHga(const double hga)
Set the Hapke atmospheric function parameter.
double p_atmosHnorm
Atmospheric shell thickness normalized to planet radius.
Definition AtmosModel.h:267
NumericalApproximation AtmosHahgtSpline()
If GenerateHahgTables() has been called this returns a clamped cubic spline of the data set (p_atmosI...
Definition AtmosModel.h:197
double AtmosHahgsb() const
Return atmospheric Hahgsb value.
Definition AtmosModel.h:143
double p_sbar
Illumination of the ground by the sky.
Definition AtmosModel.h:262
NumericalApproximation AtmosHahgt0Spline()
If GenerateHahgTables() has been called this returns a clamped cubic spline of the data set (p_atmosI...
Definition AtmosModel.h:211
bool p_atmosEstTau
Estimate optical depth tau using shadows.
Definition AtmosModel.h:269
vector< double > AtmosHahgt0Table()
Return atmospheric Hahgt0Table value.
Definition AtmosModel.h:168
void SetAtmosInc(const double inc)
Set the incidence angle.
double AtmosHnorm() const
Return atmospheric Hnorm value.
Definition AtmosModel.h:110
void SetAtmosEstTau(const string esttau)
Estimate the optical depth tau using shadows.
NumericalApproximation p_atmosAhSpline
Spline object for the atmospheric Ah Table. Properties are set in GenerateAhTable().
Definition AtmosModel.h:283
double AtmosBha() const
Return atmospheric Bha value.
Definition AtmosModel.h:115
double AtmosTau() const
Return atmospheric Tau value.
Definition AtmosModel.h:119
static double G11Prime(double tau)
Perform Chandra and Van de Hulst's series approximation for the g'11 function needed in second order ...
vector< double > AtmosIncTable()
Return atmospheric IncTable value.
Definition AtmosModel.h:156
double AtmosMunot() const
Return atmospheric Munot value.
Definition AtmosModel.h:151
void SetAtmosWha(const double wha)
Set the Atmospheric function parameter.
bool p_atmosAddOffset
Allow additive offset in fit.
Definition AtmosModel.h:268
void SetAtmosTau(const double tau)
Set the Atmospheric function parameter.
void SetAtmosBha(const double bha)
Set the Anisotropic Atmospheric function parameter.
double p_transs
Transmission of light that must be subtracted from the flat surface model to get the shadow model.
Definition AtmosModel.h:261
NumericalApproximation AtmosAhSpline()
If GenerateAhTable() has been called this returns a clamped cubic spline of the data set (p_atmosIncT...
Definition AtmosModel.h:183
NumericalApproximation p_atmosHahgt0Spline
Spline object for the atmospheric Hahg0 Table. Properties are set in GenerateHahgTables().
Definition AtmosModel.h:287
static double Ei(double x)
This routine computes the exponential integral, Ei(x).
void SetAtmosIord(const string offset)
Set additive offset in fit.
double AtmosTauref() const
Return atmospheric Tauref value.
Definition AtmosModel.h:131
double AtmosAb() const
Return atmospheric Ab value.
Definition AtmosModel.h:139
void GenerateAhTable()
This method computes the values of the atmospheric Ah table and sets the properties of the atmospheri...
void SetAtmosHnorm(const double hnorm)
Set the Atmospheric function parameter.
void SetAtmosAtmSwitch(const int atmswitch)
Set the switch that controls the function that will be integrated.
vector< double > AtmosAhTable()
Return atmospheric AhTable value.
Definition AtmosModel.h:160
virtual void SetStandardConditions(bool standard)
Used to calculate atmosphere at standard conditions.
void GenerateHahgTablesShadow()
This method is a modified version of the GenerateHahgTables method and is used solely for shadow mode...
AtmosModel(Pvl &pvl, PhotoModel &pmodel)
Create an AtmosModel object.
double p_pstd
Pure atmospheric-scattering term.
Definition AtmosModel.h:258
void SetAtmosPhi(const double phi)
Set the azimuth angle.
vector< double > AtmosHahgtTable()
Return atmospheric HahgtTable value.
Definition AtmosModel.h:164
void SetAtmosNulneg(const string nulneg)
Set the Atmospheric function parameter.
double p_trans0
Transmission of surface reflected light through the atmosphere with no scatterings in the atmosphere.
Definition AtmosModel.h:260
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.
bool AtmosAdditiveOffset() const
Allow additive offset in fit?
Definition AtmosModel.h:105
NumericalApproximation p_atmosHahgtSpline
Spline object for the atmospheric Hahg Table. Properties are set in GenerateHahgTables().
Definition AtmosModel.h:285
int AtmosNinc() const
Return atmospheric Ninc value.
Definition AtmosModel.h:147
double AtmosWha() const
Return atmospheric Wha value.
Definition AtmosModel.h:123
bool AtmosNulneg() const
Return atmospheric Nulneg value.
Definition AtmosModel.h:135
void GenerateHahgTables()
This method computes the values of the atmospheric Hahg and Hahg0 tables and sets the properties of t...
virtual ~AtmosModel()
Empty destructor.
Definition AtmosModel.h:64
string AlgorithmName() const
Return atmospheric algorithm name.
Definition AtmosModel.h:100
double AtmosHga() const
Return atmospheric Hga value.
Definition AtmosModel.h:127
void SetAtmosTauref(const double tauref)
Set the Atmospheric function parameter.
bool TauOrWhaChanged() const
Checks whether tau or wha have changed.
NumericalApproximation provides various numerical analysis methods of interpolation,...
This class extends Isis::NumericalApproximation.
Container for cube-like labels.
Definition Pvl.h:119
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.