64 const Index& atmosphere_dim,
65 const bool& jacobian_do) {
66 if (not jacobian_do)
return;
74 for (
Index i = 0; i < nq; i++) {
75 if (jacobian_quantities[i] == Jacobian::Type::Sensor or jacobian_quantities[i] == Jacobian::Special::SurfaceString)
continue;
77 if (jacobian_quantities[i].is_wind()) {
78 const auto scale =
get_stepwise_f_partials(ppath_line_of_sight, ppath_f_grid, jacobian_quantities[i].Target().atm, atmosphere_dim);
80 if (not lte) dS_dx[i] *= scale;
86 if (atmosphere_dim == 1) {
89 }
else if (los[0] > 180) {
90 los[0] = 360 - los[0];
92 }
else if (atmosphere_dim == 2) {
94 los[0] = los[0] + 360;
95 }
else if (los[0] > 180) {
96 los[0] = los[0] - 360;
100 if (
abs(los[0] - 90) > 90 ||
abs(los[1]) > 180) {
122 if (iy_unit ==
"1") {
128 else if (iy_unit ==
"RJBT") {
129 for (
Index iv = 0; iv < nf; iv++) {
131 for (
Index is = 0; is < ns; is++) {
137 iy(iv, is) *= 2 * scfac;
143 else if (iy_unit ==
"PlanckBT") {
144 for (
Index iv = 0; iv < nf; iv++) {
145 for (
Index is = ns - 1; is >= 0; is--)
147 if (i_pol[is] == 1) {
148 iy(iv, is) =
invplanck(iy(iv, is), f_grid[iv]);
149 }
else if (i_pol[is] < 5) {
151 iy(iv, is) =
invplanck(0.5 * (iy(iv, 0) + iy(iv, is)), f_grid[iv]) -
152 invplanck(0.5 * (iy(iv, 0) - iy(iv, is)), f_grid[iv]);
154 iy(iv, is) =
invplanck(2 * iy(iv, is), f_grid[iv]);
160 else if (iy_unit ==
"W/(m^2 m sr)") {
161 for (
Index iv = 0; iv < nf; iv++) {
163 for (
Index is = 0; is < ns; is++) {
169 else if (iy_unit ==
"W/(m^2 m-1 sr)") {
175 "Unknown option: iy_unit = \"", iy_unit,
"\"\n"
176 "Recognised choices are: \"1\", \"RJBT\", \"PlanckBT\""
177 "\"W/(m^2 m sr)\" and \"W/(m^2 m-1 sr)\"")
199 if (iy_unit ==
"1") {
205 else if (iy_unit ==
"RJBT") {
206 for (
Index iv = 0; iv < nf; iv++) {
208 for (
Index is = 0; is < ns; is++) {
211 for (
Index ip = 0; ip < np; ip++) {
212 J(ip, iv, is) *= scfac;
216 for (
Index ip = 0; ip < np; ip++) {
217 J(ip, iv, is) *= 2 * scfac;
224 else if (iy_unit ==
"PlanckBT") {
225 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) {
226 for (
Index is = ns - 1; is >= 0; is--) {
228 if (i_pol[is] == 1) {
230 }
else if (i_pol[is] < 5) {
232 scfac =
dinvplanckdI(0.5 * (iy(iv, 0) + iy(iv, is)), f_grid[iv]) +
233 dinvplanckdI(0.5 * (iy(iv, 0) - iy(iv, is)), f_grid[iv]);
238 for (
Index ip = 0; ip < np; ip++) {
239 J(ip, iv, is) *= scfac;
245 else if (iy_unit ==
"W/(m^2 m sr)") {
246 for (
Index iv = 0; iv < nf; iv++) {
248 for (
Index ip = 0; ip < np; ip++) {
249 for (
Index is = 0; is < ns; is++) {
250 J(ip, iv, is) *= scfac;
256 else if (iy_unit ==
"W/(m^2 m-1 sr)") {
262 "Unknown option: iy_unit = \"", iy_unit,
"\"\n"
263 "Recognised choices are: \"1\", \"RJBT\", \"PlanckBT\""
264 "\"W/(m^2 m sr)\" and \"W/(m^2 m-1 sr)\"")
319 const Agenda& ppath_step_agenda,
321 const Numeric& ppath_lraytrace,
322 const Index& atmosphere_dim,
333 bool invert_lat =
false;
334 if (atmosphere_dim == 1 && (rte_los[0] < 0 || rte_los[0] > 180)) {
370 for (
Index i = 1; i <= ilast; i++) {
372 lox[i - 1] + ppx.
lstep[i - 1] * (ppx.
nreal[i - 1] + ppx.
nreal[i]) / 2.0;
378 if (lox[ilast] < lo0) {
379 const Numeric dl = lo0 - lox[ilast];
380 if (atmosphere_dim < 3) {
383 x, z, dx, dz, ppx.
r[ilast], ppx.
pos(ilast, 1), ppx.
los(ilast, 0));
423 pos[0] =
interp(itw, ppx.
r, gp);
425 if (atmosphere_dim == 3) {
437 const Agenda& ppath_step_agenda,
438 const Index& atmosphere_dim,
448 const Numeric& ppath_lraytrace,
454 for (
Index i = 0; i <= ppath.
np - 2; i++) {
455 lp += ppath.
lstep[i];
463 rte_los0 = rte_los[
Range(0,
max(
Index(1), atmosphere_dim - 1))];
520 if (backg1 == backg2) {
522 if (atmosphere_dim < 3) {
523 distance2D(l12, pos1[0], pos1[1], pos2[0], pos2[1]);
525 distance3D(l12, pos1[0], pos1[1], pos1[2], pos2[0], pos2[1], pos2[2]);
533 if (atmosphere_dim == 1) {
534 const Numeric r = refellipsoid[0];
536 }
else if (atmosphere_dim == 2) {
556 const Agenda& ppath_step_agenda,
557 const Index& atmosphere_dim,
567 const Numeric& ppath_lraytrace,
571 "The function *defocusing_sat2sat* can only be used "
572 "for limb sounding geometry.");
581 for (
Index i = it; i <= ppath.
np - 2; i++) {
582 lt += ppath.
lstep[i];
584 for (
Index i = 0; i < it; i++) {
585 lr += ppath.
lstep[i];
595 const Numeric lf = lr * lt / (lr + lt);
596 const Numeric alt = 1 / (1 - alpha0 * lf / refellipsoid[0]);
629 rte_los[0] += 2 * dza;
658 dada = (alpha2 - alpha1) / (
a2 -
a1);
660 dada = (alpha2 - alpha0) / (
a2 - a0);
664 const Numeric zlt = 1 / (1 - dada * lf);
674 const Index& atmosphere_dim) {
688 return f * (cos(za_f) * cos(za_p) + sin(za_f) * sin(za_p) * cos(aa_f - aa_p));
693 const Index& cloudbox_on,
700 const Agenda& iy_main_agenda) {
705 Tensor3 iy_transmittance(0, 0, 0);
706 const Index iy_agenda_call1 = 1;
708 const Index iy_id = 0;
709 const Index jacobian_do = 0;
737 const Index& jacobian_do,
741 const Index& atmosphere_dim,
743 const Index& cloudbox_on,
744 const Index& stokes_dim,
748 const Agenda& iy_main_agenda,
749 const Agenda& iy_space_agenda,
750 const Agenda& iy_surface_agenda,
751 const Agenda& iy_cloudbox_agenda,
752 const Index& iy_agenda_call1,
767 rtp_pos.
resize(atmosphere_dim);
768 rtp_pos = ppath.
pos(np - 1,
Range(0, atmosphere_dim));
772 out3 <<
"Radiative background: " << ppath.
background <<
"\n";
781 agenda_name =
"iy_space_agenda";
788 agenda_name =
"iy_surface_agenda";
796 if (jacobian_do && iy_agenda_call1) {
797 for (
Index i = 0; i < jacobian_quantities.
nelem(); i++) {
798 if (jacobian_quantities[i] == Jacobian::Special::SurfaceString) {
799 dsurface_names.push_back(jacobian_quantities[i].Subtag());
810 dsurface_emission_dx,
829 agenda_name =
"iy_cloudbox_agenda";
832 ws, iy, f_grid, rtp_pos, rtp_los, iy_cloudbox_agenda);
841 "The size of *iy* returned from *", agenda_name,
"* is\n"
843 " expected size = [", nf,
",", stokes_dim,
"]\n"
844 " size of iy = [", iy.
nrows(),
",", iy.
ncols(),
"]\n")
854 const Index& atmosphere_dim,
870 itw2p(ppath_p, p_grid, ppath.
gp_p, itw_p);
888 for (
Index is = 0; is < ns; is++) {
905 if (wind_u_field.
npages() > 0) {
914 if (wind_v_field.
npages() > 0) {
923 if (wind_w_field.
npages() > 0) {
937 if (mag_u_field.
npages() > 0) {
946 if (mag_v_field.
npages() > 0) {
955 if (mag_w_field.
npages() > 0) {
970 const Index& atmosphere_dim,
979 ppath_dpnd_dx.resize(dpnd_field_dx.
nelem());
981 bool any_dpnd =
false;
982 for (
Index iq = 0; iq < dpnd_field_dx.
nelem(); iq++) {
983 if (dpnd_field_dx[iq].empty()) {
984 ppath_dpnd_dx[iq].resize(0, 0);
987 ppath_dpnd_dx[iq].resize(pnd_field.
nbooks(), np);
993 clear2cloudy.resize(np);
997 for (
Index ip = 0; ip < np; ip++)
1003 if (atmosphere_dim >= 2) {
1006 if (atmosphere_dim == 3) {
1034 bool any_ppath_dpnd =
false;
1036 for (
Index iq = 0; iq < dpnd_field_dx.
nelem();
1039 if (!dpnd_field_dx[iq].empty()) {
1051 if (
max(ppath_dpnd_dx[iq](
joker, ip)) > 0. ||
1052 min(ppath_dpnd_dx[iq](
joker, ip)) < 0.)
1053 any_ppath_dpnd =
true;
1059 clear2cloudy[ip] = nin;
1062 clear2cloudy[ip] = -1;
1065 clear2cloudy[ip] = -1;
1073 const Index& atmosphere_dim,
1074 const Numeric& rte_alonglos_v,
1084 for (
Index ip = 0; ip < np; ip++) {
1086 Numeric v_doppler = rte_alonglos_v;
1089 if (ppath_wind(1, ip) != 0 || ppath_wind(0, ip) != 0 ||
1090 ppath_wind(2, ip) != 0) {
1101 if (v_doppler == 0) {
1102 ppath_f(
joker, ip) = f_grid;
1107 for (
Index iv = 0; iv < nf; iv++) {
1108 ppath_f(iv, ip) =
a * f_grid[iv];
1115 const Index& mblock_index) {
1117 return Range(n1y * mblock_index, n1y);
1123 const Numeric& ppath_temperature,
1124 const bool& do_temperature_derivative) {
1127 for (
Index i = 0; i < nf; i++)
1128 B[i] =
planck(ppath_f_grid[i], ppath_temperature);
1130 if (do_temperature_derivative)
1131 for (
Index i = 0; i < nf; i++)
1132 dB_dT[i] =
dplanck_dt(ppath_f_grid[i], ppath_temperature);
1142 const Agenda& propmat_clearsky_agenda,
1149 const Numeric& ppath_temperature,
1150 const Numeric& ppath_pressure,
1151 const bool& jacobian_do) {
1161 ppath_magnetic_field,
1162 ppath_line_of_sight,
1167 propmat_clearsky_agenda);
1175 const Jacobian::Atm wind_type,
1176 const Index& atmosphere_dim) {
1182 switch (wind_type) {
1183 case Jacobian::Atm::WindMagnitude:
1184 dv_doppler_dx = 1.0;
1186 case Jacobian::Atm::WindU:
1190 case Jacobian::Atm::WindV:
1194 case Jacobian::Atm::WindW:
1199 ARTS_ASSERT(
false,
"Not allowed to call this function without a wind parameter as wind_type");
1216 const Index ppath_1p_id,
1220 const Index& atmosphere_dim,
1221 const bool& jacobian_do) {
1232 mirror_los(dir, ppath_line_of_sight, atmosphere_dim);
1233 Matrix dir_array(1, 2, 0.);
1234 dir_array(0,
joker) = dir;
1279 for (
Index iv = 0; iv < nf; iv++) {
1291 if (ppath_dpnd_dx[iq].empty()) {
1292 dap_dx[iq].SetZero();
1293 dKp_dx[iq].SetZero();
1303 ppath_dpnd_dx[iq](
joker,
Range(ppath_1p_id, 1)),
1311 for (
Index iv = 0; iv < nf; iv++) {
1313 dap_dx[iq].SetAtPosition(abs_vec_bulk(iv, 0, 0,
joker), iv);
1314 dKp_dx[iq].SetAtPosition(ext_mat_bulk(iv, 0, 0,
joker,
joker),
1317 dap_dx[iq].SetAtPosition(abs_vec_bulk(0, 0, 0,
joker), iv);
1318 dKp_dx[iq].SetAtPosition(ext_mat_bulk(0, 0, 0,
joker,
joker), iv);
1331 const Index ppath_1p_id,
1337 const GridPos& ppath_pressure,
1338 const Vector& temperature,
1339 const Index& atmosphere_dim,
1340 const bool& jacobian_do,
1341 const Index& t_interp_order) {
1343 "This function handles so far only 1D atmospheres.");
1351 const Index nq = jacobian_do ? jacobian_quantities.
nelem() : 0;
1359 Tensor3 inc_field(nf, nza, stokes_dim, 0.);
1360 for (
Index iv = 0; iv < nf; iv++) {
1361 for (
Index iza = 0; iza < nza; iza++) {
1362 for (
Index i = 0; i < stokes_dim; i++) {
1363 inc_field(iv, iza, i) =
1364 interp(itw_p, cloudbox_field(iv,
joker, 0, 0, iza, 0, i), gp_p);
1371 Matrix idir(nza * naa, 2);
1373 for (
Index iza = 0; iza < nza; iza++) {
1374 for (
Index iaa = 0; iaa < naa; iaa++) {
1375 idir(ia, 0) = za_grid[iza];
1376 idir(ia, 1) = aa_grid[iaa];
1387 pdir(0, 0) = ppath_line_of_sight(0, 0);
1392 Index nf_ssd = scat_data[0][0].pha_mat_data.nlibraries();
1393 Index duplicate_freqs = ((nf == nf_ssd) ? 0 : 1);
1394 Tensor6 pha_mat_1se(nf_ssd, 1, 1, nza * naa, stokes_dim, stokes_dim);
1397 Tensor3 scat_source_1se(ne, nf, stokes_dim, 0.);
1400 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++) {
1401 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++) {
1405 if (ppath_1p_pnd[ise_flat] != 0) {
1407 }
else if (jacobian_do) {
1408 for (
Index iq = 0; (!val_pnd) && (iq < nq); iq++) {
1409 if ((not(jacobian_quantities[iq] == Jacobian::Type::Sensor) and not(jacobian_quantities[iq] == Jacobian::Special::SurfaceString)) &&
1410 !ppath_dpnd_dx[iq].empty() &&
1411 ppath_dpnd_dx[iq](ise_flat, ppath_1p_id) != 0) {
1421 scat_data[i_ss][i_se],
1428 "Interpolation error for (flat-array) scattering "
1429 "element #", ise_flat,
"\n"
1430 "at location/temperature point #", ppath_1p_id,
"\n")
1433 for (
Index iv = 0; iv < nf; iv++) {
1434 if (!duplicate_freqs) {
1437 Tensor3 product_fields(nza, naa, stokes_dim, 0.);
1440 for (
Index iza = 0; iza < nza; iza++) {
1441 for (
Index iaa = 0; iaa < naa; iaa++) {
1442 for (
Index i = 0; i < stokes_dim; i++) {
1443 for (
Index j = 0; j < stokes_dim; j++) {
1444 product_fields(iza, iaa, i) +=
1445 pha_mat_1se(this_iv, 0, 0, ia, i, j) *
1446 inc_field(iv, iza, j);
1453 for (
Index i = 0; i < stokes_dim; i++) {
1455 product_fields(
joker,
joker, i), za_grid, aa_grid);
1465 for (
Index iv = 0; iv < nf; iv++) {
1466 Vector scat_source(stokes_dim, 0.);
1467 for (ise_flat = 0; ise_flat < ne; ise_flat++) {
1468 for (
Index i = 0; i < stokes_dim; i++) {
1470 scat_source_1se(ise_flat, iv, i) * ppath_1p_pnd[ise_flat];
1478 if (ppath_dpnd_dx[iq].empty()) { dSp_dx[iq].SetZero(); }
else {
1480 for (ise_flat = 0; ise_flat < ne; ise_flat++) {
1481 for (
Index i = 0; i < stokes_dim; i++) {
1482 scat_source[i] += scat_source_1se(ise_flat, iv, i) *
1483 ppath_dpnd_dx[iq](ise_flat, ppath_1p_id);
1484 dSp_dx[iq].SetAtPosition(scat_source, iv);
1500 const Index& mblock_index,
1501 const Index& atmosphere_dim,
1503 const Index& cloudbox_on,
1504 const Index& stokes_dim,
1510 const Agenda& iy_main_agenda,
1511 const Index& j_analytical_do,
1525 los = sensor_los(mblock_index,
joker);
1526 if (mblock_dlos.
ncols() == 1) {
1527 los[0] += mblock_dlos(ilos, 0);
1534 mblock_dlos(ilos, 0),
1535 mblock_dlos(ilos, 1));
1540 Vector rtp_pos, rtp_pos2(0);
1542 rtp_pos = sensor_pos(mblock_index,
joker);
1543 if (!transmitter_pos.
empty()) {
1544 rtp_pos2 = transmitter_pos(mblock_index,
joker);
1551 Tensor3 iy_transmittance(0, 0, 0);
1552 const Index iy_agenda_call1 = 1;
1554 (
Index)1e6 * (mblock_index + 1) + (
Index)1e3 * (ilos + 1);
1578 const Index row0 = ilos * nf * stokes_dim;
1582 if (j_analytical_do) {
1585 ip < jacobian_indices[iq][1] - jacobian_indices[iq][0] + 1;
1587 for (
Index is = 0; is < stokes_dim; is++) {
1588 diyb_dx[iq](
Range(row0 + is, nf, stokes_dim), ip) =
1589 diy_dx[iq](ip,
joker, is);
1595 for (
Index is = 0; is < stokes_dim; is++) {
1596 iyb[
Range(row0 + is, nf, stokes_dim)] = iy(
joker, is);
1601 catch (
const std::exception& e) {
1602#pragma omp critical(iyb_calc_fail)
1604 fail_msg = e.what();
1615 const Index& mblock_index,
1616 const Index& atmosphere_dim,
1618 const Index& cloudbox_on,
1619 const Index& stokes_dim,
1626 const Agenda& iy_main_agenda,
1627 const Index& j_analytical_do,
1637 const Index niyb = nf * nlos * stokes_dim;
1642 if (j_analytical_do) {
1643 diyb_dx.resize(jacobian_indices.
nelem());
1645 niyb, jacobian_indices[iq][1] - jacobian_indices[iq][0] + 1);)
1650 geo_pos_matrix.
resize(nlos, 5);
1651 geo_pos_matrix = NAN;
1658 bool failed =
false;
1660 out3 <<
" Parallelizing los loop (" << nlos <<
" iterations, " << nf
1661 <<
" frequencies)\n";
1666#pragma omp parallel for if (!arts_omp_in_parallel()) firstprivate(wss)
1667 for (
Index ilos = 0; ilos < nlos; ilos++) {
1669 if (failed)
continue;
1693 jacobian_quantities,
1700 if (geo_pos.
nelem()) geo_pos_matrix(ilos,
joker) = geo_pos;
1703 if (failed)
continue;
1706 out3 <<
" Not parallelizing los loop (" << nlos <<
" iterations, " << nf
1707 <<
" frequencies)\n";
1709 for (
Index ilos = 0; ilos < nlos; ilos++) {
1711 if (failed)
continue;
1735 jacobian_quantities,
1742 if (geo_pos.
nelem()) geo_pos_matrix(ilos,
joker) = geo_pos;
1745 if (failed)
continue;
1750 "Run-time error in function: iyb_calc\n", fail_msg);
1757 for (
Index q = 0; q < nq; q++) {
1758 iyb_aux[q].resize(niyb);
1760 for (
Index ilos = 0; ilos < nlos; ilos++) {
1761 const Index row0 = ilos * nf * stokes_dim;
1762 for (
Index iv = 0; iv < nf; iv++) {
1763 const Index row1 = row0 + iv * stokes_dim;
1764 const Index i1 =
min(iv, iy_aux_array[ilos][q].nrows() - 1);
1765 for (
Index is = 0; is < stokes_dim; is++) {
1766 Index i2 =
min(is, iy_aux_array[ilos][q].ncols() - 1);
1767 iyb_aux[q][row1 + is] = iy_aux_array[ilos][q](i1, i2);
1785 iy_trans_total.
resize(nf, ns, ns);
1787 for (
Index iv = 0; iv < nf; iv++) {
1806 for (
Index iv = 0; iv < nf; iv++) {
1813 const Index& atmosphere_dim) {
1816 if (atmosphere_dim == 1) {
1817 los_mirrored[0] = 180 - los[0];
1818 los_mirrored[1] = 180;
1819 }
else if (atmosphere_dim == 2) {
1820 los_mirrored[0] = 180 - fabs(los[0]);
1822 los_mirrored[1] = 180;
1824 los_mirrored[1] = 0;
1826 }
else if (atmosphere_dim == 3) {
1827 los_mirrored[0] = 180 - los[0];
1828 los_mirrored[1] = los[1] + 180;
1829 if (los_mirrored[1] > 180) {
1830 los_mirrored[1] -= 360;
1836 const Index& stokes_dim,
1848 if (stokes_dim > 2) {
1856 if (stokes_dim > 3) {
1865 const Index& stokes_dim) {
1869 Cs.
resize(stokes_dim, stokes_dim);
1871 if (stokes_dim > 1 ) {
1872 Cs(0,1) = Cs(1,0) = 1;
1874 if (stokes_dim > 2 ) {
1875 Cs(0,2) = Cs(1,2) = Cs(2,0) = Cs(2,1) = 0;
1877 if (stokes_dim > 3 ) {
1878 Cs(0,3) = Cs(1,3) = Cs(2,3) = Cs(3,0) = Cs(3,1) = Cs(3,2) = 0;
1886 const Index& stokes_dim,
1891 L.
resize(stokes_dim, stokes_dim);
1893 if (stokes_dim > 1 ) {
1895 const Numeric c2 = cos(alpha);
1896 L(0,1) = L(1,0) = 0;
1898 if (stokes_dim > 2 ) {
1899 const Numeric s2 = sin(alpha);
1900 L(0,2) = L(2,0) = 0;
1904 if (stokes_dim > 3 ) {
1905 L(0,3) = L(1,3) = L(2,3) = L(3,0) = L(3,1) = L(3,2) = 0;
1913 const Index& stokes_dim) {
1917 Cm.
resize(stokes_dim, stokes_dim);
1919 if (stokes_dim > 1 ) {
1920 Cm(0,1) = Cm(1,0) = 0.5;
1922 if (stokes_dim > 2 ) {
1923 Cm(0,2) = Cm(1,2) = Cm(2,0) = Cm(2,1) = 0;
1925 if (stokes_dim > 3 ) {
1926 Cm(0,3) = Cm(1,3) = Cm(2,3) = Cm(3,0) = Cm(3,1) = Cm(3,2) = 0;
1935 const Index& atmosphere_dim,
1942 if (atmosphere_dim == 1) {
1950 else if (atmosphere_dim == 2) {
1955 gridpos(gp, lat_grid, pos[1]);
1957 lat =
interp(itw, lat_true, gp);
1958 lon =
interp(itw, lon_true, gp);
1974 const Index& atmosphere_dim,
1979 const Index& iy_agenda_call1,
1980 const Tensor3& iy_transmittance,
1981 const Agenda& water_p_eq_agenda,
1985 if (!iy_agenda_call1) {
1989 Y.resize(ns, diy_dpath[iq].npages());
1990 for (
Index iv = 0; iv < nf; iv++) {
2002 for (
Index iq = 0; iq < jacobian_quantities.
nelem(); iq++) {
2006 if (not(jacobian_quantities[iq] == Jacobian::Type::Sensor) and
2007 not(jacobian_quantities[iq] == Jacobian::Special::SurfaceString) and
2008 jac_species_i[iq] >= 0) {
2009 if (jacobian_quantities[iq].Mode() ==
"vmr") {
2012 else if (jacobian_quantities[iq].Mode() ==
"rel") {
2014 for (
Index ip = 0; ip < np; ip++) {
2015 diy_dpath[iq](ip,
joker,
joker) *= ppvar_vmr(jac_species_i[iq], ip);
2019 else if (jacobian_quantities[iq].Mode() ==
"nd") {
2021 for (
Index ip = 0; ip < np; ip++) {
2027 else if (jacobian_quantities[iq].Mode() ==
"rh") {
2030 t_data(
joker, 0, 0) = ppvar_t;
2032 for (
Index ip = 0; ip < np; ip++) {
2033 diy_dpath[iq](ip,
joker,
joker) *= water_p_eq(ip, 0, 0) / ppvar_p[ip];
2037 else if (jacobian_quantities[iq].Mode() ==
"q") {
2049 for (
Index iq = 0; iq < jacobian_quantities.
nelem(); iq++) {
2056 if (jacobian_quantities[iq] == Jacobian::Atm::Temperature) {
2058 for (
Index ia = 0; ia < jacobian_quantities.
nelem(); ia++) {
2059 if (jac_species_i[ia] >= 0) {
2060 if (jacobian_quantities[ia].Mode() ==
"nd") {
2061 for (
Index ip = 0; ip < np; ip++) {
2063 ddterm *= ppvar_vmr(jac_species_i[ia], ip) *
2068 }
else if (jacobian_quantities[ia].Mode() ==
"rh") {
2070 t_data(
joker, 0, 0) = ppvar_t;
2072 if (water_p_eq.
npages() == 0) {
2074 ws, water_p_eq, t_data, water_p_eq_agenda);
2078 t_data(
joker, 0, 0) += 1;
2080 ws, water_p_eq1K, t_data, water_p_eq_agenda);
2082 for (
Index ip = 0; ip < np; ip++) {
2083 const Numeric p_eq = water_p_eq(ip, 0, 0);
2084 const Numeric p_eq1K = water_p_eq1K(ip, 0, 0);
2086 ddterm *= ppvar_vmr(jac_species_i[ia], ip) *
2087 (ppvar_p[ip] /
pow(p_eq, 2.0)) * (p_eq1K - p_eq);
2098 jacobian_quantities[iq],
2114 const Index& j_analytical_do,
2121 n = ppath.
nreal[np - 1];
2126 for (
Index is = 0; is < ns; is++) {
2132 if (j_analytical_do) {
2141 for (
Index ip = 0; ip < ppath.
np; ip++) {
2158 const Index& atmosphere_dim,
2160 const Index& cloudbox_on,
2161 const Index& stokes_dim,
2163 const Matrix& sensor_pos,
2164 const Matrix& sensor_los,
2165 const Matrix& transmitter_pos,
2166 const Matrix& mblock_dlos,
2167 const Sparse& sensor_response,
2168 const Vector& sensor_response_f,
2170 const Matrix& sensor_response_dlos,
2172 const Agenda& iy_main_agenda,
2173 const Agenda& jacobian_agenda,
2174 const Index& jacobian_do,
2179 const Index& mblock_index,
2181 const Index& j_analytical_do) {
2185 Vector iyb, iyb_error, yb(n1y);
2191 iyb_aux_array[mblock_index],
2207 jacobian_quantities,
2217 mult(yb, sensor_response, iyb);
2223 for (
Index i = 0; i < n1y; i++) {
2224 const Index ii = row0 + i;
2226 "One or several NaNs found in *y*.");
2227 y_f[ii] = sensor_response_f[i];
2228 y_pol[ii] = sensor_response_pol[i];
2229 y_pos(ii,
joker) = sensor_pos(mblock_index,
joker);
2230 y_los(ii,
joker) = sensor_los(mblock_index,
joker);
2231 y_los(ii, 0) += sensor_response_dlos(i, 0);
2232 if (sensor_response_dlos.
ncols() > 1) {
2233 y_los(ii, 1) += sensor_response_dlos(i, 1);
2240 if (j_analytical_do) {
2242 mult(jacobian(rowind,
2243 Range(jacobian_indices[iq][0],
2244 jacobian_indices[iq][1] -
2245 jacobian_indices[iq][0] + 1)),
2254 ws, jacobian, mblock_index, iyb, yb, jacobian_agenda);
2258 if (!std::isnan(geo_pos_matrix(0, 0)))
2261 const Index nfs = f_grid.
nelem() * stokes_dim;
2262 for (
Index i = 0; i < n1y; i++) {
2265 for (
Index j = 0; j < sensor_response.
ncols(); j++) {
2266 if (sensor_response(i, j) > rmax) {
2267 rmax = sensor_response(i, j);
2271 const auto jhit =
Index(floor(jmax / nfs));
2272 y_geo(row0 + i,
joker) = geo_pos_matrix(jhit,
joker);
2277 catch (
const std::exception& e) {
2278#pragma omp critical(yCalc_fail)
2280 fail_msg = e.what();
2303 for (
Index iv = 0; iv < nf; iv++) {
2309 Complex n(complex_n(iv, 0), complex_n(iv, 1));
2319 fac[iv] =
a * la * la * la * la / K2;
Array< Index > ArrayOfIndex
An array of Index.
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
Constants of physical expressions as constexpr.
Simple constexpr math that we can make use of in Arts.
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
void iy_cloudbox_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void iy_surface_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const ArrayOfTensor4 &dsurface_rmatrix_dx, const ArrayOfMatrix &dsurface_emission_dx, const String &iy_unit, const Tensor3 &iy_transmittance, const Index iy_id, const Index cloudbox_on, const Index jacobian_do, const Agenda &iy_main_agenda, const Vector &f_grid, const EnergyLevelMap &nlte_field, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const Tensor3 &surface_props_data, const ArrayOfString &dsurface_names, const Agenda &input_agenda)
void iy_space_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void iy_main_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, Vector &geo_pos, const Index iy_agenda_call1, const Tensor3 &iy_transmittance, const ArrayOfString &iy_aux_vars, const Index iy_id, const String &iy_unit, const Index cloudbox_on, const Index jacobian_do, const Vector &f_grid, const EnergyLevelMap &nlte_field, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
void jacobian_agendaExecute(Workspace &ws, Matrix &jacobian, const Index mblock_index, const Vector &iyb, const Vector &yb, const Agenda &input_agenda)
void propmat_clearsky_agendaExecute(Workspace &ws, PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfSpeciesTag &select_abs_species, const Vector &f_grid, const Vector &rtp_mag, const Vector &rtp_los, const Numeric rtp_pressure, const Numeric rtp_temperature, const EnergyLevelMap &rtp_nlte, const Vector &rtp_vmr, const Agenda &input_agenda)
void water_p_eq_agendaExecute(Workspace &ws, Tensor3 &water_p_eq_field, const Tensor3 &t_field, const Agenda &input_agenda)
This can be used to make arrays out of anything.
Index nelem() const ARTS_NOEXCEPT
A constant view of a Matrix.
bool empty() const noexcept
Index nrows() const noexcept
Index ncols() const noexcept
A constant view of a Tensor3.
Index npages() const
Returns the number of pages.
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor4.
Index nbooks() const noexcept
A constant view of a Tensor7.
A constant view of a Vector.
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
Index NumberOfFrequencies() const
The number of frequencies of the propagation matrix.
Index StokesDimensions() const
The stokes dimension of the propagation matrix.
void SetAtPosition(const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
Set the At Position object.
constexpr Index get_start() const noexcept
Returns the start index of the range.
Stokes vector is as Propagation matrix but only has 4 possible values.
void SetAtPosition(const ConstVectorView &x, const Index iv=0, const Index iz=0, const Index ia=0)
void resize(Index p, Index r, Index c)
Resize function.
void resize(Index n)
Resize function.
bool is_gp_inside_cloudbox(const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, const ArrayOfIndex &cloudbox_limits, const bool &include_boundaries, const Index &atmosphere_dim)
void mult(MatrixView C, ConstMatrixView A, const Block &B)
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR(...)
#define ARTS_USER_ERROR_IF(condition,...)
void distance3D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &r2, const Numeric &lat2, const Numeric &lon2)
distance3D
void distance2D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &r2, const Numeric &lat2)
distance2D
void cart2sph(Numeric &r, Numeric &lat, Numeric &lon, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &lat0, const Numeric &lon0, const Numeric &za0, const Numeric &aa0)
cart2sph
Numeric refell2r(ConstVectorView refellipsoid, const Numeric &lat)
refell2r
Numeric sphdist(const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
sphdist
void poslos2cart(Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za)
poslos2cart
void cart2pol(Numeric &r, Numeric &lat, const Numeric &x, const Numeric &z, const Numeric &lat0, const Numeric &za0)
cart2pol
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
void diy_from_path_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstTensor3View diy_dpath, const Index &atmosphere_dim, const Ppath &ppath, ConstVectorView ppath_p)
Maps jacobian data for points along the propagation path, to jacobian retrieval grid data.
#define FOR_ANALYTICAL_JACOBIANS_DO2(what_to_do)
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Linear algebra functions.
Header file for logic.cc.
Numeric fac(const Index n)
fac
Numeric AngIntegrate_trapezoid(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
AngIntegrate_trapezoid.
void abs(Sparse &A, const Sparse &B)
Absolute value of sparse matrix elements.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
std::complex< Numeric > Complex
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr Numeric speed_of_light
Speed of light [m/s] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date: 201...
constexpr Numeric c
Speed of light convenience name [m/s].
constexpr Numeric temperature_at_0c
Global constant, Temperature in Celsius of 0 Kelvin.
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.
auto sind(auto x) noexcept
Returns the sine of the deg2rad of the input.
auto cosd(auto x) noexcept
Returns the cosine of the deg2rad of the input.
constexpr auto pow4(auto x) noexcept
power of four
void opt_prop_ScatSpecBulk(ArrayOfTensor5 &ext_mat, ArrayOfTensor4 &abs_vec, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor5 &ext_mat_se, const ArrayOfArrayOfTensor4 &abs_vec_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk extinction and absorption.
void pha_mat_1ScatElem(Tensor6View pha_mat, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_start, const Index &t_interp_order)
Preparing phase matrix from one scattering element.
void opt_prop_Bulk(Tensor5 &ext_mat, Tensor4 &abs_vec, Index &ptype, const ArrayOfTensor5 &ext_mat_ss, const ArrayOfTensor4 &abs_vec_ss, const ArrayOfIndex &ptypes_ss)
one-line descript
void opt_prop_NScatElems(ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order)
Extinction and absorption from all scattering elements.
Numeric dinvplanckdI(const Numeric &i, const Numeric &f)
dinvplanckdI
Numeric planck(const Numeric &f, const Numeric &t)
planck
Numeric invrayjean(const Numeric &i, const Numeric &f)
invrayjean
Numeric invplanck(const Numeric &i, const Numeric &f)
invplanck
Numeric dplanck_dt(const Numeric &f, const Numeric &t)
dplanck_dt
This file contains declerations of functions of physical character.
constexpr Numeric number_density(Numeric p, Numeric t) noexcept
number_density
void zaaa2cart(Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa)
Converts zenith and azimuth angles to a cartesian unit vector.
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
void add_za_aa(Numeric &za, Numeric &aa, const Numeric &za0, const Numeric &aa0, const Numeric &dza, const Numeric &daa)
Adds up zenith and azimuth angles.
void cart2zaaa(Numeric &za, Numeric &aa, const Numeric &dx, const Numeric &dy, const Numeric &dz)
Converts a cartesian directional vector to zenith and azimuth.
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
void ppath_calc(Workspace &ws, Ppath &ppath, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Vector &rte_pos, const Vector &rte_los, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const bool &ppath_inside_cloudbox_do, const Verbosity &verbosity)
This is the core for the WSM ppathStepByStep.
Propagation path structure and functions.
Numeric pow(const Rational base, Numeric exp)
Power of.
Numeric sqrt(const Rational r)
Square root.
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
void get_stepwise_scattersky_propmat(StokesVector &ap, PropagationMatrix &Kp, ArrayOfStokesVector &dap_dx, ArrayOfPropagationMatrix &dKp_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ConstMatrixView &ppath_1p_pnd, const ArrayOfMatrix &ppath_dpnd_dx, const Index ppath_1p_id, const ArrayOfArrayOfSingleScatteringData &scat_data, const ConstVectorView &ppath_line_of_sight, const ConstVectorView &ppath_temperature, const Index &atmosphere_dim, const bool &jacobian_do)
Computes the contribution by scattering at propagation path point.
void ze_cfac(Vector &fac, const Vector &f_grid, const Numeric &ze_tref, const Numeric &k2)
Calculates factor to convert back-scattering to Ze.
void get_stepwise_clearsky_propmat(Workspace &ws, PropagationMatrix &K, StokesVector &S, Index <e, ArrayOfPropagationMatrix &dK_dx, ArrayOfStokesVector &dS_dx, const Agenda &propmat_clearsky_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const ConstVectorView &ppath_f_grid, const ConstVectorView &ppath_magnetic_field, const ConstVectorView &ppath_line_of_sight, const EnergyLevelMap &ppath_nlte, const ConstVectorView &ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const bool &jacobian_do)
Gets the clearsky propgation matrix and NLTE contributions.
void mueller_stokes2modif(Matrix &Cm, const Index &stokes_dim)
mueller_stokes2modif
void get_iy_of_background(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const ConstTensor3View &iy_transmittance, const Index &iy_id, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const ConstVectorView &rte_pos2, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const ConstVectorView &f_grid, const String &iy_unit, const ConstTensor3View &surface_props_data, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &iy_agenda_call1, const Verbosity &verbosity)
Determines iy of the "background" of a propgation path.
void get_stepwise_scattersky_source(StokesVector &Sp, ArrayOfStokesVector &dSp_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ConstVectorView &ppath_1p_pnd, const ArrayOfMatrix &ppath_dpnd_dx, const Index ppath_1p_id, const ArrayOfArrayOfSingleScatteringData &scat_data, const ConstTensor7View &cloudbox_field, const ConstVectorView &za_grid, const ConstVectorView &aa_grid, const ConstMatrixView &ppath_line_of_sight, const GridPos &ppath_pressure, const Vector &temperature, const Index &atmosphere_dim, const bool &jacobian_do, const Index &t_interp_order)
Calculates the stepwise scattering source terms.
constexpr Numeric SPEED_OF_LIGHT
void get_ppath_atmvars(Vector &ppath_p, Vector &ppath_t, EnergyLevelMap &ppath_nlte, Matrix &ppath_vmr, Matrix &ppath_wind, Matrix &ppath_mag, const Ppath &ppath, const Index &atmosphere_dim, const ConstVectorView &p_grid, const ConstTensor3View &t_field, const EnergyLevelMap &nlte_field, const ConstTensor4View &vmr_field, const ConstTensor3View &wind_u_field, const ConstTensor3View &wind_v_field, const ConstTensor3View &wind_w_field, const ConstTensor3View &mag_u_field, const ConstTensor3View &mag_v_field, const ConstTensor3View &mag_w_field)
Determines pressure, temperature, VMR, winds and magnetic field for each propgataion path point.
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, const ConstVectorView &lat_grid, const ConstVectorView &lat_true, const ConstVectorView &lon_true, const ConstVectorView &pos)
Determines the true alt and lon for an "ARTS position".
Numeric dotprod_with_los(const ConstVectorView &los, const Numeric &u, const Numeric &v, const Numeric &w, const Index &atmosphere_dim)
Calculates the dot product between a field and a LOS.
void apply_iy_unit2(Tensor3View J, const ConstMatrixView &iy, const String &iy_unit, const ConstVectorView &f_grid, const Numeric &n, const ArrayOfIndex &i_pol)
Largely as apply_iy_unit but operates on jacobian data.
void iy_transmittance_mult(Tensor3 &iy_trans_total, const ConstTensor3View &iy_trans_old, const ConstTensor3View &iy_trans_new)
Multiplicates iy_transmittance with transmissions.
void apply_iy_unit(MatrixView iy, const String &iy_unit, const ConstVectorView &f_grid, const Numeric &n, const ArrayOfIndex &i_pol)
Performs conversion from radiance to other units, as well as applies refractive index to fulfill the ...
void adjust_los(VectorView los, const Index &atmosphere_dim)
Ensures that the zenith and azimuth angles of a line-of-sight vector are inside defined ranges.
void mueller_modif2stokes(Matrix &Cs, const Index &stokes_dim)
mueller_modif2stokes
void defocusing_general_sub(Workspace &ws, Vector &pos, Vector &rte_los, Index &background, const ConstVectorView &rte_pos, const Numeric &lo0, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmosphere_dim, const ConstVectorView &p_grid, const ConstVectorView &lat_grid, const ConstVectorView &lon_grid, const ConstTensor3View &z_field, const ConstVectorView &f_grid, const ConstVectorView &refellipsoid, const ConstMatrixView &z_surface, const Verbosity &verbosity)
Just to avoid duplicatuion of code in defocusing_general.
void defocusing_general(Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const ConstVectorView &p_grid, const ConstVectorView &lat_grid, const ConstVectorView &lon_grid, const ConstTensor3View &z_field, const ConstVectorView &f_grid, const ConstVectorView &refellipsoid, const ConstMatrixView &z_surface, const Ppath &ppath, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Numeric &dza, const Verbosity &verbosity)
Defocusing for arbitrary geometry (zenith angle part only)
void defocusing_sat2sat(Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const ConstVectorView &p_grid, const ConstVectorView &lat_grid, const ConstVectorView &lon_grid, const ConstTensor3View &z_field, const ConstVectorView &f_grid, const ConstVectorView &refellipsoid, const ConstMatrixView &z_surface, const Ppath &ppath, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Numeric &dza, const Verbosity &verbosity)
Calculates defocusing for limb measurements between two satellites.
void get_ppath_f(Matrix &ppath_f, const Ppath &ppath, const ConstVectorView &f_grid, const Index &atmosphere_dim, const Numeric &rte_alonglos_v, const ConstMatrixView &ppath_wind)
Determines the Doppler shifted frequencies along the propagation path.
void iyb_calc(Workspace &ws, Vector &iyb, ArrayOfVector &iyb_aux, ArrayOfMatrix &diyb_dx, Matrix &geo_pos_matrix, const Index &mblock_index, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const ConstVectorView &f_grid, const ConstMatrixView &sensor_pos, const ConstMatrixView &sensor_los, const ConstMatrixView &transmitter_pos, const ConstMatrixView &mblock_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity)
Performs calculations for one measurement block, on iy-level.
void get_iy(Workspace &ws, Matrix &iy, const Index &cloudbox_on, const ConstVectorView &f_grid, const EnergyLevelMap &nlte_field, const ConstVectorView &rte_pos, const ConstVectorView &rte_los, const ConstVectorView &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda)
Basic call of iy_main_agenda.
void mueller_rotation(Matrix &L, const Index &stokes_dim, const Numeric &rotangle)
mueller_rotation
void rtmethods_unit_conversion(Matrix &iy, ArrayOfTensor3 &diy_dx, Tensor3 &ppvar_iy, const Index &ns, const Index &np, const Vector &f_grid, const Ppath &ppath, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &j_analytical_do, const String &iy_unit)
This function handles the unit conversion to be done at the end of some radiative transfer WSMs.
void bending_angle1d(Numeric &alpha, const Ppath &ppath)
Calculates the bending angle for a 1D atmosphere.
void iyb_calc_body(bool &failed, String &fail_msg, ArrayOfArrayOfMatrix &iy_aux_array, Workspace &ws, Ppath &ppath, Vector &iyb, ArrayOfMatrix &diyb_dx, Vector &geo_pos, const Index &mblock_index, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const ConstMatrixView &sensor_pos, const ConstMatrixView &sensor_los, const ConstMatrixView &transmitter_pos, const ConstMatrixView &mblock_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ConstVectorView &f_grid, const ArrayOfString &iy_aux_vars, const Index &ilos, const Index &nf)
void rtmethods_jacobian_finalisation(Workspace &ws, ArrayOfTensor3 &diy_dx, ArrayOfTensor3 &diy_dpath, const Index &ns, const Index &nf, const Index &np, const Index &atmosphere_dim, const Ppath &ppath, const Vector &ppvar_p, const Vector &ppvar_t, const Matrix &ppvar_vmr, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Agenda &water_p_eq_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &jac_species_i)
This function fixes the last steps to made on the Jacobian in some radiative transfer WSMs.
void mirror_los(Vector &los_mirrored, const ConstVectorView &los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
void yCalc_mblock_loop_body(bool &failed, String &fail_msg, ArrayOfArrayOfVector &iyb_aux_array, Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, Matrix &y_geo, Matrix &jacobian, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Matrix &mblock_dlos, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Matrix &sensor_response_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity, const Index &mblock_index, const Index &n1y, const Index &j_analytical_do)
Performs calculations for one measurement block, on y-level.
constexpr Numeric TEMP_0_C
void muellersparse_rotation(Sparse &H, const Index &stokes_dim, const Numeric &rotangle)
muellersparse_rotation
Vector get_stepwise_f_partials(const ConstVectorView &line_of_sight, const ConstVectorView &f_grid, const Jacobian::Atm wind_type, const Index &atmosphere_dim)
Computes the ratio that a partial derivative with regards to frequency relates to the wind of come co...
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
void adapt_stepwise_partial_derivatives(ArrayOfPropagationMatrix &dK_dx, ArrayOfStokesVector &dS_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ConstVectorView &ppath_f_grid, const ConstVectorView &ppath_line_of_sight, const Index <e, const Index &atmosphere_dim, const bool &jacobian_do)
Adapts clearsky partial derivatives.
void get_stepwise_blackbody_radiation(VectorView B, VectorView dB_dT, const ConstVectorView &ppath_f_grid, const Numeric &ppath_temperature, const bool &do_temperature_derivative)
Get the blackbody radiation at propagation path point.
void get_ppath_cloudvars(ArrayOfIndex &clear2cloudy, Matrix &ppath_pnd, ArrayOfMatrix &ppath_dpnd_dx, const Ppath &ppath, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx)
Determines the particle fields along a propagation path.
Declaration of functions in rte.cc.
void interp_atmfield_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of an atmospheric field.
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
void interp_cloudfield_gp2itw(VectorView itw, GridPos &gp_p_out, GridPos &gp_lat_out, GridPos &gp_lon_out, const GridPos &gp_p_in, const GridPos &gp_lat_in, const GridPos &gp_lon_in, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits)
Converts atmospheric a grid position to weights for interpolation of a field defined ONLY inside the ...
void interp_atmfield_by_itw(VectorView x, const Index &atmosphere_dim, ConstTensor3View x_field, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
Interpolates an atmospheric field with pre-calculated weights by interp_atmfield_gp2itw.
Header file for special_interp.cc.
EnergyLevelMap InterpToGridPos(Index atmosphere_dim, const ArrayOfGridPos &p, const ArrayOfGridPos &lat, const ArrayOfGridPos &lon) const
Structure to store a grid position.
The structure to describe a propagation path and releated quantities.
Matrix los
Line-of-sight at each ppath point.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
String background
Radiative background.
Index np
Number of points describing the ppath.
Matrix pos
The distance between start pos and the last position in pos.
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Numeric end_lstep
The distance between end pos and the first position in pos.
Vector start_pos
Start position.
Vector lstep
The length between ppath points.
Numeric start_lstep
Length between sensor and atmospheric boundary.
Numeric constant
The propagation path constant (only used for 1D)
Vector r
Radius of each ppath point.
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Index dim
Atmospheric dimensionality.
Vector end_pos
End position.
Vector start_los
Start line-of-sight.
Vector nreal
The real part of the refractive index at each path position.
Vector end_los
End line-of-sight.
Numeric & rw(Index r, Index c)
Read and write index operator.
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.