8 #include "AtmosModel.h"
10 #include "Isotropic1.h"
13 #include "IException.h"
19 Isotropic1::Isotropic1(Pvl &pvl, PhotoModel &pmodel) : AtmosModel(pvl, pmodel) {
59 void Isotropic1::AtmosModelAlgorithm(
double phase,
double incidence,
double emission) {
71 if(p_atmosTau == 0.0) {
80 if(TauOrWhaChanged()) {
82 p_wha2 = 0.5 * p_atmosWha;
83 p_e2 = AtmosModel::En(2, p_atmosTau);
84 p_e3 = AtmosModel::En(3, p_atmosTau);
85 p_e4 = AtmosModel::En(4, p_atmosTau);
92 p_delta = (1.0 - (p_x0 + p_y0) - (1.0 - p_atmosWha) / (1.0 - (p_x0 - p_y0))) / (p_atmosWha * (0.5 - p_e3));
95 p_alpha0 = 1.0 + p_delta * (0.5 - p_e3);
96 p_alpha1 = 0.5 + p_delta * ((1.0 / 3.0) - p_e4);
97 p_beta0 = p_e2 + p_delta * (0.5 - p_e3);
98 p_beta1 = p_e3 + p_delta * ((1.0 / 3.0) - p_e4);
101 if(p_atmosWha == 1.0) {
102 p_e5 = AtmosModel::En(5, p_atmosTau);
103 p_alpha2 = (1.0 / 3.0) + p_delta * (0.25 - p_e5);
104 p_beta2 = p_e4 + p_delta * (0.25 - p_e5);
105 p_fixcon = (p_beta0 * p_atmosTau - p_alpha1 + p_beta1) / ((p_alpha1 + p_beta1) * p_atmosTau + 2.0 * (p_alpha2 + p_beta2));
109 p_gammax = p_wha2 * p_beta0;
110 p_gammay = 1.0 - p_wha2 * p_alpha0;
113 p_sbar = 1.0 - ((2.0 - p_atmosWha * p_alpha0) * p_alpha1 + p_atmosWha * p_beta0 * p_beta1);
115 SetOldTau(p_atmosTau);
116 SetOldWha(p_atmosWha);
120 hpsq1 = pow((1.0 + p_atmosHnorm), 2.0) - 1.0;
121 munot = cos((
PI / 180.0) * incidence);
122 maxval = max(1.0e-30, hpsq1 + munot * munot);
123 munotp = p_atmosHnorm / (sqrt(maxval) - munot);
124 munotp = max(munotp, p_atmosTau / 69.0);
125 mu = cos((
PI / 180.0) * emission);
126 maxval = max(1.0e-30, hpsq1 + mu * mu);
127 mup = p_atmosHnorm / (sqrt(maxval) - mu);
128 mup = max(mup, p_atmosTau / 69.0);
131 maxval = max(1.0e-30, munotp);
132 xx = -p_atmosTau / maxval;
140 emunot = exp(-p_atmosTau / munotp);
143 maxval = max(1.0e-30, mup);
144 xx = -p_atmosTau / maxval;
153 emu = exp(-p_atmosTau / mup);
156 xmunot = 1.0 + p_delta * munotp * (1.0 - emunot);
157 ymunot = emunot + p_delta * munotp * (1.0 - emunot);
158 xmu = 1.0 + p_delta * mup * (1.0 - emu);
159 ymu = emu + p_delta * mup * (1.0 - emu);
162 if(p_atmosWha == 1.0) {
163 fix = p_fixcon * munotp * (xmunot + ymunot);
164 xmunot = xmunot + fix;
165 ymunot = ymunot + fix;
166 fix = p_fixcon * mup * (xmu + ymu);
172 gmunot = p_gammax * xmunot + p_gammay * ymunot;
173 gmu = p_gammax * xmu + p_gammay * ymu;
176 p_pstd = 0.25 * p_atmosWha * munotp / (munotp + mup) * (xmunot * xmu - ymunot * ymu);
177 p_trans = gmunot * gmu;
180 p_trans0 = emunot * emu;
185 p_transs = (emunot + 0.5 * (p_gammax * xmunot + p_gammay * ymunot - emunot)) * emu;