9 #include "Anisotropic2.h"
10 #include "AtmosModel.h"
11 #include "Constants.h"
14 #include "IException.h"
66 double f1munot, f2munot, f3munot;
67 double f1mmunot, f2mmunot, f3mmunot;
69 double f1mu, f2mu, f3mu;
70 double f1mmu, f2mmu, f3mmu;
75 double xmunot_0, ymunot_0;
78 double xmunot_1, ymunot_1;
81 if(p_atmosBha == 0.0) {
85 if(p_atmosTau == 0.0) {
94 if(p_atmosWha == 1.0) {
95 QString msg =
"Anisotropic conservative case not implemented yet - WHA parameter cannot be set to 1.0.";
96 msg +=
"This will cause negative planetary curvature to occur.";
102 p_wha2 = 0.5 * p_atmosWha;
103 p_wham = 1.0 - p_atmosWha;
204 SetOldTau(p_atmosTau);
205 SetOldWha(p_atmosWha);
211 if(incidence == 90.0) {
215 munot = cos((
PI / 180.0) * incidence);
218 maxval = max(1.0e-30, hpsq1 + munot * munot);
220 munotp = max(munotp, p_atmosTau / 69.0);
222 if(emission == 90.0) {
226 mu = cos((
PI / 180.0) * emission);
229 maxval = max(1.0e-30, hpsq1 + mu * mu);
231 mup = max(mup, p_atmosTau / 69.0);
234 maxval = max(1.0e-30, munotp);
235 xx = -p_atmosTau / maxval;
243 emunot = exp(-p_atmosTau / munotp);
246 maxval = max(1.0e-30, mup);
247 xx = -p_atmosTau / maxval;
255 emu = exp(-p_atmosTau / mup);
260 if(fabs(xx - 1.0) < 1.0e-10) {
262 f1mmunot = xx * (log(1.0 + 1.0 / xx) -
p_e1 * emunot +
266 f1munot = xx * (log(xx / (1.0 - xx)) +
p_e1 / emunot +
268 f1mmunot = xx * (log(1.0 + 1.0 / xx) -
p_e1 * emunot +
272 QString msg =
"Negative length of planetary curvature encountered";
276 f2munot = munotp * (f1munot +
p_e2 / emunot - 1);
277 f2mmunot = -munotp * (f1mmunot +
p_e2 * emunot - 1);
278 f3munot = munotp * (f2munot +
p_e3 / emunot - 0.5);
279 f3mmunot = -munotp * (f2mmunot +
p_e3 * emunot - 0.5);
282 if(fabs(xx - 1.0) < 1.0e-10) {
284 f1mmu = xx * (log(1.0 + 1.0 / xx) -
p_e1 * emu +
AtmosModel::En(1, p_atmosTau * (1.0 + 1.0 / xx)));
287 f1mu = xx * (log(xx / (1.0 - xx)) +
p_e1 / emu +
AtmosModel::Ei(p_atmosTau * (1.0 / xx - 1.0)));
288 f1mmu = xx * (log(1.0 + 1.0 / xx) -
p_e1 * emu +
AtmosModel::En(1, p_atmosTau * (1.0 + 1.0 / xx)));
291 QString msg =
"Negative length of planetary curvature encountered";
295 f2mu = mup * (f1mu +
p_e2 / emu - 1);
296 f2mmu = -mup * (f1mmu +
p_e2 * emu - 1);
297 f3mu = mup * (f2mu +
p_e3 / emu - 0.5);
298 f3mmu = -mup * (f2mmu +
p_e3 * emu - 0.5);
301 xmunot_0 = 1.0 +
p_wha2 * (f1mmunot + p_atmosBha *
p_wham * f3mmunot) +
p_delta_0 * munotp * (1.0 - emunot);
302 ymunot_0 = emunot * (1.0 +
p_wha2 * (f1munot + p_atmosBha *
p_wham * f3munot)) +
308 xmunot_1 = 1.0 + 0.5 *
p_wha2 * p_atmosBha * (f1mmunot - f3mmunot) +
p_delta_1 * munotp * (1.0 - emunot);
309 ymunot_1 = emunot * (1.0 + 0.5 *
p_wha2 * p_atmosBha *
310 (f1munot - f3munot)) +
p_delta_1 * munotp * (1.0 - emunot);
311 xmu_1 = 1.0 + 0.5 *
p_wha2 * p_atmosBha * (f1mmu - f3mmu) +
p_delta_1 * mup * (1.0 - emu);
312 ymu_1 = emu * (1.0 + 0.5 *
p_wha2 * p_atmosBha * (f1mu - f3mu)) +
p_delta_1 * mup * (1.0 - emu);
315 gmunot =
p_p1 * xmunot_0 +
p_q1 * ymunot_0;
325 cosazss = 0.0 - munot * mu;
328 cosazss = cos((
PI / 180.0) * phase) - munot * mu;
331 xystuff = cxx * xmunot_0 * xmu_0 - cyy * ymunot_0 *
332 ymu_0 -
p_p0 * sum * (xmu_0 * ymunot_0 + ymu_0 * xmunot_0) + cosazss * p_atmosBha * (xmu_1 *
333 xmunot_1 - ymu_1 * ymunot_1);
334 p_pstd = 0.25 * p_atmosWha * munotp / (munotp + mup) * xystuff;