47 ArrayOfMatrix& iy_aux,
48 const Index& stokes_dim,
54 "No need to use this method with *iy_unit* = \"1\".");
57 "The spectrum matrix *iy* is required to have original radiance\n"
58 "unit, but this seems not to be the case. This as a value above\n"
59 "1e-3 is found in *iy*.")
63 for (Index is = 0; is < stokes_dim; is++) {
69 for (Index i = 0; i < iy_aux_vars.
nelem(); i++) {
70 if (iy_aux_vars[i] ==
"iy" || iy_aux_vars[i] ==
"Error" ||
71 iy_aux_vars[i] ==
"Error (uncorrelated)") {
80 ArrayOfMatrix& iy_aux,
83 const Index& atmfields_checked,
84 const Index& atmgeom_checked,
87 const Index& cloudbox_on,
88 const Index& cloudbox_checked,
89 const Index& scat_data_checked,
92 const Vector& rte_pos,
93 const Vector& rte_los,
94 const Vector& rte_pos2,
96 const Agenda& iy_main_agenda,
101 "The atmospheric fields must be flagged to have\n"
102 "passed a consistency check (atmfields_checked=1).");
104 "The atmospheric geometry must be flagged to have\n"
105 "passed a consistency check (atmgeom_checked=1).");
107 "The cloudbox must be flagged to have\n"
108 "passed a consistency check (cloudbox_checked=1).");
111 "The scattering data must be flagged to have\n"
112 "passed a consistency check (scat_data_checked=1).");
115 Tensor3 iy_transmittance(0, 0, 0);
116 ArrayOfTensor3 diy_dx;
139 for (Index i = 0; i < iy.nrows(); i++) {
141 "One or several NaNs found in *iy*.");
149 ArrayOfMatrix& iy_aux,
150 ArrayOfTensor3& diy_dx,
159 Tensor4& ppvar_trans_cumulat,
160 Tensor4& ppvar_trans_partial,
162 const Index& stokes_dim,
163 const Vector& f_grid,
164 const Index& atmosphere_dim,
165 const Vector& p_grid,
166 const Vector& lat_grid,
167 const Vector& lon_grid,
168 const Tensor3& z_field,
169 const Tensor3& t_field,
171 const Tensor4& vmr_field,
173 const Tensor3& wind_u_field,
174 const Tensor3& wind_v_field,
175 const Tensor3& wind_w_field,
176 const Tensor3& mag_u_field,
177 const Tensor3& mag_v_field,
178 const Tensor3& mag_w_field,
179 const Matrix& z_surface,
180 const Vector& refellipsoid,
181 const Numeric& ppath_lmax,
182 const Numeric& ppath_lraytrace,
183 const Index& cloudbox_on,
184 const Index& gas_scattering_do,
185 const Index& suns_do,
188 const Index& jacobian_do,
191 const Vector& rte_pos2,
193 const Agenda& propmat_clearsky_agenda,
194 const Agenda& water_p_eq_agenda,
195 const String& rt_integration_option,
196 const Agenda& iy_main_agenda,
197 const Agenda& iy_space_agenda,
198 const Agenda& iy_surface_agenda,
199 const Agenda& iy_cloudbox_agenda,
200 const Agenda& gas_scattering_agenda,
201 const Agenda& ppath_step_agenda,
202 const Index& iy_agenda_call1,
203 const Tensor3& iy_transmittance,
204 const Numeric& rte_alonglos_v,
205 const Tensor3& surface_props_data,
208 const Index j_analytical_do = jacobian_do ? do_analytical_jacobian<2>(jacobian_quantities) : 0;
211 const Index nf = f_grid.nelem();
212 const Index ns = stokes_dim;
213 const Index np = ppath.
np;
214 const Index nq = j_analytical_do ? jacobian_quantities.
nelem() : 0;
221 "ppath.background is invalid. Check your "
222 "calculation of *ppath*?");
224 "A secondary propagation path starting at the "
225 "surface and is going directly into the surface "
226 "is found. This is not allowed.");
228 "If suns are present only iy_unit=\"1\" can be used.");
231Jacobian calculation are not supported when gas scattering or suns are included.
232This feature will be added in a future version.
237 ArrayOfTensor3 diy_dpath = j_analytical_do ?
get_standard_diy_dpath(jacobian_quantities, np, nf, ns,
false) : ArrayOfTensor3(0);
246 const Index naux = iy_aux_vars.
nelem();
249 Index auxOptDepth = -1;
250 Index auxDirectRad = -1;
251 Index auxRadBackGrnd = -1;
254 iy_aux.resize(iy_aux_vars.
nelem());
258 for (Index i = 0; i < naux; i++) {
261 if (iy_aux_vars[i] ==
"Radiative background"){
263 iy_aux[cnt].resize(nf, ns);
264 iy_aux[cnt](joker, 0) = (Numeric)
min((Index)2, rbi - 1);
266 else if (iy_aux_vars[i] ==
"Optical depth"){
270 iy_aux[cnt].resize(nf, ns);
273 else if (iy_aux_vars[i] ==
"Direct radiation"){
276 iy_aux[cnt].resize(nf, ns);
279 else if (iy_aux_vars[i] ==
"Radiation Background"){
281 auxRadBackGrnd = cnt;
282 iy_aux[cnt].resize(nf, ns);
287 "The only allowed strings in *iy_aux_vars* are:\n"
288 " \"Radiative background\"\n"
289 " \"Optical depth\"\n"
290 " \"Direct radiation\"\n"
291 " \"Radiation Background\"\n"
292 "but you have selected: \"", iy_aux_vars[i],
"\"")
297 ppvar_trans_cumulat.resize(np, nf, ns, ns);
298 ppvar_trans_partial.resize(np, nf, ns, ns);
299 ppvar_iy.resize(nf, ns, np);
315 ArrayOfPropagationMatrix K(np, PropagationMatrix(nf, ns));
316 ArrayOfArrayOfPropagationMatrix dK_dx(np);
318 ArrayOfVector dr_below(np, Vector(nq, 0));
319 ArrayOfVector dr_above(np, Vector(nq, 0));
321 if (np == 1 && rbi == 1) {
324 ppvar_vmr.resize(0, 0);
325 ppvar_wind.resize(0, 0);
326 ppvar_mag.resize(0, 0);
327 ppvar_f.resize(0, 0);
328 ppvar_trans_cumulat = 1;
351 ppvar_f, ppath, f_grid, atmosphere_dim, rte_alonglos_v, ppvar_wind);
353 const bool temperature_jacobian =
358 StokesVector
a(nf, ns), S(nf, ns);
361 Vector dB_dT(temperature_jacobian ? nf : 0);
362 ArrayOfStokesVector da_dx(nq), dS_dx(nq);
365 Index temperature_derivative_position = -1;
368 if (j_analytical_do) {
369 for (Index ip = 0; ip < np; ip++) {
370 dK_dx[ip].resize(nq);
374 da_dx[iq] = StokesVector(nf, ns); dS_dx[iq] = StokesVector(nf, ns);
375 if (jacobian_quantities[iq] == Jacobian::Atm::Temperature) {
376 temperature_derivative_position = iq;
377 do_hse = jacobian_quantities[iq].Subtag() ==
"HSE on";
386 const Vector in_los_dummy;
387 const Vector out_los_dummy;
389 const Tensor4 pnd_field_dummy;
390 const ArrayOfTensor4 dpnd_field_dx_dummy(jacobian_quantities.
nelem());
396 bool do_abort =
false;
399#pragma omp parallel for if (!arts_omp_in_parallel()) \
400 firstprivate(wss, a, B, dB_dT, S, da_dx, dS_dx)
401 for (Index ip = 0; ip < np; ip++) {
402 if (do_abort)
continue;
405 B, dB_dT, ppvar_f(joker, ip), ppvar_t[ip], temperature_jacobian);
414 propmat_clearsky_agenda,
416 Vector{ppvar_f(joker, ip)},
417 Vector{ppvar_mag(joker, ip)},
418 Vector{ppath.
los(ip, joker)},
420 Vector{ppvar_vmr(joker, ip)},
430 ppath.
los(ip, joker),
438 if (gas_scattering_do) {
442 Numeric minP =
min(ppvar_p);
444 if (suns_do && ppvar_p[ip] > minP) {
452 ArrayOfVector sun_rte_los(suns.
nelem(), Vector(2));
458 Vector{ppath.
pos(ip, joker)},
473 ArrayOfMatrix transmitted_sunlight;
474 ArrayOfArrayOfTensor3 dtransmitted_sunlight_dummy(suns.
nelem(),ArrayOfTensor3(jacobian_quantities.
nelem()));
477 transmitted_sunlight,
478 dtransmitted_sunlight_dummy,
496 cloudbox_limits_dummy,
509 propmat_clearsky_agenda,
511 gas_scattering_agenda,
518 for (Index i_sun = 0; i_sun < suns.
nelem(); i_sun++) {
519 if (suns_visible[i_sun]) {
524 scattered_sunlight_isun,
528 Vector{ppvar_vmr(joker, ip)},
529 transmitted_sunlight[i_sun],
531 Vector{ppath.
los(ip, joker)},
532 gas_scattering_agenda);
534 scattered_sunlight += scattered_sunlight_isun;
540 PropagationMatrix K_sca;
542 Vector sca_fct_dummy;
551 Vector{ppvar_vmr(joker, ip)},
555 gas_scattering_agenda);
585 }
catch (
const std::runtime_error& e) {
587 os <<
"Runtime-error in source calculation at index " << ip
590#pragma omp critical(iyEmissionStandard_source)
593 fail_msg.push_back(os.str());
598#pragma omp parallel for if (!arts_omp_in_parallel())
599 for (Index ip = 1; ip < np; ip++) {
600 if (do_abort)
continue;
602 const Numeric dr_dT_past =
603 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip - 1]) : 0;
604 const Numeric dr_dT_this =
605 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip]) : 0;
616 temperature_derivative_position);
618 r[ip - 1] = ppath.
lstep[ip - 1];
619 if (temperature_derivative_position >= 0){
620 dr_below[ip][temperature_derivative_position] = dr_dT_past;
621 dr_above[ip][temperature_derivative_position] = dr_dT_this;
623 }
catch (
const std::runtime_error& e) {
625 os <<
"Runtime-error in transmission calculation at index " << ip
628#pragma omp critical(iyEmissionStandard_transmission)
631 fail_msg.push_back(os.str());
637 "Error messages from failed cases:\n", fail_msg)
644 Tensor3 iy_trans_new;
646 iy_trans_new = tot_tra[np - 1];
651 if (auxOptDepth >= 0)
652 for (Index iv = 0; iv < nf; iv++)
653 iy_aux[auxOptDepth](iv, 0) = -std::log(tot_tra[np - 1](iv, 0, 0));
680 Matrix iy_direct(nf, ns, 0.);
683 Matrix iy_direct_toa;
684 Tensor3 total_transmission;
685 total_transmission = tot_tra[np - 1];
700 for (Index iv = 0; iv < nf; iv++) {
701 mult(iy_direct(iv, joker),
702 total_transmission(iv, joker, joker),
703 iy_direct_toa(iv, joker));
712 if (auxDirectRad >= 0)
713 iy_aux[auxDirectRad] = iy_direct;
716 if (auxRadBackGrnd >= 0)
717 iy_aux[auxRadBackGrnd] = iy;
720 lvl_rad[np - 1] = iy;
723 if (rt_integration_option ==
"first order" || rt_integration_option ==
"default") {
724 for (Index ip = np - 2; ip >= 0; ip--) {
725 lvl_rad[ip] = lvl_rad[ip + 1];
735 dlyr_tra_above[ip + 1],
736 dlyr_tra_below[ip + 1],
739 ArrayOfPropagationMatrix(),
740 ArrayOfPropagationMatrix(),
749 }
else if (rt_integration_option ==
"second order") {
750 for (Index ip = np - 2; ip >= 0; ip--) {
751 lvl_rad[ip] = lvl_rad[ip + 1];
761 dlyr_tra_above[ip + 1],
762 dlyr_tra_below[ip + 1],
781 for (Index ip = 0; ip < lvl_rad.
nelem(); ip++) {
782 ppvar_trans_cumulat(ip, joker, joker, joker) = tot_tra[ip];
783 ppvar_trans_partial(ip, joker, joker, joker) = lyr_tra[ip];
784 ppvar_iy(joker, joker, ip) = lvl_rad[ip];
791 if (j_analytical_do) {
811 if (iy_agenda_call1) {
828 ArrayOfMatrix& iy_aux,
829 ArrayOfTensor3& diy_dx,
839 Tensor4& ppvar_trans_cumulat,
840 Tensor4& ppvar_trans_partial,
842 const Index& stokes_dim,
843 const Vector& f_grid,
844 const Index& atmosphere_dim,
845 const Vector& p_grid,
846 const Tensor3& t_field,
848 const Tensor4& vmr_field,
850 const Tensor3& wind_u_field,
851 const Tensor3& wind_v_field,
852 const Tensor3& wind_w_field,
853 const Tensor3& mag_u_field,
854 const Tensor3& mag_v_field,
855 const Tensor3& mag_w_field,
856 const Index& cloudbox_on,
858 const Tensor4& pnd_field,
859 const ArrayOfTensor4& dpnd_field_dx,
864 const Index& jacobian_do,
866 const Agenda& propmat_clearsky_agenda,
867 const Agenda& water_p_eq_agenda,
868 const String& rt_integration_option,
869 const Agenda& iy_main_agenda,
870 const Agenda& iy_space_agenda,
871 const Agenda& iy_surface_agenda,
872 const Agenda& iy_cloudbox_agenda,
873 const Index& iy_agenda_call1,
874 const Tensor3& iy_transmittance,
876 const Vector& rte_pos2,
877 const Numeric& rte_alonglos_v,
878 const Tensor3& surface_props_data,
879 const Tensor7& cloudbox_field,
880 const Vector& za_grid,
882 const Index& t_interp_order,
923 propmat_clearsky_agenda,
925 rt_integration_option,
938 const Index j_analytical_do = jacobian_do ? do_analytical_jacobian<1>(jacobian_quantities) : 0;
941 const Index nf = f_grid.nelem();
942 const Index ns = stokes_dim;
943 const Index np = ppath.
np;
944 const Index nq = j_analytical_do ? jacobian_quantities.
nelem() : 0;
950 if (atmosphere_dim != 1)
952 "With cloudbox on, this method handles only 1D calculations.");
953 if (Naa < 3)
throw runtime_error(
"Naa must be > 2.");
955 if (dpnd_field_dx.nelem() != jacobian_quantities.
nelem())
957 "*dpnd_field_dx* not properly initialized:\n"
958 "Number of elements in dpnd_field_dx must be equal number of jacobian"
959 " quantities.\n(Note: jacobians have to be defined BEFORE *pnd_field*"
960 " is calculated/set.");
961 if (rbi < 1 || rbi > 9)
963 "ppath.background is invalid. Check your "
964 "calculation of *ppath*?");
965 if (rbi == 3 || rbi == 4)
967 "The propagation path ends inside or at boundary of "
968 "the cloudbox.\nFor this method, *ppath* must be "
969 "calculated in this way:\n ppathCalc( cloudbox_on = 0 ).");
972 if (cloudbox_field.ncols() != stokes_dim)
974 "Obtained *cloudbox_field* number of Stokes elements inconsistent with "
976 if (cloudbox_field.nrows() != 1)
978 "Obtained *cloudbox_field* has wrong number of azimuth angles.");
979 if (cloudbox_field.npages() != za_grid.nelem())
981 "Obtained *cloudbox_field* number of zenith angles inconsistent with "
983 if (cloudbox_field.nbooks() != 1)
985 "Obtained *cloudbox_field* has wrong number of longitude points.");
986 if (cloudbox_field.nshelves() != 1)
988 "Obtained *cloudbox_field* has wrong number of latitude points.");
989 if (cloudbox_field.nvitrines() != cloudbox_limits[1] - cloudbox_limits[0] + 1)
991 "Obtained *cloudbox_field* number of pressure points inconsistent with "
992 "*cloudbox_limits*.");
993 if (cloudbox_field.nlibraries() != nf)
995 "Obtained *cloudbox_field* number of frequency points inconsistent with "
999 ArrayOfTensor3 diy_dpath = j_analytical_do ?
get_standard_diy_dpath(jacobian_quantities, np, nf, ns,
false) : ArrayOfTensor3(0);
1011 const Index naux = iy_aux_vars.
nelem();
1012 iy_aux.resize(naux);
1014 for (Index i = 0; i < naux; i++) {
1015 iy_aux[i].resize(nf, ns);
1017 if (iy_aux_vars[i] ==
"Optical depth") {
1019 else if (iy_aux_vars[i] ==
"Radiative background")
1020 iy_aux[i] = (Numeric)
min((Index)2, rbi - 1);
1023 os <<
"The only allowed strings in *iy_aux_vars* are:\n"
1024 <<
" \"Radiative background\"\n"
1025 <<
" \"Optical depth\"\n"
1026 <<
"but you have selected: \"" << iy_aux_vars[i] <<
"\"";
1027 throw runtime_error(os.str());
1032 ppvar_trans_cumulat.resize(np, nf, ns, ns);
1033 ppvar_trans_partial.resize(np, nf, ns, ns);
1034 ppvar_iy.resize(nf, ns, np);
1051 if (np == 1 && rbi == 1) {
1054 ppvar_vmr.resize(0, 0);
1055 ppvar_wind.resize(0, 0);
1056 ppvar_mag.resize(0, 0);
1057 ppvar_f.resize(0, 0);
1058 ppvar_trans_cumulat = 0;
1059 ppvar_trans_partial = 0;
1060 for (Index iv = 0; iv < nf; iv++) {
1061 for (Index is = 0; is < ns; is++) {
1062 ppvar_trans_cumulat(0,iv,is,is) = 1;
1063 ppvar_trans_partial(0,iv,is,is) = 1;
1088 ppvar_f, ppath, f_grid, atmosphere_dim, rte_alonglos_v, ppvar_wind);
1092 ArrayOfMatrix ppvar_dpnd_dx;
1105 PropagationMatrix K_this(nf, ns), K_past(nf, ns), Kp(nf, ns);
1106 StokesVector
a(nf, ns), S(nf, ns), Sp(nf, ns);
1113 ArrayOfPropagationMatrix dK_this_dx(nq), dK_past_dx(nq), dKp_dx(nq);
1114 ArrayOfStokesVector da_dx(nq), dS_dx(nq), dSp_dx(nq);
1117 Index temperature_derivative_position = -1;
1118 bool do_hse =
false;
1120 if (j_analytical_do) {
1123 dK_this_dx[iq] = PropagationMatrix(nf, ns);
1124 dK_past_dx[iq] = PropagationMatrix(nf, ns);
1125 dKp_dx[iq] = PropagationMatrix(nf, ns);
1126 da_dx[iq] = StokesVector(nf, ns);
1127 dS_dx[iq] = StokesVector(nf, ns);
1128 dSp_dx[iq] = StokesVector(nf, ns);
1129 if (jacobian_quantities[iq] == Jacobian::Atm::Temperature) {
1130 temperature_derivative_position = iq;
1131 do_hse = jacobian_quantities[iq].Subtag() ==
"HSE on";
1134 const bool temperature_jacobian =
1138 for (Index ip = 0; ip < np; ip++) {
1140 B, dB_dT, ppvar_f(joker, ip), ppvar_t[ip], temperature_jacobian);
1148 propmat_clearsky_agenda,
1149 jacobian_quantities,
1150 Vector{ppvar_f(joker, ip)},
1151 Vector{ppvar_mag(joker, ip)},
1152 Vector{ppath.
los(ip, joker)},
1154 Vector{ppvar_vmr(joker, ip)},
1159 if (j_analytical_do)
1162 jacobian_quantities,
1164 ppath.
los(ip, joker),
1169 if (clear2cloudy[ip] + 1) {
1174 jacobian_quantities,
1175 ppvar_pnd(joker, Range(ip, 1)),
1179 ppath.
los(ip, joker),
1180 ppvar_t[Range(ip, 1)],
1186 if (j_analytical_do)
1188 dK_this_dx[iq] += dKp_dx[iq];)
1195 jacobian_quantities,
1196 ppvar_pnd(joker, ip),
1203 ppath.
los(Range(ip, 1), joker),
1205 Vector{ppvar_t[Range(ip, 1)]},
1211 if (j_analytical_do)
1215 if (j_analytical_do)
1220 const Numeric dr_dT_past =
1221 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip - 1]) : 0;
1222 const Numeric dr_dT_this =
1223 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip]) : 0;
1231 ppath.
lstep[ip - 1],
1234 temperature_derivative_position);
1248 jacobian_quantities,
1251 swap(K_past, K_this);
1252 swap(dK_past_dx, dK_this_dx);
1260 Tensor3 iy_trans_new;
1261 if (iy_agenda_call1)
1262 iy_trans_new = tot_tra[np - 1];
1267 for (Index i = 0; i < naux; i++)
1268 if (iy_aux_vars[i] ==
"Optical depth")
1269 for (Index iv = 0; iv < nf; iv++)
1270 iy_aux[i](iv, joker) = -log(ppvar_trans_cumulat(np - 1, iv, 0, 0));
1279 jacobian_quantities,
1296 lvl_rad[np - 1] = iy;
1299 for (Index ip = np - 2; ip >= 0; ip--) {
1300 lvl_rad[ip] = lvl_rad[ip + 1];
1310 dlyr_tra_above[ip + 1],
1311 dlyr_tra_below[ip + 1],
1312 PropagationMatrix(),
1313 PropagationMatrix(),
1314 ArrayOfPropagationMatrix(),
1315 ArrayOfPropagationMatrix(),
1326 for (Index ip = 0; ip < lvl_rad.
nelem(); ip++) {
1327 ppvar_trans_cumulat(ip, joker, joker, joker) = tot_tra[ip];
1328 ppvar_trans_partial(ip, joker, joker, joker) = lyr_tra[ip];
1329 ppvar_iy(joker, joker, ip) = lvl_rad[ip];
1330 if (j_analytical_do)
1336 if (j_analytical_do)
1351 jacobian_quantities,
1355 if (iy_agenda_call1)
1363 jacobian_quantities,
1372 ArrayOfMatrix& iy_aux,
1373 ArrayOfTensor3& diy_dx,
1382 Tensor4& ppvar_trans_cumulat,
1383 Tensor4& ppvar_trans_partial,
1385 const Index& stokes_dim,
1386 const Vector& f_grid,
1387 const Index& atmosphere_dim,
1388 const Vector& p_grid,
1389 const Tensor3& t_field,
1391 const Tensor4& vmr_field,
1393 const Tensor3& wind_u_field,
1394 const Tensor3& wind_v_field,
1395 const Tensor3& wind_w_field,
1396 const Tensor3& mag_u_field,
1397 const Tensor3& mag_v_field,
1398 const Tensor3& mag_w_field,
1399 const Index& cloudbox_on,
1402 const Index& jacobian_do,
1405 const Vector& rte_pos2,
1406 const Agenda& propmat_clearsky_agenda,
1407 const Agenda& water_p_eq_agenda,
1408 const String& rt_integration_option,
1409 const Agenda& iy_main_agenda,
1410 const Agenda& iy_space_agenda,
1411 const Agenda& iy_surface_agenda,
1412 const Agenda& iy_cloudbox_agenda,
1413 const Index& iy_agenda_call1,
1414 const Tensor3& iy_transmittance,
1415 const Numeric& rte_alonglos_v,
1416 const Tensor3& surface_props_data,
1419 const Index j_analytical_do = jacobian_do ? do_analytical_jacobian<2>(jacobian_quantities) : 0;
1422 const Index nf = f_grid.nelem();
1423 const Index ns = stokes_dim;
1424 const Index np = ppath.
np;
1425 const Index nq = j_analytical_do ? jacobian_quantities.
nelem() : 0;
1432 "ppath.background is invalid. Check your "
1433 "calculation of *ppath*?");
1435 "A secondary propagation path starting at the "
1436 "surface and is going directly into the surface "
1437 "is found. This is not allowed.");
1440 ArrayOfTensor3 diy_dpath = j_analytical_do ?
get_standard_diy_dpath(jacobian_quantities, np, nf, ns,
false) : ArrayOfTensor3(0);
1449 const Index naux = iy_aux_vars.
nelem();
1450 iy_aux.resize(naux);
1452 Index auxOptDepth = -1;
1454 for (Index i = 0; i < naux; i++) {
1455 iy_aux[i].resize(nf, ns);
1458 if (iy_aux_vars[i] ==
"Radiative background")
1459 iy_aux[i](joker, 0) = (Numeric)
min((Index)2, rbi - 1);
1460 else if (iy_aux_vars[i] ==
"Optical depth")
1464 "The only allowed strings in *iy_aux_vars* are:\n"
1465 " \"Radiative background\"\n"
1466 " \"Optical depth\"\n"
1467 "but you have selected: \"", iy_aux_vars[i],
"\"")
1472 ppvar_trans_cumulat.resize(np, nf, ns, ns);
1473 ppvar_trans_partial.resize(np, nf, ns, ns);
1474 ppvar_iy.resize(nf, ns, np);
1490 ArrayOfPropagationMatrix K(np, PropagationMatrix(nf, ns));
1491 ArrayOfArrayOfPropagationMatrix dK_dx(np);
1493 ArrayOfVector dr_below(np, Vector(nq, 0));
1494 ArrayOfVector dr_above(np, Vector(nq, 0));
1496 if (np == 1 && rbi == 1) {
1499 ppvar_vmr.resize(0, 0);
1500 ppvar_wind.resize(0, 0);
1501 ppvar_mag.resize(0, 0);
1502 ppvar_f.resize(0, 0);
1503 ppvar_trans_cumulat = 0;
1504 ppvar_trans_partial = 0;
1505 for (Index iv = 0; iv < nf; iv++) {
1506 for (Index is = 0; is < ns; is++) {
1507 ppvar_trans_cumulat(0,iv,is,is) = 1;
1508 ppvar_trans_partial(0,iv,is,is) = 1;
1534 ppvar_f, ppath, f_grid, atmosphere_dim, rte_alonglos_v, ppvar_wind);
1536 const bool temperature_jacobian =
1541 StokesVector
a(nf, ns), S(nf, ns);
1546 Vector dB_dT(temperature_jacobian ? nf : 0);
1547 ArrayOfStokesVector da_dx(nq), dS_dx(nq);
1550 Index temperature_derivative_position = -1;
1551 bool do_hse =
false;
1553 if (j_analytical_do) {
1554 for (Index ip = 0; ip < np; ip++) {
1555 dK_dx[ip].resize(nq);
1559 da_dx[iq] = StokesVector(nf, ns); dS_dx[iq] = StokesVector(nf, ns);
1560 if (jacobian_quantities[iq] == Jacobian::Atm::Temperature) {
1561 temperature_derivative_position = iq;
1562 do_hse = jacobian_quantities[iq].Subtag() ==
"HSE on";
1567 bool do_abort =
false;
1572#pragma omp parallel for if (!arts_omp_in_parallel()) \
1573 firstprivate(wss, a, B, dB_dT, S, da_dx, dS_dx)
1574 for (Index ip = 0; ip < np; ip++) {
1575 if (do_abort)
continue;
1578 B, dB_dT, ppvar_f(joker, ip), ppvar_t[ip], temperature_jacobian);
1587 propmat_clearsky_agenda,
1588 jacobian_quantities,
1589 Vector{ppvar_f(joker, ip)},
1590 Vector{ppvar_mag(joker, ip)},
1591 Vector{ppath.
los(ip, joker)},
1593 Vector{ppvar_vmr(joker, ip)},
1598 if (j_analytical_do)
1601 jacobian_quantities,
1603 ppath.
los(ip, joker),
1610 if (j_analytical_do)
1624 jacobian_quantities,
1626 }
catch (
const std::runtime_error& e) {
1628 os <<
"Runtime-error in source calculation at index " << ip
1631#pragma omp critical(iyEmissionStandard_source)
1634 fail_msg.push_back(os.str());
1639#pragma omp parallel for if (!arts_omp_in_parallel())
1640 for (Index ip = 1; ip < np; ip++) {
1641 if (do_abort)
continue;
1643 const Numeric dr_dT_past =
1644 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip - 1]) : 0;
1645 const Numeric dr_dT_this =
1646 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip]) : 0;
1654 ppath.
lstep[ip - 1],
1657 temperature_derivative_position);
1659 r[ip - 1] = ppath.
lstep[ip - 1];
1660 if (temperature_derivative_position >= 0){
1661 dr_below[ip][temperature_derivative_position] = dr_dT_past;
1662 dr_above[ip][temperature_derivative_position] = dr_dT_this;
1664 }
catch (
const std::runtime_error& e) {
1666 os <<
"Runtime-error in transmission calculation at index " << ip
1669#pragma omp critical(iyEmissionStandard_transmission)
1672 fail_msg.push_back(os.str());
1678 "Error messages from failed cases:\n", fail_msg)
1685 Tensor3 iy_trans_new;
1686 if (iy_agenda_call1)
1687 iy_trans_new = tot_tra[np - 1];
1692 if (auxOptDepth >= 0)
1693 for (Index iv = 0; iv < nf; iv++)
1694 iy_aux[auxOptDepth](iv, 0) = -std::log(tot_tra[np - 1](iv, 0, 0));
1703 jacobian_quantities,
1720 lvl_rad[np - 1] = iy;
1723 if (rt_integration_option ==
"first order" || rt_integration_option ==
"default") {
1724 for (Index ip = np - 2; ip >= 0; ip--) {
1725 lvl_rad[ip] = lvl_rad[ip + 1];
1735 dlyr_tra_above[ip + 1],
1736 dlyr_tra_below[ip + 1],
1737 PropagationMatrix(),
1738 PropagationMatrix(),
1739 ArrayOfPropagationMatrix(),
1740 ArrayOfPropagationMatrix(),
1748 }
else if (rt_integration_option ==
"second order") {
1749 for (Index ip = np - 2; ip >= 0; ip--) {
1750 lvl_rad[ip] = lvl_rad[ip + 1];
1760 dlyr_tra_above[ip + 1],
1761 dlyr_tra_below[ip + 1],
1780 for (Index ip = 0; ip < lvl_rad.
nelem(); ip++) {
1781 ppvar_trans_cumulat(ip, joker, joker, joker) = tot_tra[ip];
1782 ppvar_trans_partial(ip, joker, joker, joker) = lyr_tra[ip];
1783 ppvar_iy(joker, joker, ip) = lvl_rad[ip];
1784 if (j_analytical_do)
1790 if (j_analytical_do) {
1805 jacobian_quantities,
1810 if (iy_agenda_call1) {
1818 jacobian_quantities,
1827 ArrayOfMatrix& iy_aux,
1829 ArrayOfTensor3& diy_dx,
1832 const Vector& f_grid,
1833 const Index& atmosphere_dim,
1834 const Vector& p_grid,
1835 const Vector& lat_grid,
1836 const Vector& lon_grid,
1837 const Vector& lat_true,
1838 const Vector& lon_true,
1839 const Tensor3& t_field,
1840 const Tensor3& z_field,
1841 const Tensor4& vmr_field,
1843 const Tensor3& wind_u_field,
1844 const Tensor3& wind_v_field,
1845 const Tensor3& wind_w_field,
1846 const Tensor3& mag_u_field,
1847 const Tensor3& mag_v_field,
1848 const Tensor3& mag_w_field,
1849 const Index& cloudbox_on,
1851 const Tensor4& pnd_field,
1852 const Matrix& particle_masses,
1853 const Agenda& ppath_agenda,
1854 const Numeric& ppath_lmax,
1855 const Numeric& ppath_lraytrace,
1856 const Index& iy_agenda_call1,
1858 const Tensor3& iy_transmittance,
1859 const Vector& rte_pos,
1860 const Vector& rte_los,
1861 const Vector& rte_pos2,
1862 const Index& jacobian_do,
1864 const Agenda& iy_independent_beam_approx_agenda,
1865 const Index& return_atm1d,
1866 const Index& skip_vmr,
1867 const Index& skip_pnd,
1868 const Index& return_masses,
1872 "Jacobians not provided by the method, *jacobian_do* "
1875 "This method does not yet support non-empty *nlte_field*.");
1877 "This method does not yet support non-empty *wind_u_field*.");
1879 "This method does not yet support non-empty *wind_v_field*.");
1881 "This method does not yet support non-empty *wind_w_field*.");
1883 "This method does not yet support non-empty *mag_u_field*.");
1885 "This method does not yet support non-empty *mag_v_field*.");
1887 "This method does not yet support non-empty *mag_w_field*.");
1889 if (return_masses) {
1891 "Sizes of *pnd_field* and *particle_masses* "
1892 "are inconsistent.");
1925 if (cloudbox_on && ppath.
end_lstep == 0) {
1926 Vector los_tmp = rte_los;
1927 if (abs(rte_los[0]) < 90) {
1949 const Index np = ppath.
np + ppath2.
np - 1;
1955 for (Index i = 0; i < ppath.
np; i++) {
1956 const Index ip = ppath.
np - i - 1;
1957 gp_p[i] = ppath.
gp_p[ip];
1958 if (atmosphere_dim > 1) {
1959 gp_lat[i] = ppath.
gp_lat[ip];
1960 if (atmosphere_dim == 3) {
1961 gp_lon[i] = ppath.
gp_lon[ip];
1966 for (Index i = ppath.
np; i < np; i++) {
1967 const Index ip = i - ppath.
np + 1;
1968 gp_p[i] = ppath2.
gp_p[ip];
1969 if (atmosphere_dim > 1) {
1970 gp_lat[i] = ppath2.
gp_lat[ip];
1971 if (atmosphere_dim == 3) {
1972 gp_lon[i] = ppath2.
gp_lon[ip];
1978 for (Index i = 0; i < ppath2.
np - 1; i++) {
1979 const Index ip = ppath2.
np - i - 1;
1980 gp_p[i] = ppath2.
gp_p[ip];
1981 if (atmosphere_dim > 1) {
1982 gp_lat[i] = ppath2.
gp_lat[ip];
1983 if (atmosphere_dim == 3) {
1984 gp_lon[i] = ppath2.
gp_lon[ip];
1989 for (Index i = ppath2.
np - 1; i < np; i++) {
1990 const Index ip = i - ppath2.
np + 1;
1991 gp_p[i] = ppath.
gp_p[ip];
1992 if (atmosphere_dim > 1) {
1993 gp_lat[i] = ppath.
gp_lat[ip];
1994 if (atmosphere_dim == 3) {
1995 gp_lon[i] = ppath.
gp_lon[ip];
2006 itw2p(p1, p_grid, gp_p, itw);
2009 Vector lat1(0), lon1(0);
2010 Vector lat_true1(1), lon_true1(1);
2011 if (atmosphere_dim == 3) {
2014 interp(lat_true1, itw, lat_grid, gp1);
2017 interp(lon_true1, itw, lon_grid, gp1);
2018 }
else if (atmosphere_dim == 2) {
2021 interp(lat_true1, itw, lat_true, gp1);
2022 interp(lon_true1, itw, lon_true, gp1);
2024 lat_true1[0] = lat_true[0];
2025 lon_true1[0] = lon_true[0];
2032 Tensor3 t1(np, 1, 1);
2034 t1(joker, 0, 0), atmosphere_dim, t_field, gp_p, gp_lat, gp_lon, itw);
2037 Tensor3 z1(np, 1, 1);
2039 z1(joker, 0, 0), atmosphere_dim, z_field, gp_p, gp_lat, gp_lon, itw);
2042 Tensor4 vmr1(vmr_field.nbooks(), np, 1, 1);
2043 for (Index is = 0; is < vmr_field.nbooks(); is++) {
2046 vmr_field(is, joker, joker, joker),
2054 Matrix zsurf1(1, 1);
2055 zsurf1(0, 0) = z1(0, 0, 0);
2059 pos1[0] = rte_pos[0];
2061 los1[0] = abs(rte_los[0]);
2063 if (rte_pos2.nelem()) {
2064 pos2 = rte_pos2[Range(0, rte_pos2.nelem())];
2069 Index cbox_on1 = cloudbox_on;
2071 Tensor4 pnd1(0, 0, 0, 0);
2077 for (Index i = 0; i < np; i++) {
2101 const Index extra_bot = ifirst == 0 ? 0 : 1;
2102 const Index extra_top = ilast == np - 1 ? 0 : 1;
2104 cbox_lims1.resize(2);
2105 cbox_lims1[0] = ifirst - extra_bot;
2106 cbox_lims1[1] = ilast + extra_top;
2110 pnd1.resize(pnd_field.nbooks(), cbox_lims1[1] - cbox_lims1[0] + 1, 1, 1);
2113 itw.resize(1, Index(pow(2.0, Numeric(atmosphere_dim))));
2115 for (Index i = extra_bot; i < pnd1.npages() - extra_top; i++) {
2116 const Index i0 = cbox_lims1[0] + i;
2127 for (Index p = 0; p < pnd_field.nbooks(); p++) {
2130 pnd_field(p, joker, joker, joker),
2143 const Index adim1 = 1;
2144 const Numeric lmax1 = -1;
2177 iy_independent_beam_approx_agenda);
2183 const Index nvmr = skip_vmr ? 0 : vmr1.nbooks();
2184 const Index npnd = skip_pnd ? 0 : pnd1.nbooks();
2185 const Index nmass = return_masses ? particle_masses.ncols() : 0;
2186 const Index ntot = 2 + nvmr + npnd + nmass;
2188 atm_fields_compact.
resize(ntot, np, 1, 1);
2191 field_names[0] =
"Geometric altitudes";
2192 atm_fields_compact.
data(0, joker, 0, 0) = z1(joker, 0, 0);
2195 field_names[1] =
"Temperature";
2196 atm_fields_compact.
data(1, joker, 0, 0) = t1(joker, 0, 0);
2200 for (Index i = 0; i < nvmr; i++) {
2201 const Index iout = 2 + i;
2203 sstr <<
"VMR species " << i;
2204 field_names[iout] = sstr.str();
2205 atm_fields_compact.
data(iout, joker, 0, 0) = vmr1(i, joker, 0, 0);
2211 for (Index i = 0; i < npnd; i++) {
2212 const Index iout = 2 + nvmr + i;
2214 sstr <<
"Scattering element " << i;
2215 field_names[iout] = sstr.str();
2216 atm_fields_compact.
data(iout, joker, 0, 0) = 0;
2217 atm_fields_compact.
data(
2218 iout, Range(cbox_lims1[0], pnd1.npages()), 0, 0) =
2219 pnd1(i, joker, 0, 0);
2225 for (Index i = 0; i < nmass; i++) {
2226 const Index iout = 2 + nvmr + npnd + i;
2228 sstr <<
"Mass category " << i;
2229 field_names[iout] = sstr.str();
2230 atm_fields_compact.
data(iout, joker, 0, 0) = 0;
2231 for (Index ip = cbox_lims1[0]; ip < pnd1.npages(); ip++) {
2232 for (Index is = 0; is < pnd1.nbooks(); is++) {
2233 atm_fields_compact.
data(iout, ip, 0, 0) +=
2234 particle_masses(is, i) * pnd1(is, ip, 0, 0);
2243 "Data created by *iyIndependentBeamApproximation*");
2246 "Atmospheric quantity");
2247 atm_fields_compact.
set_grid(GFIELD4_FIELD_NAMES, field_names);
2248 atm_fields_compact.
set_grid_name(GFIELD4_P_GRID,
"Pressure");
2249 atm_fields_compact.
set_grid(GFIELD4_P_GRID, p1);
2250 atm_fields_compact.
set_grid_name(GFIELD4_LAT_GRID,
"Latitude");
2251 atm_fields_compact.
set_grid(GFIELD4_LAT_GRID, lat_true1);
2252 atm_fields_compact.
set_grid_name(GFIELD4_LON_GRID,
"Longitude");
2253 atm_fields_compact.
set_grid(GFIELD4_LON_GRID, lon_true1);
2260 ArrayOfMatrix& iy_aux,
2262 ArrayOfTensor3& diy_dx,
2264 const Index& iy_agenda_call1,
2265 const Tensor3& iy_transmittance,
2266 const Vector& rte_pos,
2267 const Vector& rte_los,
2268 const Vector& rte_pos2,
2269 const Index& stokes_dim,
2270 const Vector& f_grid,
2271 const Agenda& iy_loop_freqs_agenda,
2275 "Recursive usage not possible (iy_agenda_call1 must be 1).");
2277 "*iy_transmittance* must be empty.");
2279 const Index nf = f_grid.nelem();
2281 for (Index i = 0; i < nf; i++) {
2284 ArrayOfMatrix iy_aux1;
2285 ArrayOfTensor3 diy_dx1;
2296 Vector(1, f_grid[i]),
2300 iy_loop_freqs_agenda);
2304 iy.resize(nf, stokes_dim);
2306 iy_aux.resize(iy_aux1.nelem());
2307 for (Index q = 0; q < iy_aux1.nelem(); q++) {
2308 iy_aux[q].resize(nf, stokes_dim);
2311 diy_dx.resize(diy_dx1.nelem());
2312 for (Index q = 0; q < diy_dx1.nelem(); q++) {
2313 diy_dx[q].resize(diy_dx1[q].npages(), nf, stokes_dim);
2318 iy(i, joker) = iy1(0, joker);
2319 for (Index q = 0; q < iy_aux1.nelem(); q++) {
2320 iy_aux[q](i, joker) = iy_aux1[q](0, joker);
2322 for (Index q = 0; q < diy_dx1.nelem(); q++) {
2323 diy_dx[q](joker, i, joker) = diy_dx1[q](joker, 0, joker);
2331 ArrayOfMatrix& iy_aux,
2332 ArrayOfTensor3& diy_dx,
2333 const Index& iy_agenda_call1,
2334 const Tensor3& iy_transmittance,
2335 const Vector& rte_pos,
2336 const Vector& rte_los,
2338 const Index& jacobian_do,
2339 const Index& atmosphere_dim,
2340 const Vector& p_grid,
2341 const Vector& lat_grid,
2342 const Vector& lon_grid,
2343 const Tensor3& z_field,
2344 const Tensor3& t_field,
2345 const Tensor4& vmr_field,
2346 const Vector& refellipsoid,
2347 const Matrix& z_surface,
2348 const Index& cloudbox_on,
2350 const Index& stokes_dim,
2351 const Vector& f_grid,
2353 const Agenda& iy_space_agenda,
2354 const Agenda& surface_rtprop_agenda,
2355 const Agenda& propmat_clearsky_agenda,
2356 const Agenda& ppath_step_agenda,
2357 const Numeric& ppath_lmax,
2358 const Numeric& ppath_lraytrace,
2359 const Tensor4& pnd_field,
2361 const Numeric& mc_std_err,
2362 const Index& mc_max_time,
2363 const Index& mc_max_iter,
2364 const Index& mc_min_iter,
2365 const Numeric& mc_taustep_limit,
2366 const Index& t_interp_order,
2370 "Only 3D atmospheres are allowed (atmosphere_dim must be 3)");
2372 "The cloudbox must be activated (cloudbox_on must be 1)");
2374 "This method does not provide any jacobians (jacobian_do must be 0)");
2376 "Recursive usage not possible (iy_agenda_call1 must be 1)");
2378 "*iy_transmittance* must be empty");
2382 const Index nf = f_grid.nelem();
2384 iy.resize(nf, stokes_dim);
2388 Index auxError = -1;
2390 const Index naux = iy_aux_vars.
nelem();
2391 iy_aux.resize(naux);
2393 for (Index i = 0; i < naux; i++) {
2394 if (iy_aux_vars[i] ==
"Error (uncorrelated)") {
2396 iy_aux[i].resize(nf, stokes_dim);
2399 "In *iy_aux_vars* you have included: \"", iy_aux_vars[i],
2400 "\"\nThis choice is not recognised.")
2412 Matrix pos(1, 3), los(1, 2);
2414 pos(0, joker) = rte_pos;
2415 los(0, joker) = rte_los;
2418 bool failed =
false;
2423#pragma omp parallel for if (!arts_omp_in_parallel() && nf > 1) firstprivate(wss)
2424 for (Index f_index = 0; f_index < nf; f_index++) {
2425 if (failed)
continue;
2434 Index mc_iteration_count;
2456 surface_rtprop_agenda,
2457 propmat_clearsky_agenda,
2487 iy(f_index, joker) = y;
2489 if (auxError >= 0) {
2490 iy_aux[auxError](f_index, joker) = mc_error;
2492 }
catch (
const std::exception& e) {
2494 os <<
"Error for f_index = " << f_index <<
" (" << f_grid[f_index]
2497#pragma omp critical(iyMC_fail)
2500 fail_msg = os.str();
2512 const ArrayOfMatrix& iy_aux,
2514 const Index& jacobian_do,
2518 "*iy_aux* and *iy_aux_vars* must have the same "
2519 "number of elements.");
2522 "This method can not provide any jacobians and "
2523 "*jacobian_do* must be 0.");
2527 for (Index i = 0; i < iy_aux.nelem() && !ready; i++) {
2528 if (iy_aux_vars[i] == aux_var) {
2535 "The selected auxiliary variable to insert in *iy* "
2536 "is either not defined at all or is not set.");
2541 Matrix& ppvar_optical_depth,
2542 const Tensor4& ppvar_trans_cumulat,
2544 ppvar_optical_depth = ppvar_trans_cumulat(joker, joker, 0, 0);
2545 transform(ppvar_optical_depth, log, ppvar_optical_depth);
2546 ppvar_optical_depth *= -1;
2556 ArrayOfVector& y_aux,
2559 const Index& atmgeom_checked,
2560 const Index& atmfields_checked,
2561 const Index& atmosphere_dim,
2563 const Index& cloudbox_on,
2564 const Index& cloudbox_checked,
2565 const Index& scat_data_checked,
2566 const Index& sensor_checked,
2567 const Index& stokes_dim,
2568 const Vector& f_grid,
2569 const Matrix& sensor_pos,
2570 const Matrix& sensor_los,
2571 const Matrix& transmitter_pos,
2572 const Matrix& mblock_dlos,
2573 const Sparse& sensor_response,
2574 const Vector& sensor_response_f,
2576 const Matrix& sensor_response_dlos,
2578 const Agenda& iy_main_agenda,
2579 const Agenda& jacobian_agenda,
2580 const Index& jacobian_do,
2591 "The frequency grid is empty.");
2594 "All frequencies in *f_grid* must be > 0.");
2597 "The atmospheric fields must be flagged to have\n"
2598 "passed a consistency check (atmfields_checked=1).");
2600 "The atmospheric geometry must be flagged to have\n"
2601 "passed a consistency check (atmgeom_checked=1).");
2603 "The cloudbox must be flagged to have\n"
2604 "passed a consistency check (cloudbox_checked=1).");
2607 "The scattering data must be flagged to have\n"
2608 "passed a consistency check (scat_data_checked=1).");
2610 "The sensor variables must be flagged to have\n"
2611 "passed a consistency check (sensor_checked=1).");
2614 const Index nf = f_grid.nelem();
2615 const Index nlos = mblock_dlos.nrows();
2616 const Index n1y = sensor_response.nrows();
2617 const Index nmblock = sensor_pos.nrows();
2618 const Index niyb = nf * nlos * stokes_dim;
2626 y.resize(nmblock * n1y);
2627 y_f.resize(nmblock * n1y);
2628 y_pol.resize(nmblock * n1y);
2629 y_pos.resize(nmblock * n1y, sensor_pos.ncols());
2630 y_los.resize(nmblock * n1y, sensor_los.ncols());
2631 y_geo.resize(nmblock * n1y, 5);
2636 ArrayOfArrayOfVector iyb_aux_array(nmblock);
2640 Index j_analytical_do = 0;
2646 jacobian.resize(nmblock * n1y,
2647 jacobian_indices[jacobian_indices.
nelem() - 1][1] + 1);
2652 jacobian.resize(0, 0);
2660 bool failed =
false;
2663 (nf <= nmblock && nmblock >= nlos)) {
2664 out3 <<
" Parallelizing mblock loop (" << nmblock <<
" iterations)\n";
2668#pragma omp parallel for firstprivate(wss)
2669 for (Index mblock_index = 0; mblock_index < nmblock; mblock_index++) {
2671 if (failed)
continue;
2695 sensor_response_pol,
2696 sensor_response_dlos,
2701 jacobian_quantities,
2710 out3 <<
" Not parallelizing mblock loop (" << nmblock <<
" iterations)\n";
2712 for (Index mblock_index = 0; mblock_index < nmblock; mblock_index++) {
2714 if (failed)
continue;
2738 sensor_response_pol,
2739 sensor_response_dlos,
2744 jacobian_quantities,
2759 const Index nq = iyb_aux_array[0].nelem();
2762 for (Index q = 0; q < nq; q++) {
2763 y_aux[q].resize(nmblock * n1y);
2765 for (Index mblock_index = 0; mblock_index < nmblock; mblock_index++) {
2766 const Range rowind =
2768 const Index row0 = rowind.offset;
2772 if (iy_aux_vars[q] ==
"Error (uncorrelated)") {
2773 for (Index i = 0; i < n1y; i++) {
2774 const Index row = row0 + i;
2776 for (Index j = 0; j < niyb; j++) {
2778 pow(sensor_response(i, j) * iyb_aux_array[mblock_index][q][j],
2781 y_aux[q][row] = sqrt(y_aux[q][row]);
2784 mult(y_aux[q][rowind], sensor_response, iyb_aux_array[mblock_index][q]);
2797 ArrayOfVector& y_aux,
2801 const Index& atmfields_checked,
2802 const Index& atmgeom_checked,
2803 const Index& atmosphere_dim,
2805 const Index& cloudbox_on,
2806 const Index& cloudbox_checked,
2807 const Index& scat_data_checked,
2808 const Index& sensor_checked,
2809 const Index& stokes_dim,
2810 const Vector& f_grid,
2811 const Matrix& sensor_pos,
2812 const Matrix& sensor_los,
2813 const Matrix& transmitter_pos,
2814 const Matrix& mblock_dlos,
2815 const Sparse& sensor_response,
2816 const Vector& sensor_response_f,
2818 const Matrix& sensor_response_dlos,
2820 const Agenda& iy_main_agenda,
2821 const Agenda& jacobian_agenda,
2822 const Index& jacobian_do,
2825 const Index& append_instrument_wfs,
2832 jacobian_indices_copy, any_affine, jacobian_quantities_copy,
true);
2837 const Index n1 = y.nelem();
2840 "Input *y* is empty. Use *yCalc*");
2842 "Lengths of input *y* and *y_f* are inconsistent.");
2844 "Lengths of input *y* and *y_pol* are inconsistent.");
2846 "Sizes of input *y* and *y_pos* are inconsistent.");
2848 "Sizes of input *y* and *y_los* are inconsistent.");
2850 "Sizes of input *y* and *y_geo* are inconsistent.");
2852 nrq1 = jacobian_quantities_copy.
nelem();
2854 "Sizes of *y* and *jacobian* are inconsistent.");
2856 "Size of input *jacobian* and size implied "
2857 "*jacobian_quantities_copy* are inconsistent.");
2863 Matrix y_pos2, y_los2, y_geo2, jacobian2;
2865 ArrayOfVector y_aux2;
2892 sensor_response_pol,
2893 sensor_response_dlos,
2898 jacobian_quantities,
2904 "Different number of columns in *y_pos* between the measurements.");
2906 "Different number of columns in *y_los* between the measurements.");
2910 const Index n2 = y2.nelem();
2914 const Vector y1 = y, y_f1 = y_f;
2915 const Matrix y_pos1 = y_pos, y_los1 = y_los, y_geo1 = y_geo;
2917 const ArrayOfVector y_aux1 = y_aux;
2920 y[Range(0, n1)] = y1;
2921 y[Range(n1, n2)] = y2;
2923 y_f.resize(n1 + n2);
2924 y_f[Range(0, n1)] = y_f1;
2925 y_f[Range(n1, n2)] = y_f2;
2927 y_pos.resize(n1 + n2, y_pos1.ncols());
2928 y_pos(Range(0, n1), joker) = y_pos1;
2929 y_pos(Range(n1, n2), joker) = y_pos2;
2931 y_los.resize(n1 + n2, y_los1.ncols());
2932 y_los(Range(0, n1), joker) = y_los1;
2933 y_los(Range(n1, n2), joker) = y_los2;
2935 y_geo.resize(n1 + n2, y_geo1.ncols());
2936 y_geo(Range(0, n1), joker) = y_geo1;
2937 y_geo(Range(n1, n2), joker) = y_geo2;
2939 y_pol.resize(n1 + n2);
2940 for (Index i = 0; i < n1; i++) {
2941 y_pol[i] = y_pol1[i];
2943 for (Index i = 0; i < n2; i++) {
2944 y_pol[n1 + i] = y_pol2[i];
2948 const Index na1 = y_aux1.
nelem();
2949 const Index na2 = y_aux2.nelem();
2950 const Index na =
max(na1, na2);
2954 for (Index
a = 0;
a < na;
a++) {
2955 y_aux[
a].resize(n1 + n2);
2957 y_aux[
a][Range(0, n1)] = y_aux1[
a];
2959 y_aux[
a][Range(0, n1)] = 0;
2962 y_aux[
a][Range(n1, n2)] = y_aux2[
a];
2964 y_aux[
a][Range(n1, n2)] = 0;
2976 jacobian_quantities = jacobian_quantities_copy;
2977 jacobian_indices = jacobian_indices_copy;
2982 const Index nrq2 = jacobian_quantities2.
nelem();
2985 for (Index q2 = 0; q2 < nrq2; q2++) {
2990 if (jacobian_quantities2[q2].Target().isSpeciesVMR() ||
2991 jacobian_quantities2[q2] == Jacobian::Atm::Temperature ||
2992 jacobian_quantities2[q2] == Jacobian::Special::ScatteringString ||
2993 jacobian_quantities2[q2].Target().isWind() ||
2994 jacobian_quantities2[q2] == Jacobian::Special::SurfaceString ||
2995 append_instrument_wfs) {
2996 for (Index q1 = 0; q1 < nrq1; q1++ && pos < 0) {
2997 if (jacobian_quantities2[q2].Target().sameTargetType(jacobian_quantities_copy[q1].Target())) {
2998 if (jacobian_quantities2[q2].Target().isSpeciesVMR()) {
2999 if (jacobian_quantities2[q2].Subtag() ==
3000 jacobian_quantities_copy[q1].Subtag()) {
3001 if (jacobian_quantities2[q2].Mode() ==
3002 jacobian_quantities_copy[q1].Mode()) {
3006 "Jacobians for ", jacobian_quantities2[q2],
3007 " shall be appended.\nThis requires "
3008 "that the same retrieval unit is used "
3009 "but it seems that this requirement is "
3013 }
else if (jacobian_quantities2[q2] == Jacobian::Atm::Temperature) {
3014 if (jacobian_quantities2[q2].Subtag() ==
3015 jacobian_quantities_copy[q1].Subtag()) {
3019 "Jacobians for ", jacobian_quantities2[q2],
3020 " shall be appended.\nThis requires "
3021 "that HSE is either ON or OFF for both "
3022 "parts but it seems that this requirement "
3025 }
else if (jacobian_quantities[q2] == Jacobian::Special::ScatteringString) {
3026 if ((jacobian_quantities2[q2].Subtag() ==
3027 jacobian_quantities_copy[q1].Subtag()) &&
3028 (jacobian_quantities2[q2].SubSubtag() ==
3029 jacobian_quantities_copy[q1].SubSubtag())) {
3032 }
else if (jacobian_quantities2[q2].Subtag() == jacobian_quantities_copy[q1].Subtag()) {
3041 map_table[q2] = jacobian_quantities.
nelem();
3042 jacobian_quantities.push_back(jacobian_quantities2[q2]);
3044 indices[0] = jacobian_indices[jacobian_indices.
nelem() - 1][1] + 1;
3046 indices[0] + jacobian_indices2[q2][1] - jacobian_indices2[q2][0];
3047 jacobian_indices.push_back(indices);
3051 map_table[q2] = pos;
3053 ArrayOfVector grids1 = jacobian_quantities_copy[pos].Grids();
3054 ArrayOfVector grids2 = jacobian_quantities2[q2].Grids();
3055 bool any_wrong =
false;
3056 if (grids1.nelem() != grids2.nelem()) {
3059 for (Index g = 0; g < grids1.nelem(); g++) {
3060 if (grids1[g].nelem() != grids2[g].nelem()) {
3063 for (Index e = 0; e < grids1[g].nelem(); e++) {
3064 const Numeric v1 = grids1[g][e];
3065 const Numeric v2 = grids2[g][e];
3066 if ((v1 == 0 && abs(v2) > 1e-9) || abs(v1 - v2) / v1 > 1e-6) {
3075 "Jacobians for ", jacobian_quantities2[q2],
3076 " shall be appended.\nThis requires that the "
3077 "same grids are used for both measurements,\nbut "
3078 "it seems that this requirement is not met.")
3085 const Index nrq = jacobian_quantities.
nelem();
3086 const Matrix jacobian1 = jacobian;
3088 jacobian.resize(n1 + n2, jacobian_indices[nrq - 1][1] + 1);
3092 jacobian(Range(0, n1), Range(0, jacobian_indices_copy[nrq1 - 1][1] + 1)) =
3095 for (Index q2 = 0; q2 < nrq2; q2++) {
3096 jacobian(Range(n1, n2),
3097 Range(jacobian_indices[map_table[q2]][0],
3098 jacobian_indices[map_table[q2]][1] -
3099 jacobian_indices[map_table[q2]][0] + 1)) =
3102 Range(jacobian_indices2[q2][0],
3103 jacobian_indices2[q2][1] - jacobian_indices2[q2][0] + 1));
3116 "No need to use this method with *iy_unit* = \"1\".");
3119 "The spectrum vector *y* is required to have original radiance\n"
3120 "unit, but this seems not to be the case. This as a value above\n"
3121 "1e-3 is found in *y*.")
3125 const Index ny = y.nelem();
3127 const bool do_j = jacobian.nrows() == ny;
3131 "The method can not be used with jacobian quantities that are not\n"
3132 "obtained through radiative transfer calculations. One example on\n"
3133 "quantity that can not be handled is *jacobianAddPolyfit*.\n"
3134 "The maximum value of *jacobian* indicates that one or several\n"
3135 "such jacobian quantities are included.")
3139 if (iy_unit ==
"PlanckBT") {
3152 while (i0 + n < ny && y_f[i0] == y_f[i0 + n]) {
3158 bool any_quv =
false;
3160 for (Index i = 0; i < n; i++) {
3161 const Index ix = i0 + i;
3163 i_pol[i] = y_pol[ix];
3164 if (i_pol[i] > 1 && i_pol[i] < 5) {
3174 "The conversion to PlanckBT, of the Jacobian and "
3175 "errors for Q, U and V, requires that I (first Stokes "
3176 "element) is at hand and that the data are sorted in "
3177 "such way that I comes first for each frequency.")
3180 Tensor3 J(jacobian.ncols(), 1, n);
3181 J(joker, 0, joker) = transpose(jacobian(ii, joker));
3182 apply_iy_unit2(J, yv, iy_unit, ExhaustiveConstVectorView{y_f[i0]}, 1, i_pol);
3183 jacobian(ii, joker) = transpose(J(joker, 0, joker));
3187 apply_iy_unit(yv, iy_unit, ExhaustiveConstVectorView{y_f[i0]}, 1, i_pol);
3188 y[ii] = yv(0, joker);
3202 for (Index i = 0; i < ny; i++) {
3204 i_pol[0] = y_pol[i];
3209 ExhaustiveTensor3View{ExhaustiveMatrixView{jacobian(i, joker)}}, yv, iy_unit, ExhaustiveConstVectorView{y_f[i]}, 1, i_pol);
3213 apply_iy_unit(yv, iy_unit, ExhaustiveConstVectorView{y_f[i]}, 1, i_pol);
3221 const Matrix& y_geo,
3222 const Vector& sensor_response_f_grid,
3226 const Index ly = y_geo.nrows();
3227 const Index nchannel = sensor_response_f_grid.nelem();
3228 const Index lseries = ly / nchannel;
3231 "Row size of *y_geo* not an even multiple of length of *sensor_response_f_grid*.")
3233 y_geo_series.resize(lseries, y_geo.ncols());
3236 for (Index s=0; s<lseries; ++s) {
3237 y_geo_series(s, joker) = y_geo(i, joker);
3244 const Matrix& y_geo,
3245 const Vector& sensor_response_f_grid,
3246 const Index& npixel,
3250 const Index ly = y_geo.nrows();
3251 const Index nchannel = sensor_response_f_grid.nelem();
3252 const Index nswath = ly / (nchannel * npixel);
3255 "Row size of *y_geo* does not match given *npixel* and *sensor_response_f_grid*.")
3257 y_geo_swath.resize(nswath, npixel, y_geo.ncols());
3260 for (Index s=0; s<nswath; ++s) {
3261 for (Index p=0; p<npixel; ++p) {
3262 y_geo_swath(s, p, joker) = y_geo(i, joker);
3272 const Vector& sensor_response_f_grid,
3277 const Index ly = y.nelem();
3278 const Index nchannel = sensor_response_f_grid.nelem();
3279 const Index lseries = ly / nchannel;
3282 "Length of *y* not an even multiple of length of *sensor_response_f_grid*.")
3284 y_series.resize(lseries, nchannel);
3287 for (Index s=0; s<lseries; ++s) {
3288 for (Index
c=0;
c<nchannel; ++
c) {
3289 if (safe && s > 0) {
3291 "At least one channel varies in frequency.")
3293 y_series(s,
c) = y[i++];
3302 const Vector& sensor_response_f_grid,
3303 const Index& npixel,
3308 const Index ly = y.nelem();
3309 const Index nchannel = sensor_response_f_grid.nelem();
3310 const Index nswath = ly / (nchannel * npixel);
3313 "Length of *y* does not match given *npixel* and *sensor_response_f_grid*.")
3315 y_swath.resize(nswath, npixel, nchannel);
3318 for (Index s=0; s<nswath; ++s) {
3319 for (Index p=0; p<npixel; ++p) {
3320 for (Index
c=0;
c<nchannel; ++
c) {
3321 if (safe && (p > 0 || s > 0)) {
3323 "At least one channel varies in frequency.")
3325 y_swath(s, p,
c) = y[i++];
Array< Index > ArrayOfIndex
An array of Index.
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
The global header file for ARTS.
Constants of physical expressions as constexpr.
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
Header file for helper functions for OpenMP.
void gas_scattering_agendaExecute(Workspace &ws, PropagationMatrix &gas_scattering_coef, TransmissionMatrix &gas_scattering_mat, Vector &gas_scattering_fct_legendre, const Vector &f_grid, const Numeric rtp_pressure, const Numeric rtp_temperature, const Vector &rtp_vmr, const Vector &gas_scattering_los_in, const Vector &gas_scattering_los_out, const Index gas_scattering_output_type, 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 iy_loop_freqs_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const Tensor3 &iy_transmittance, const ArrayOfString &iy_aux_vars, const Index iy_id, const Vector &f_grid, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
void ppath_agendaExecute(Workspace &ws, Ppath &ppath, const Numeric ppath_lmax, const Numeric ppath_lraytrace, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index cloudbox_on, const Index ppath_inside_cloudbox_do, const Vector &f_grid, const Agenda &input_agenda)
void iy_independent_beam_approx_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const String &iy_unit, const Tensor3 &iy_transmittance, const ArrayOfString &iy_aux_vars, const Index iy_id, const Index atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &lat_true, const Vector &lon_true, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Matrix &z_surface, const Numeric ppath_lmax, const Numeric ppath_lraytrace, const Index cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Index jacobian_do, const Vector &f_grid, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
Index nelem() const ARTS_NOEXCEPT
void resize(const GriddedField4 &gf)
Make this GriddedField4 the same size as the given one.
void set_name(const String &s)
Set name of this gridded field.
void set_grid_name(Index i, const String &s)
Set grid name.
void set_grid(Index i, const Vector &g)
Set a numeric grid.
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,...)
Implementation of gridded fields.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
ArrayOfIndex get_pointers_for_analytical_species(const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSpeciesTag &abs_species)
Help function for analytical jacobian calculations.
ArrayOfTensor3 get_standard_starting_diy_dx(const ArrayOfRetrievalQuantity &jacobian_quantities, Index np, Index nf, Index ns, bool active)
Help function for analytical jacobian calculations.
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
ArrayOfTensor3 get_standard_diy_dpath(const ArrayOfRetrievalQuantity &jacobian_quantities, Index np, Index nf, Index ns, bool active)
Help function for analytical jacobian calculations.
ArrayOfIndex get_pointers_for_scat_species(const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfString &scat_species, const bool cloudbox_on)
Help function for analytical jacobian calculations.
void jac_ranges_indices(ArrayOfArrayOfIndex &jis, bool &any_affine, const ArrayOfRetrievalQuantity &jqs, const bool &before_affine)
Determines the index range inside x and the Jacobian for each retrieval quantity.
Routines for setting up the jacobian.
#define FOR_ANALYTICAL_JACOBIANS_DO2(what_to_do)
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
void MCSetSeedFromTime(Index &mc_seed, const Verbosity &)
WORKSPACE METHOD: MCSetSeedFromTime.
void MCGeneral(Workspace &ws, Vector &y, Index &mc_iteration_count, Vector &mc_error, Tensor3 &mc_points, ArrayOfIndex &mc_source_domain, ArrayOfIndex &mc_scat_order, const MCAntenna &mc_antenna, const Vector &f_grid, const Index &f_index, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &stokes_dim, const Index &atmosphere_dim, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Agenda &iy_space_agenda, const Agenda &surface_rtprop_agenda, const Agenda &propmat_clearsky_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &scat_data_checked, const Index &cloudbox_checked, const String &iy_unit, const Index &mc_seed, const Numeric &std_err, const Index &max_time, const Index &max_iter, const Index &min_iter, const Numeric &taustep_limit, const Index &l_mc_scat_order, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: MCGeneral.
void yCalcAppend(Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &y_geo, Matrix &jacobian, ArrayOfRetrievalQuantity &jacobian_quantities, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_checked, const Index &sensor_checked, 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 ArrayOfString &iy_aux_vars, const ArrayOfRetrievalQuantity &jacobian_quantities_copy, const Index &append_instrument_wfs, const Verbosity &verbosity)
WORKSPACE METHOD: yCalcAppend.
void iyLoopFrequencies(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const ArrayOfString &iy_aux_vars, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index &stokes_dim, const Vector &f_grid, const Agenda &iy_loop_freqs_agenda, const Verbosity &)
WORKSPACE METHOD: iyLoopFrequencies.
void iyApplyUnit(Matrix &iy, ArrayOfMatrix &iy_aux, const Index &stokes_dim, const Vector &f_grid, const ArrayOfString &iy_aux_vars, const String &iy_unit, const Verbosity &)
WORKSPACE METHOD: iyApplyUnit.
void iyEmissionStandard(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Vector &rte_pos2, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const String &rt_integration_option, 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 Tensor3 &iy_transmittance, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Verbosity &verbosity)
WORKSPACE METHOD: iyEmissionStandard.
void iyIndependentBeamApproximation(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, GriddedField4 &atm_fields_compact, const Index &iy_id, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &lat_true, const Vector &lon_true, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const EnergyLevelMap &nlte_field, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Matrix &particle_masses, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &iy_agenda_call1, const String &iy_unit, const Tensor3 &iy_transmittance, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index &jacobian_do, const ArrayOfString &iy_aux_vars, const Agenda &iy_independent_beam_approx_agenda, const Index &return_atm1d, const Index &skip_vmr, const Index &skip_pnd, const Index &return_masses, const Verbosity &)
WORKSPACE METHOD: iyIndependentBeamApproximation.
void iyMC(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Vector &rte_pos, const Vector &rte_los, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const Vector &refellipsoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &stokes_dim, const Vector &f_grid, const ArrayOfArrayOfSingleScatteringData &scat_data, const Agenda &iy_space_agenda, const Agenda &surface_rtprop_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Tensor4 &pnd_field, const String &iy_unit, const Numeric &mc_std_err, const Index &mc_max_time, const Index &mc_max_iter, const Index &mc_min_iter, const Numeric &mc_taustep_limit, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: iyMC.
constexpr Numeric SPEED_OF_LIGHT
void iyClearsky(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Matrix &z_surface, const Vector &refellipsoid, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &cloudbox_on, const Index &gas_scattering_do, const Index &suns_do, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Vector &rte_pos2, const ArrayOfSun &suns, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const String &rt_integration_option, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Agenda &gas_scattering_agenda, const Agenda &ppath_step_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Verbosity &verbosity)
WORKSPACE METHOD: iyClearsky.
void iyCalc(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, Vector &geo_pos, const Index &atmfields_checked, const Index &atmgeom_checked, const ArrayOfString &iy_aux_vars, const Index &iy_id, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_checked, const Vector &f_grid, const EnergyLevelMap &nlte_field, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda, const Verbosity &)
WORKSPACE METHOD: iyCalc.
void y_geo_swathFromY_geo(Tensor3 &y_geo_swath, const Matrix &y_geo, const Vector &sensor_response_f_grid, const Index &npixel, const Verbosity &)
WORKSPACE METHOD: y_geo_swathFromY_geo.
void y_geo_seriesFromY_geo(Matrix &y_geo_series, const Matrix &y_geo, const Vector &sensor_response_f_grid, const Verbosity &)
WORKSPACE METHOD: y_geo_seriesFromY_geo.
void yApplyUnit(Vector &y, Matrix &jacobian, const Vector &y_f, const ArrayOfIndex &y_pol, const String &iy_unit, const Verbosity &)
WORKSPACE METHOD: yApplyUnit.
void iyReplaceFromAux(Matrix &iy, const ArrayOfMatrix &iy_aux, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const String &aux_var, const Verbosity &)
WORKSPACE METHOD: iyReplaceFromAux.
void y_seriesFromY(Matrix &y_series, const Vector &y, const Vector &y_f, const Vector &sensor_response_f_grid, const Index &safe, const Verbosity &)
WORKSPACE METHOD: y_seriesFromY.
void ppvar_optical_depthFromPpvar_trans_cumulat(Matrix &ppvar_optical_depth, const Tensor4 &ppvar_trans_cumulat, const Verbosity &)
WORKSPACE METHOD: ppvar_optical_depthFromPpvar_trans_cumulat.
void y_swathFromY(Tensor3 &y_swath, const Vector &y, const Vector &y_f, const Vector &sensor_response_f_grid, const Index &npixel, const Index &safe, const Verbosity &)
WORKSPACE METHOD: y_swathFromY.
void iyEmissionHybrid(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_pnd, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const String &rt_integration_option, 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 Tensor3 &iy_transmittance, const Ppath &ppath, const Vector &rte_pos2, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Tensor7 &cloudbox_field, const Vector &za_grid, const Index &Naa, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: iyEmissionHybrid.
void yCalc(Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &y_geo, Matrix &jacobian, const Index &atmgeom_checked, const Index &atmfields_checked, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_checked, const Index &sensor_checked, 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 ArrayOfString &iy_aux_vars, const Verbosity &verbosity)
WORKSPACE METHOD: yCalc.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Declarations having to do with the four output streams.
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 Index GFIELD4_LAT_GRID
Global constant, Index of the latitude grid in GriddedField4.
constexpr Index GFIELD4_P_GRID
Global constant, Index of the pressure grid in GriddedField4.
constexpr Index GFIELD4_FIELD_NAMES
Global constant, Index of the field names in GriddedField4.
constexpr Index GFIELD4_LON_GRID
Global constant, Index of the longitude grid in GriddedField4.
This file contains declerations of functions of physical character.
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Propagation path structure and functions.
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 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.
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 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 get_iy_of_background(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Tensor3 &iy_transmittance, const Index &iy_id, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Vector &rte_pos2, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const String &iy_unit, const Tensor3 &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_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 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 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 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.
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 Vector &ppath_f_grid, const Vector &ppath_magnetic_field, const Vector &ppath_line_of_sight, const EnergyLevelMap &ppath_nlte, const Vector &ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const bool &jacobian_do)
Gets the clearsky propgation matrix and NLTE contributions.
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.
An Antenna object used by MCGeneral.
void set_pencil_beam()
set_pencil_beam
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.
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 lstep
The length between ppath points.
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Radiation Vector for Stokes dimension 1-4.
Class to keep track of Transmission Matrices for Stokes Dim 1-4.
void get_direct_radiation(Workspace &ws, ArrayOfMatrix &direct_radiation, ArrayOfArrayOfTensor3 &ddirect_radiation_dx, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &gas_scattering_do, const Index &irradiance_flag, const ArrayOfPpath &sun_ppaths, const ArrayOfSun &suns, const ArrayOfIndex &suns_visible, const Vector &refellipsoid, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &gas_scattering_agenda, const Numeric &rte_alonglos_v, const Verbosity &verbosity)
Calculates the transmitted sun radiation at the end position of the ppath.
void get_sun_ppaths(Workspace &ws, ArrayOfPpath &sun_ppaths, ArrayOfIndex &suns_visible, ArrayOfVector &sun_rte_los, const Vector &rte_pos, const ArrayOfSun &suns, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &z_surface, const Vector &refellipsoid, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Agenda &ppath_step_agenda, const Verbosity &verbosity)
Calculates the ppath towards the suns from a given position and indicates if sun is visible or not.
void get_scattered_sunsource(Workspace &ws, RadiationVector &scattered_sunlight, const Vector &f_grid, const Numeric &p, const Numeric &T, const Vector &vmr, const Matrix &transmitted_sunlight, const Vector &gas_scattering_los_in, const Vector &gas_scattering_los_out, const Agenda &gas_scattering_agenda)
Calculates the radiance spectrum of sun which is scattered by the atmospheric gases.
void get_sun_background(Matrix &iy, Index &suns_visible, const ArrayOfSun &suns, const Ppath &ppath, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &refellipsoid)
Gets the sun background for a given ppath.
Declaration of functions in star.cc.
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
void stepwise_source(RadiationVector &J, ArrayOfRadiationVector &dJ, RadiationVector &J_add, const PropagationMatrix &K, const StokesVector &a, const StokesVector &S, const ArrayOfPropagationMatrix &dK, const ArrayOfStokesVector &da, const ArrayOfStokesVector &dS, const ConstVectorView &B, const ConstVectorView &dB_dT, const ArrayOfRetrievalQuantity &jacobian_quantities, const bool &jacobian_do)
Set the stepwise source.
void update_radiation_vector(RadiationVector &I, ArrayOfRadiationVector &dI1, ArrayOfRadiationVector &dI2, const RadiationVector &J1, const RadiationVector &J2, const ArrayOfRadiationVector &dJ1, const ArrayOfRadiationVector &dJ2, const TransmissionMatrix &T, const TransmissionMatrix &PiT, const ArrayOfTransmissionMatrix &dT1, const ArrayOfTransmissionMatrix &dT2, const PropagationMatrix &K1, const PropagationMatrix &K2, const ArrayOfPropagationMatrix &dK1, const ArrayOfPropagationMatrix &dK2, const Numeric r, const Vector &dr1, const Vector &dr2, const Index ia, const Index iz, const RadiativeTransferSolver solver)
Update the Radiation Vector.
void stepwise_transmission(TransmissionMatrix &T, ArrayOfTransmissionMatrix &dT1, ArrayOfTransmissionMatrix &dT2, const PropagationMatrix &K1, const PropagationMatrix &K2, const ArrayOfPropagationMatrix &dK1, const ArrayOfPropagationMatrix &dK2, const Numeric &r, const Numeric &dr_dtemp1, const Numeric &dr_dtemp2, const Index temp_deriv_pos)
Set the stepwise transmission matrix.
Stuff related to the transmission matrix.
Array< RadiationVector > ArrayOfRadiationVector
Array< TransmissionMatrix > ArrayOfTransmissionMatrix