20 inline double SQUARE(
double x) {
return x * x; }
21 static double const pi = 3.14159265358979;
24 inline double Lineshape_BR(
double obsfreq,
double linefreq,
double gamma,
25 double zeta,
double delta) {
27 double const c = 2.99792458e10;
29 double obsfreqghz = obsfreq / 1000.0;
30 double linefreqghz = linefreq / 1000.0;
32 double u1 = 2.0 /
pi *
SQUARE(obsfreqghz / linefreqghz);
35 u1 *= ((gamma - zeta) *
SQUARE(obsfreqghz) + (gamma + zeta) * u2);
41 return (u1 / u2) * c / 1.0e9;
45 double XHe,
double XH2S) {
284 double Ph2s = 1e3 * P * XH2S;
285 double Phe = 1e3 * P * XHe;
286 double Ph2 = 1e3 * P * XH2;
293 double const kb = 1.38066e-16;
294 double const c = 2.99792458e10;
295 double const h = 6.626075e-27;
298 double const PPunitsToDSunits = 1.0 / (c * 1.0e8);
303 double const Xi = 0.7;
304 double const To_linewidth = 296.0;
305 double const delnuh2_o = 1.96;
306 double const delnuhe_o = 1.20;
307 double const delnuh2s_o = 5.78;
308 double const delnuh2s_168ghz = 5.38;
309 double const delnuh2s_216ghz = 6.82;
310 double const delnuh2s_300ghz = 5.82;
311 double const delnuh2s_393ghz = 5.08;
312 double const eta = 1.5;
313 double const To_intensity = 300.0;
314 double const delta = 1.28 * Ph2s / 1000.0;
319 for (
auto I = 0; I < Nlines; I++) {
322 double delnu = delnuh2_o * (Ph2 / 1000.0) * pow(To_linewidth / T_in, Xi) +
323 delnuhe_o * (Phe / 1000.0) * pow(To_linewidth / T_in, Xi);
327 delnuh2s = delnuh2s_168ghz;
328 else if (
int(
h2s_lines[I].FREQ) == 216710)
329 delnuh2s = delnuh2s_216ghz;
330 else if (
int(
h2s_lines[I].FREQ) == 300505)
331 delnuh2s = delnuh2s_300ghz;
332 else if (
int(
h2s_lines[I].FREQ) == 393450)
333 delnuh2s = delnuh2s_393ghz;
335 delnuh2s = delnuh2s_o;
337 delnu += delnuh2s * (Ph2s / 1000.0) * pow(To_linewidth / T_in, Xi);
344 double A = 1.0e3 * Ph2s / (
pi * kb * T_in * delnu * 1.0e9 / c);
345 A *= pow(To_intensity / T_in, eta + 1.0);
346 A *= pow(10.0,
h2s_lines[I].LGINT) * PPunitsToDSunits;
348 (1.0 / T_in - 1.0 / To_intensity));
358 kh2s +=
A *
pi * delnu * (1.0e9 / c) * F;
double attenuation_H2S_Hofstadter(double freq, double P, double T, double XH2, double XHe, double XH2S)
double Lineshape_BR(double obsfreq, double linefreq, double gamma, double zeta, double delta)
static H2SLineList h2s_lines[]