30 #ifndef lineshapedata_h 31 #define lineshapedata_h 35 #include "Faddeeva.hh" 38 #include <Eigen/Dense> 87 const Numeric& magnetic_magnitude,
91 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
93 const Numeric& dL0_dT=0.0)
const 95 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
101 const Numeric F0 = F0_noshift + L0 + zeeman_df * magnetic_magnitude;
108 for(
Index ii = 0; ii < nf; ii++)
110 F[ii] /= (denom0 -
Complex(0.0, f_grid[ii]));
120 for(
Index jj = 0; jj < nppd; jj++)
123 if(derivatives_data(jj) == JQT_temperature)
126 dF[jj] *=
Complex(dG0_dT, dL0_dT);
128 else if(derivatives_data(jj) == JQT_frequency or
129 derivatives_data(jj) == JQT_wind_magnitude or
130 derivatives_data(jj) == JQT_wind_u or
131 derivatives_data(jj) == JQT_wind_v or
132 derivatives_data(jj) == JQT_wind_w)
137 else if(derivatives_data(jj) == JQT_line_center)
142 else if(derivatives_data(jj) == JQT_line_gamma_self or
143 derivatives_data(jj) == JQT_line_gamma_selfexponent or
144 derivatives_data(jj) == JQT_line_pressureshift_self or
145 derivatives_data(jj) == JQT_line_gamma_foreign or
146 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
147 derivatives_data(jj) == JQT_line_pressureshift_foreign or
148 derivatives_data(jj) == JQT_line_gamma_water or
149 derivatives_data(jj) == JQT_line_gamma_waterexponent or
150 derivatives_data(jj) == JQT_line_pressureshift_water)
155 else if(derivatives_data(jj) == JQT_magnetic_magntitude)
158 dF[jj] *=
Complex(0.0, zeeman_df);
167 const Numeric& magnetic_magnitude,
171 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
173 const Numeric& dL0_dT=0.0)
const 177 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
183 const Numeric F0 = F0_noshift + L0 + zeeman_df * magnetic_magnitude;
188 for(
Index ii = 0; ii < nf; ii++)
190 Fplus = invPI / (denom0 -
Complex(0.0, f_grid[ii]));
191 Fminus = invPI / (denom1 -
Complex(0.0, f_grid[ii]));
192 F[ii] = Fplus + Fminus;
194 for(
Index jj = 0; jj < nppd; jj++)
196 if(derivatives_data(jj) == JQT_temperature)
198 dF[jj][ii] = (Fplus * Fplus *
Complex(dG0_dT, dL0_dT) + Fminus * Fminus *
Complex(dG0_dT, -dL0_dT)) * PI;
200 else if(derivatives_data(jj) == JQT_frequency or
201 derivatives_data(jj) == JQT_wind_magnitude or
202 derivatives_data(jj) == JQT_wind_u or
203 derivatives_data(jj) == JQT_wind_v or
204 derivatives_data(jj) == JQT_wind_w)
206 dF[jj][ii] = (Fplus * Fplus + Fminus * Fminus) * PI;
207 dF[jj][ii] *=
Complex(0.0, -1.0);
209 else if(derivatives_data(jj) == JQT_line_center)
211 dF[jj][ii] = (Fplus * Fplus *
Complex(0.0, 1.0) + Fminus * Fminus *
Complex(0.0, -1.0)) * PI;
213 else if(derivatives_data(jj) == JQT_line_gamma_self or
214 derivatives_data(jj) == JQT_line_gamma_selfexponent or
215 derivatives_data(jj) == JQT_line_pressureshift_self or
216 derivatives_data(jj) == JQT_line_gamma_foreign or
217 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
218 derivatives_data(jj) == JQT_line_pressureshift_foreign or
219 derivatives_data(jj) == JQT_line_gamma_water or
220 derivatives_data(jj) == JQT_line_gamma_waterexponent or
221 derivatives_data(jj) == JQT_line_pressureshift_water)
223 dF[jj][ii] = (Fplus * Fplus *
Complex(1.0, 1.0) + Fminus * Fminus *
Complex(1.0, -1.0)) * PI;
225 else if(derivatives_data(jj) == JQT_magnetic_magntitude)
227 dF[jj][ii] = (Fplus * Fplus *
Complex(0.0, zeeman_df) + Fminus * Fminus *
Complex(0.0, -zeeman_df)) * PI;
237 const Numeric& magnetic_magnitude,
240 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
241 const Numeric& dGD_div_F0_dT=0.0)
const 258 const Numeric& magnetic_magnitude,
267 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
268 const Numeric& dGD_div_F0_dT=0.0,
274 const Numeric& dFVC_dT=0.0)
const 286 static const Complex i(0.0, 1.0), one_plus_one_i(1.0, 1.0);
287 static const Numeric ln2 = log(2.0), sqrtLN2 =
sqrt(ln2);
288 static const Numeric sqrtPI =
sqrt(PI), invPI = 1.0 /
PI, invSqrtPI =
sqrt(invPI);
291 Complex A, B, Zp, Zm, Zp2, Zm2, wiZp, wiZm, X, sqrtXY, invG;
294 Complex dA, dB, dC0, dC0t, dC2, dC2t, dZp, dZm, dwiZp, dwiZm, dX, dY, dg;
300 const Index nppd = derivatives_data.nelem();
303 const Numeric F0 = F0_noshift + zeeman_df * magnetic_magnitude;
304 const Numeric F0_ratio = F0_noshift /
F0;
306 const Numeric one_minus_eta = 1.0 - eta;
307 const Numeric dGD_dT = dGD_div_F0_dT *
F0;
310 const Index first_frequency = derivatives_data.get_first_frequency(),
311 first_pressure_broadening = derivatives_data.get_first_pressure_term();
318 const Complex C0_m1p5_C2 = (C0 - 1.5 * C2);
319 const Complex C0t = one_minus_eta * C0_m1p5_C2 + FVC;
320 const Complex invC2t = 1.0 / (one_minus_eta * C2);
323 const Complex sqrtY = 0.5 * invC2t * GD / sqrtLN2;
324 const Complex Y = sqrtY * sqrtY;
327 const Numeric const1 = ((sqrtLN2 * sqrtPI) / GD);
330 for(
Index ii = 0; ii < nf; ii++)
333 X = (C0t -
i*(F0 - f_grid[ii])) * invC2t;
346 A = const1 * (wiZm - wiZp);
349 if(eta not_eq 0.0 or deta_dT not_eq 0.0)
353 B = (1.0 / one_minus_eta) * (-1.0 + 0.5 * sqrtPI / sqrtY * ((1.0 - Zm2)*wiZm - (1.0 - Zp2)*wiZp));
354 invG = 1.0 / (1.0 - (FVC - eta * C0_m1p5_C2)*A + eta * B);
358 invG = 1.0 / (1.0 - FVC*A);
360 F[ii] = A * invG * invPI;
362 for(
Index jj = 0; jj < nppd; jj++)
364 if(derivatives_data(jj) == JQT_frequency or
365 derivatives_data(jj) == JQT_wind_magnitude or
366 derivatives_data(jj) == JQT_wind_u or
367 derivatives_data(jj) == JQT_wind_v or
368 derivatives_data(jj) == JQT_wind_w)
371 if(first_frequency == jj)
374 dZp = dZm = 0.5 * dX / sqrtXY;
376 dwiZm = dwiZp = i * invSqrtPI;
382 dA = const1 * (dwiZm - dwiZp);
386 dB = 0.5 * sqrtPI / (sqrtY * one_minus_eta) * ((1.0 - Zm2) * dwiZm - 2.0 * Zm * dZm * wiZm + (1.0 - Zp2) * dwiZp + 2.0 * Zp * dZp * wiZp);
387 dg = eta * (C0_m1p5_C2 * dA - dB) - FVC * dA;
394 dF[jj][ii] = invG * (invPI * dA - F[ii] * dg);
398 dF[jj][ii] = dF[first_frequency][ii];
401 else if(derivatives_data(jj) == JQT_temperature)
403 dC0 = dG0_dT +
i*dL0_dT;
404 dC2 = dG2_dT +
i*dL2_dT;
406 dC0t = one_minus_eta * (dC0 - 1.5 * dC2) - deta_dT * C0_m1p5_C2 + dFVC_dT;
407 dC2t = one_minus_eta * dC2 - deta_dT * C2;
409 dY = GD / (2.0 * ln2) * invC2t*invC2t * (dGD_dT - GD * invC2t * dC2t);
410 dX = invC2t * (dC0t - X*dC2t);
412 dZm = dZp = 0.5 * (dX + dY) / sqrtXY;
413 dZm -= 0.5 / sqrtY * dY;
414 dZp += 0.5 / sqrtY * dY;
416 dwiZm = dwiZp =
i * invSqrtPI;
422 dA = const1 * (dwiZm - dwiZp - A * GD_div_F0);
426 dB = 1.0 / one_minus_eta * (1.0 / one_minus_eta * deta_dT + 0.5 * sqrtPI / sqrtY * ( - 0.5 * ((1.0 - Zm2) * wiZm - (1.0 - Zp2) * wiZp) / Y * dY + (1.0 - Zm2) * dwiZm - 2.0 * Zm * dZm * wiZm + (1.0 - Zp2) * dwiZp + 2.0 * Zp * dZp * wiZp));
427 dg = (dFVC_dT - deta_dT * C0_m1p5_C2 - eta * (dC0 - 1.5 * dC2)) * A - (FVC - eta * C0_m1p5_C2) * dA + deta_dT * B + eta * dB;
431 dg = (dFVC_dT - deta_dT * C0_m1p5_C2) * A - FVC * dA + deta_dT * B;
434 dF[jj][ii] = invG * (invPI * dA - F[ii] * dg);
436 else if(derivatives_data(jj) == JQT_line_center)
438 dY = GD / (2.0 * ln2) * invC2t*invC2t * GD_div_F0 * F0_ratio;
439 dX = -
i * invC2t * F0_ratio;
441 dZm = dZp = 0.5 * (dX + dY) / sqrtXY;
442 dZm -= 0.5 / sqrtY * dY;
443 dZp += 0.5 / sqrtY * dY;
445 dwiZm = dwiZp =
i * invSqrtPI;
451 dA = const1 * (dwiZm - dwiZp - A * GD_div_F0);
455 dB = 0.5 * sqrtPI / (sqrtY * one_minus_eta) * (- 0.5 * ((1.0 - Zm2) * wiZm - (1.0 - Zp2) * wiZp) / Y * dY + (1.0 - Zm2) * dwiZm - 2.0 * Zm * dZm * wiZm + (1.0 - Zp2) * dwiZp + 2.0 * Zp * dZp * wiZp);
456 dg = eta * (C0_m1p5_C2 * dA - dB) - FVC * dA;
463 dF[jj][ii] = invG * (invPI * dA - F[ii] * dg);
465 else if(derivatives_data(jj) == JQT_line_gamma_self or
466 derivatives_data(jj) == JQT_line_gamma_selfexponent or
467 derivatives_data(jj) == JQT_line_pressureshift_self or
468 derivatives_data(jj) == JQT_line_gamma_foreign or
469 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
470 derivatives_data(jj) == JQT_line_pressureshift_foreign or
471 derivatives_data(jj) == JQT_line_gamma_water or
472 derivatives_data(jj) == JQT_line_gamma_waterexponent or
473 derivatives_data(jj) == JQT_line_pressureshift_water)
476 if(first_pressure_broadening == jj)
478 dC0t = one_minus_eta * one_plus_one_i;
480 dZm = dZp = 0.5 * dX / sqrtXY;
482 dwiZm = dwiZp =
i * invSqrtPI;
488 dA = const1 * (dwiZm - dwiZp);
492 dB = 0.5 * sqrtPI / (sqrtY * one_minus_eta) * ((1.0 - Zm2) * dwiZm - 2.0 * Zm * dZm * wiZm + (1.0 - Zp2) * dwiZp + 2.0 * Zp * dZp * wiZp);
493 dg = eta * (C0_m1p5_C2 * dA - dB - dC0 * A) - FVC * dA;
500 dF[jj][ii] = invG * (invPI * dA - F[ii] * dg);
504 dF[jj][ii] = dF[first_frequency][ii];
507 else if(derivatives_data(jj) == JQT_magnetic_magntitude)
509 dY = GD / (2.0 * ln2) * invC2t*invC2t * GD_div_F0 * (1.0 - F0_ratio) / magnetic_magnitude;
510 dX = -
i * invC2t * (1.0 - F0_ratio) / magnetic_magnitude;
512 dZm = dZp = 0.5 * (dX + dY) / sqrtXY;
513 dZm -= 0.5 / sqrtY * dY;
514 dZp += 0.5 / sqrtY * dY;
516 dwiZm = dwiZp =
i * invSqrtPI;
522 dA = const1 * (dwiZm - dwiZp - A * GD_div_F0);
526 dB = 0.5 * sqrtPI / (sqrtY * one_minus_eta) *
527 (- 0.5 * ((1.0 - Zm2) * wiZm - (1.0 - Zp2) * wiZp) / Y * dY +
528 (1.0 - Zm2) * dwiZm - 2.0 * Zm * dZm * wiZm +
529 (1.0 - Zp2) * dwiZp + 2.0 * Zp * dZp * wiZp);
530 dg = eta * (C0_m1p5_C2 * dA - dB) - FVC * dA;
537 dF[jj][ii] = invG * (invPI * dA - F[ii] * dg);
547 const Numeric& magnetic_magnitude,
552 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
553 const Numeric& dGD_div_F0_dT=0.0,
555 const Numeric& dL0_dT=0.0)
const 561 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
570 const Numeric F0 = F0_noshift + zeeman_df * magnetic_magnitude + L0;
572 const Numeric invGD = 1.0 / GD;
573 const Numeric dGD_dT = dGD_div_F0_dT *
F0;
582 const Index first_pressure_broadening = derivatives_data.get_first_pressure_term(),
583 first_frequency = derivatives_data.get_first_frequency();
586 for (
Index ii=0; ii<nf; ii++)
588 dx = f_grid[ii] * invGD;
594 for(
Index jj = 0; jj < nppd; jj++)
597 dw_over_dz = 2.0 * (z * w - sqrt_invPI);
599 if(derivatives_data(jj) == JQT_frequency or
600 derivatives_data(jj) == JQT_wind_magnitude or
601 derivatives_data(jj) == JQT_wind_u or
602 derivatives_data(jj) == JQT_wind_v or
603 derivatives_data(jj) == JQT_wind_w)
606 if(first_frequency == jj)
610 dF[jj][ii] = fac * dw_over_dz * invGD;
614 dF[jj][ii] = dF[first_frequency][ii];
617 else if(derivatives_data(jj) == JQT_temperature)
619 dz =
Complex(-dL0_dT, dG0_dT) - z * dGD_dT;
621 dF[jj][ii] = -F[ii] * dGD_dT;
622 dF[jj][ii] += fac * dw_over_dz * dz;
625 else if(derivatives_data(jj) == JQT_line_center)
627 dz = -z * GD_div_F0 - 1.0;
629 dF[jj][ii] = -F[ii] * GD_div_F0;
630 dF[jj][ii] += dw_over_dz * dz;
631 dF[jj][ii] *= fac * invGD;
633 else if(derivatives_data(jj) == JQT_line_gamma_self or
634 derivatives_data(jj) == JQT_line_gamma_selfexponent or
635 derivatives_data(jj) == JQT_line_pressureshift_self or
636 derivatives_data(jj) == JQT_line_gamma_foreign or
637 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
638 derivatives_data(jj) == JQT_line_pressureshift_foreign or
639 derivatives_data(jj) == JQT_line_gamma_water or
640 derivatives_data(jj) == JQT_line_gamma_waterexponent or
641 derivatives_data(jj) == JQT_line_pressureshift_water)
644 if(first_pressure_broadening == jj)
646 dz =
Complex(-1.0, 1.0) * invGD;
647 dF[jj][ii] = fac * dw_over_dz * dz;
651 dF[jj][ii] = dF[first_frequency][ii];
654 else if(derivatives_data(jj) == JQT_magnetic_magntitude)
658 dF[jj][ii] = fac * dw_over_dz * (- zeeman_df * invGD);
660 else if(derivatives_data(jj) == JQT_line_mixing_DF or
661 derivatives_data(jj) == JQT_line_mixing_DF0 or
662 derivatives_data(jj) == JQT_line_mixing_DF1 or
663 derivatives_data(jj) == JQT_line_mixing_DFexp)
667 dF[jj][ii] = fac * dw_over_dz * (-invGD);
677 const Complex& eigenvalue_no_shift,
680 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
681 const Numeric& dGD_div_F0_dT=0.0,
682 const Complex& deigenvalue_dT=0.0,
683 const Numeric& dL0_dT=0.0)
const 689 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
698 const Complex eigenvalue = eigenvalue_no_shift + L0;
699 const Numeric F0 = eigenvalue.real() + L0;
701 const Numeric invGD = 1.0 / GD;
702 const Numeric dGD_dT = dGD_div_F0_dT *
F0;
709 const Complex z0 = -eigenvalue * invGD;
711 const Index first_pressure_broadening = derivatives_data.get_first_pressure_term(),
712 first_frequency = derivatives_data.get_first_frequency();
715 for (
Index ii=0; ii<nf; ii++)
717 dx = f_grid[ii] * invGD;
723 for(
Index jj = 0; jj < nppd; jj++)
726 dw_over_dz = 2.0 * (z * w - sqrt_invPI);
728 if(derivatives_data(jj) == JQT_frequency or
729 derivatives_data(jj) == JQT_wind_magnitude or
730 derivatives_data(jj) == JQT_wind_u or
731 derivatives_data(jj) == JQT_wind_v or
732 derivatives_data(jj) == JQT_wind_w)
735 if(first_frequency == jj)
739 dF[jj][ii] = fac * dw_over_dz * invGD;
743 dF[jj][ii] = dF[first_frequency][ii];
746 else if(derivatives_data(jj) == JQT_temperature)
748 dz = (deigenvalue_dT - dL0_dT) - z * dGD_dT;
750 dF[jj][ii] = -F[ii] * dGD_dT;
751 dF[jj][ii] += fac * dw_over_dz * dz;
754 else if(derivatives_data(jj) == JQT_line_center)
756 dz = -z * GD_div_F0 - 1.0;
758 dF[jj][ii] = -F[ii] * GD_div_F0;
759 dF[jj][ii] += dw_over_dz * dz;
760 dF[jj][ii] *= fac * invGD;
762 else if(derivatives_data(jj) == JQT_line_gamma_self or
763 derivatives_data(jj) == JQT_line_gamma_selfexponent or
764 derivatives_data(jj) == JQT_line_pressureshift_self or
765 derivatives_data(jj) == JQT_line_gamma_foreign or
766 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
767 derivatives_data(jj) == JQT_line_pressureshift_foreign or
768 derivatives_data(jj) == JQT_line_gamma_water or
769 derivatives_data(jj) == JQT_line_gamma_waterexponent or
770 derivatives_data(jj) == JQT_line_pressureshift_water)
773 if(first_pressure_broadening == jj)
775 dz =
Complex(-1.0, 1.0) * invGD;
776 dF[jj][ii] = fac * dw_over_dz * dz;
780 dF[jj][ii] = dF[first_frequency][ii];
783 else if(derivatives_data(jj) == JQT_line_mixing_DF or
784 derivatives_data(jj) == JQT_line_mixing_DF0 or
785 derivatives_data(jj) == JQT_line_mixing_DF1 or
786 derivatives_data(jj) == JQT_line_mixing_DFexp)
790 dF[jj][ii] = fac * dw_over_dz * (-invGD);
801 const Numeric& magnetic_magnitude,
806 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
807 const Numeric& dGD_div_F0_dT=0.0,
809 const Numeric& dL0_dT=0.0)
const 821 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
830 const Numeric F0 = F0_noshift + zeeman_df * magnetic_magnitude + L0;
832 const Numeric invGD = 1.0 / GD;
833 const Numeric dGD_dT = dGD_div_F0_dT *
F0;
841 const Index first_pressure_broadening = derivatives_data.get_first_pressure_term(),
842 first_frequency = derivatives_data.get_first_frequency();
845 for (
Index ii=0; ii<nf; ii++)
847 dx = f_grid[ii] * invGD;
855 A = (((((.5641896f*z+5.912626f)*z+30.18014f)*z+
856 93.15558f)*z+181.9285f)*z+214.3824f)*z+122.6079f;
857 B = ((((((z+10.47986f)*z+53.99291f)*z+170.3540f)*z+
858 348.7039f)*z+457.3345f)*z+352.7306f)*z+122.6079f;
863 for(
Index jj = 0; jj < nppd; jj++)
866 dw_over_dz = 2.0 * (z * w - sqrt_invPI);
868 if(derivatives_data(jj) == JQT_frequency or
869 derivatives_data(jj) == JQT_wind_magnitude or
870 derivatives_data(jj) == JQT_wind_u or
871 derivatives_data(jj) == JQT_wind_v or
872 derivatives_data(jj) == JQT_wind_w)
875 if(first_frequency == jj)
879 dF[jj][ii] = fac * dw_over_dz * invGD;
883 dF[jj][ii] = dF[first_frequency][ii];
886 else if(derivatives_data(jj) == JQT_temperature)
888 dz =
Complex(-dL0_dT, dG0_dT) - z * dGD_dT;
890 dF[jj][ii] = -F[ii] * dGD_dT;
891 dF[jj][ii] += fac * dw_over_dz * dz;
894 else if(derivatives_data(jj) == JQT_line_center)
896 dz = -z * GD_div_F0 - 1.0;
898 dF[jj][ii] = -F[ii] * GD_div_F0;
899 dF[jj][ii] += dw_over_dz * dz;
900 dF[jj][ii] *= fac * invGD;
902 else if(derivatives_data(jj) == JQT_line_gamma_self or
903 derivatives_data(jj) == JQT_line_gamma_selfexponent or
904 derivatives_data(jj) == JQT_line_pressureshift_self or
905 derivatives_data(jj) == JQT_line_gamma_foreign or
906 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
907 derivatives_data(jj) == JQT_line_pressureshift_foreign or
908 derivatives_data(jj) == JQT_line_gamma_water or
909 derivatives_data(jj) == JQT_line_gamma_waterexponent or
910 derivatives_data(jj) == JQT_line_pressureshift_water)
913 if(first_pressure_broadening == jj)
915 dz =
Complex(-1.0, 1.0) * invGD;
916 dF[jj][ii] = fac * dw_over_dz * dz;
920 dF[jj][ii] = dF[first_frequency][ii];
923 else if(derivatives_data(jj) == JQT_magnetic_magntitude)
927 dF[jj][ii] = fac * dw_over_dz * (- zeeman_df * invGD);
929 else if(derivatives_data(jj) == JQT_line_mixing_DF or
930 derivatives_data(jj) == JQT_line_mixing_DF0 or
931 derivatives_data(jj) == JQT_line_mixing_DF1 or
932 derivatives_data(jj) == JQT_line_mixing_DFexp)
936 dF[jj][ii] = fac * dw_over_dz * (-invGD);
947 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
950 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
956 for(
Index ii = 0; ii < nf; ii++)
958 F[ii] = fac / ((f_grid[ii]-
F0) * (f_grid[ii]-F0));
961 for(
Index jj = 0; jj < nppd; jj++)
963 if(derivatives_data(jj) == JQT_temperature)
966 dF[jj] *= dG0_dT * invG0;
968 else if(derivatives_data(jj) == JQT_frequency or
969 derivatives_data(jj) == JQT_wind_magnitude or
970 derivatives_data(jj) == JQT_wind_u or
971 derivatives_data(jj) == JQT_wind_v or
972 derivatives_data(jj) == JQT_wind_w)
975 for(
Index ii = 0; ii < nf; ii++)
977 dF[jj][ii] /= -2.0 / (f_grid[ii] -
F0);
980 else if(derivatives_data(jj) == JQT_line_center)
983 for(
Index ii = 0; ii < nf; ii++)
985 dF[jj][ii] *= 2.0 / (f_grid[ii] -
F0);
988 else if(derivatives_data(jj) == JQT_line_gamma_self or
989 derivatives_data(jj) == JQT_line_gamma_selfexponent or
990 derivatives_data(jj) == JQT_line_gamma_foreign or
991 derivatives_data(jj) == JQT_line_gamma_foreignexponent or
992 derivatives_data(jj) == JQT_line_gamma_water or
993 derivatives_data(jj) == JQT_line_gamma_waterexponent)
1005 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
1007 const Numeric& dG_dT=0.0)
const 1009 const Index nf = F.
nelem(), nppd = derivatives_data.nelem();
1014 for(
Index iq = 0; iq < nppd; iq++)
1016 if(derivatives_data(iq) == JQT_temperature)
1019 for(
Index ii = 0; ii < nf; ii++)
1021 dF[iq][ii] += F[ii] * dLM_dT;
1024 else if(derivatives_data(iq) == JQT_line_mixing_Y or
1025 derivatives_data(iq) == JQT_line_mixing_Y0 or
1026 derivatives_data(iq) == JQT_line_mixing_Y1 or
1027 derivatives_data(iq) == JQT_line_mixing_Yexp)
1032 else if(derivatives_data(iq) == JQT_line_mixing_G or
1033 derivatives_data(iq) == JQT_line_mixing_G0 or
1034 derivatives_data(iq) == JQT_line_mixing_G1 or
1035 derivatives_data(iq) == JQT_line_mixing_Gexp)
1053 const PropmatPartialsData& derivatives_data=PropmatPartialsData())
const 1055 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
1062 sinh((PLANCK_CONST * F0) / (2.000e0 * BOLTZMAN_CONST * T)) * invF0;
1064 Numeric dmafac_dF0_div_fun, dmafac_dT_div_fun;
1065 if(derivatives_data.do_line_center())
1067 dmafac_dF0_div_fun = -invF0 -
1068 PLANCK_CONST/(2.0*BOLTZMAN_CONST*T*tanh(F0*PLANCK_CONST/(2.0*BOLTZMAN_CONST*T)));
1070 if(derivatives_data.do_temperature())
1072 dmafac_dT_div_fun = -(BOLTZMAN_CONST*T - F0*PLANCK_CONST/
1073 (2.0*tanh(F0*PLANCK_CONST/(2.0*BOLTZMAN_CONST*T))))/(BOLTZMAN_CONST*T*T);
1078 for (
Index ii=0; ii < nf; ii++)
1080 fun = mafac * (f_grid[ii] * f_grid[ii]);
1083 for(
Index jj = 0; jj < nppd; jj++)
1086 if(derivatives_data(jj) == JQT_temperature)
1088 dF[jj][ii] += dmafac_dT_div_fun * F[ii];
1090 else if(derivatives_data(jj) == JQT_line_center)
1092 dF[jj][ii] += dmafac_dF0_div_fun * F[ii];
1094 else if(derivatives_data(jj) == JQT_frequency or
1095 derivatives_data(jj) == JQT_wind_magnitude or
1096 derivatives_data(jj) == JQT_wind_u or
1097 derivatives_data(jj) == JQT_wind_v or
1098 derivatives_data(jj) == JQT_wind_w)
1100 dF[jj][ii] += (2.0 / f_grid[ii]) * F[ii];
1111 const PropmatPartialsData& derivatives_data=PropmatPartialsData())
const 1116 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
1119 const Numeric kT = 2.0 * BOLTZMAN_CONST * T;
1123 const Numeric tanh_f0part = tanh(PLANCK_CONST * absF0 / kT);
1124 const Numeric denom = absF0 * tanh_f0part;
1127 if(derivatives_data.do_line_center())
1128 fac_df0 = (-1.0/absF0 + PLANCK_CONST*tanh_f0part/(kT) - PLANCK_CONST/(kT*tanh_f0part)) * F0/absF0;
1130 for(
Index ii=0; ii < nf; ii++)
1132 const Numeric tanh_fpart = tanh( PLANCK_CONST * f_grid[ii] / kT );
1133 const Numeric fun = f_grid[ii] * tanh_fpart / denom;
1136 for(
Index jj = 0; jj < nppd; jj++)
1139 if(derivatives_data(jj) == JQT_temperature)
1141 dF[jj][ii] += (-PLANCK_CONST*(denom - absF0/tanh_f0part -
1142 f_grid[ii]*tanh_fpart + f_grid[ii]/tanh_fpart)/(kT*T)) * F[ii];
1144 else if(derivatives_data(jj) == JQT_line_center)
1146 dF[jj][ii] += fac_df0 * F[ii];
1148 else if(derivatives_data(jj) == JQT_frequency or
1149 derivatives_data(jj) == JQT_wind_magnitude or
1150 derivatives_data(jj) == JQT_wind_u or
1151 derivatives_data(jj) == JQT_wind_v or
1152 derivatives_data(jj) == JQT_wind_w)
1154 dF[jj][ii] += (1.0/f_grid[ii] -PLANCK_CONST*tanh_fpart/kT + PLANCK_CONST/(kT*tanh_fpart)) * F[ii];
1164 const PropmatPartialsData& derivatives_data=PropmatPartialsData())
const 1166 const Index nf = f_grid.
nelem(), nppd = derivatives_data.nelem();
1170 const Numeric invF02 = invF0 * invF0;
1172 for(
Index ii = 0; ii < nf; ii++)
1174 const Numeric fun = f_grid[ii] * f_grid[ii] * invF02;
1177 for(
Index jj = 0; jj < nppd; jj++)
1180 if(derivatives_data(jj) == JQT_line_center)
1182 dF[jj][ii] -= 2.0 * invF0 * F[ii];
1184 else if(derivatives_data(jj) == JQT_frequency or
1185 derivatives_data(jj) == JQT_wind_magnitude or
1186 derivatives_data(jj) == JQT_wind_u or
1187 derivatives_data(jj) == JQT_wind_v or
1188 derivatives_data(jj) == JQT_wind_w)
1190 dF[jj][ii] += 2.0 * f_grid[ii] * F[ii];
1199 const Numeric& isotopic_ratio,
1206 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
1210 const Numeric& dK2_dF0=0.0)
const 1212 const Index nppd = derivatives_data.nelem();
1215 const Numeric QT_ratio = QT0 * invQT;
1216 const Numeric S = S0 * isotopic_ratio * QT_ratio * K1 * K2;
1218 for(
Index jj = 0; jj < nppd; jj++)
1220 if(derivatives_data(jj) == JQT_temperature)
1222 Eigen::VectorXcd eig_dF =
MapToEigen(dF[jj]);
1225 eig_dF +=
MapToEigen(F) * (S0 * isotopic_ratio * QT_ratio *
1228 invQT * dQT_dT * K1 * K2));
1230 else if(derivatives_data(jj) == JQT_line_strength)
1233 dF[jj] *= isotopic_ratio;
1235 else if(derivatives_data(jj) == JQT_line_center)
1237 Eigen::VectorXcd eig_dF =
MapToEigen(dF[jj]);
1240 eig_dF +=
MapToEigen(F) * (S0 * isotopic_ratio * QT_ratio * K1 * dK2_dF0);
1255 const Numeric& isotopic_ratio,
1256 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
1257 const Complex& dS_LM_dT=0.0)
const 1263 const Index nppd = derivatives_data.nelem();
1266 F0_invT = F0 * invT,
1267 exp_factor = exp(C1 * F0_invT),
1268 f0_factor = F0 * (1.0 - exp_factor);
1270 const Complex S = S_LM * f0_factor * isotopic_ratio;
1272 for(
Index jj = 0; jj < nppd; jj++)
1274 if(derivatives_data(jj) == JQT_temperature)
1276 Eigen::VectorXcd eig_dF =
MapToEigen(dF[jj]);
1279 eig_dF +=
MapToEigen(F) * (dS_LM_dT * f0_factor +
1280 S_LM * C1 * F0_invT * F0_invT * exp_factor) * isotopic_ratio;
1282 else if(derivatives_data(jj) == JQT_line_strength)
1284 throw std::runtime_error(
"Not working yet");
1286 else if(derivatives_data(jj) == JQT_line_center)
1288 throw std::runtime_error(
"Not working yet");
1305 const Numeric& isotopic_ratio,
1306 const PropmatPartialsData& derivatives_data=PropmatPartialsData(),
1307 const Numeric& drho_dT=0.0)
const 1315 const Index nppd = derivatives_data.nelem();
1317 const Numeric S = d0 * d0 * rho * isotopic_ratio,
1319 F0_invT = F0 * invT,
1320 exp_factor = exp(C1 * F0_invT),
1321 f0_factor = F0 * (1.0 - exp_factor);
1323 for(
Index jj = 0; jj < nppd; jj++)
1325 if(derivatives_data(jj) == JQT_temperature)
1329 eig_dF *= S * f0_factor;
1330 eig_dF +=
MapToEigen(F) * (d0 * d0 * (drho_dT * f0_factor +
1331 rho * C1 * F0_invT * F0_invT * exp_factor) * isotopic_ratio);
1333 else if(derivatives_data(jj) == JQT_line_center)
1335 throw std::runtime_error(
"Not working yet");
1339 dF[jj] *= S * f0_factor;
1347 const PropmatPartialsData& derivatives_data,
1348 const Numeric& dgamma_dline_gamma_self=0.0,
1349 const Numeric& dgamma_dline_gamma_foreign=0.0,
1350 const Numeric& dgamma_dline_gamma_water=0.0,
1351 const Numeric& dgamma_dline_pressureshift_self=0.0,
1352 const Numeric& dgamma_dline_pressureshift_foreign=0.0,
1353 const Numeric& dgamma_dline_pressureshift_water=0.0,
1354 const Complex& dgamma_dline_gamma_selfexponent=0.0,
1355 const Complex& dgamma_dline_gamma_foreignexponent=0.0,
1356 const Complex& dgamma_dline_gamma_waterexponent=0.0)
1358 const Index nppd = derivatives_data.nelem();
1360 for(
Index jj = 0; jj < nppd; jj++)
1362 if(derivatives_data(jj) == JQT_line_gamma_self)
1364 dF[jj] *= dgamma_dline_gamma_self;
1366 else if(derivatives_data(jj) == JQT_line_gamma_foreign)
1368 dF[jj] *= dgamma_dline_gamma_foreign;
1370 else if(derivatives_data(jj) == JQT_line_gamma_water)
1372 dF[jj] *= dgamma_dline_gamma_water;
1374 else if(derivatives_data(jj) == JQT_line_pressureshift_self)
1376 dF[jj] *=
Complex(0.0, dgamma_dline_pressureshift_self);
1378 else if(derivatives_data(jj) == JQT_line_pressureshift_foreign)
1380 dF[jj] *=
Complex(0.0, dgamma_dline_pressureshift_foreign);
1382 else if(derivatives_data(jj) == JQT_line_pressureshift_water)
1384 dF[jj] *=
Complex(0.0, dgamma_dline_pressureshift_water);
1386 else if(derivatives_data(jj) == JQT_line_gamma_selfexponent)
1388 dF[jj] *= dgamma_dline_gamma_selfexponent;
1390 else if(derivatives_data(jj) == JQT_line_gamma_foreignexponent)
1392 dF[jj] *= dgamma_dline_gamma_foreignexponent;
1394 else if(derivatives_data(jj) == JQT_line_gamma_waterexponent)
1396 dF[jj] *= dgamma_dline_gamma_waterexponent;
1409 #endif //lineshapedata_h INDEX Index
The type to use for all integer numbers and indices.
const Numeric PLANCK_CONST
Global constant, the Planck constant [Js].
A class implementing complex numbers for ARTS.
void set_hui_etal_1978(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &GD_div_F0, const Numeric &G0, const Numeric &L0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dGD_div_F0_dT=0.0, const Numeric &dG0_dT=0.0, const Numeric &dL0_dT=0.0) const
void apply_linestrength(ComplexVector &F, ArrayOfComplexVector &dF, const Numeric &S0, const Numeric &isotopic_ratio, const Numeric &QT, const Numeric &QT0, const Numeric &K1, const Numeric &K2, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dQT_dT=0.0, const Numeric &dK1_dT=0.0, const Numeric &dK2_dT=0.0, const Numeric &dK2_dF0=0.0) const
const Numeric BOLTZMAN_CONST
Global constant, the Boltzmann constant [J/K].
void apply_VVH(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &F0, const Numeric &T, const PropmatPartialsData &derivatives_data=PropmatPartialsData()) const
Numeric fac(const Index n)
fac
cmplx FADDEEVA() w(cmplx z, double relerr)
Array< LineFunctions > ArrayOfLineFunctions
void apply_pressurebroadening_jacobian(ArrayOfComplexVector &dF, const PropmatPartialsData &derivatives_data, const Numeric &dgamma_dline_gamma_self=0.0, const Numeric &dgamma_dline_gamma_foreign=0.0, const Numeric &dgamma_dline_gamma_water=0.0, const Numeric &dgamma_dline_pressureshift_self=0.0, const Numeric &dgamma_dline_pressureshift_foreign=0.0, const Numeric &dgamma_dline_pressureshift_water=0.0, const Complex &dgamma_dline_gamma_selfexponent=0.0, const Complex &dgamma_dline_gamma_foreignexponent=0.0, const Complex &dgamma_dline_gamma_waterexponent=0.0)
void apply_linestrength_from_full_linemixing(ComplexVector &F, ArrayOfComplexVector &dF, const Numeric &F0, const Numeric &T, const Complex &S_LM, const Numeric &isotopic_ratio, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Complex &dS_LM_dT=0.0) const
Index nelem() const
Returns the number of elements.
void apply_linemixing(ComplexVector &F, ArrayOfComplexVector &dF, const Numeric &Y, const Numeric &G, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dY_dT=0.0, const Numeric &dG_dT=0.0) const
std::complex< Numeric > Complex
invlib::LevenbergMarquardt< Numeric, CovarianceMatrix, Std > LM
Levenberg-Marquardt (LM) optimization using normed ARTS QR solver.
void set_doppler(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &GD_div_F0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dGD_div_F0_dT=0.0) const
Eigen::Map< ComplexMatrixType, 0, ComplexStrideType > ComplexMatrixViewMap
void apply_dipole(ComplexVector &F, ArrayOfComplexVector &dF, const Numeric &F0, const Numeric &T, const Numeric &d0, const Numeric &rho, const Numeric &isotopic_ratio, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &drho_dT=0.0) const
NUMERIC Numeric
The type to use for all floating point numbers.
Declarations required for the calculation of absorption coefficients.
void set_lorentz(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &G0, const Numeric &L0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dG0_dT=0.0, const Numeric &dL0_dT=0.0) const
Computes partial derivatives (old method)
void set_faddeeva_from_full_linemixing(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Complex &eigenvalue_no_shift, const Numeric &GD_div_F0, const Numeric &L0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dGD_div_F0_dT=0.0, const Complex &deigenvalue_dT=0.0, const Numeric &dL0_dT=0.0) const
This can be used to make arrays out of anything.
void set_o2_non_resonant(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &F0, const Numeric &G0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dG0_dT=0.0)
const Numeric PI
Global constant, pi.
void apply_rosenkranz_quadratic(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &F0, const Numeric &T, const PropmatPartialsData &derivatives_data=PropmatPartialsData()) const
LineRecord class for managing line catalog data.
void set_faddeeva_algorithm916(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &GD_div_F0, const Numeric &G0, const Numeric &L0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dGD_div_F0_dT=0.0, const Numeric &dG0_dT=0.0, const Numeric &dL0_dT=0.0) const
void set_htp(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &GD_div_F0, const Numeric &G0, const Numeric &L0, const Numeric &L2, const Numeric &G2, const Numeric &eta, const Numeric &FVC, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dGD_div_F0_dT=0.0, const Numeric &dG0_dT=0.0, const Numeric &dL0_dT=0.0, const Numeric &dG2_dT=0.0, const Numeric &dL2_dT=0.0, const Numeric &deta_dT=0.0, const Numeric &dFVC_dT=0.0) const
ComplexConstMatrixViewMap MapToEigen(const ConstComplexMatrixView &A)
void apply_VVW(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &F0, const PropmatPartialsData &derivatives_data=PropmatPartialsData()) const
void set_mirrored_lorentz(ComplexVector &F, ArrayOfComplexVector &dF, const Vector &f_grid, const Numeric &zeeman_df, const Numeric &magnetic_magnitude, const Numeric &F0_noshift, const Numeric &G0, const Numeric &L0, const PropmatPartialsData &derivatives_data=PropmatPartialsData(), const Numeric &dG0_dT=0.0, const Numeric &dL0_dT=0.0) const
Numeric sqrt(const Rational r)
Square root.