Go to the documentation of this file.
66 const Numeric& ppath_temperature,
81 for (
Index i = 0; i < nq; i++) {
86 switch (jacobian_wind[i]) {
87 case Index(JacobianType::AbsWind):
90 case Index(JacobianType::WindFieldU):
93 case Index(JacobianType::WindFieldV):
96 case Index(JacobianType::WindFieldW):
102 if (component not_eq -1) {
110 if (not lte) dS_dx[i] *= a;
111 }
else if (jacobian_species[i] > -1) {
112 const bool from_propmat =
114 const Index& isp = jacobian_species[i];
120 if (not from_propmat) {
123 factor,
"vmr", ppath_vmrs[isp], ppath_pressure, ppath_temperature);
127 factor,
"vmr", ppath_vmrs[isp], ppath_pressure, ppath_temperature);
133 if (not lte) dS_dx[i] *= factor;
144 }
else if (los[0] > 180) {
145 los[0] = 360 - los[0];
149 los[0] = los[0] + 360;
150 }
else if (los[0] > 180) {
151 los[0] = los[0] - 360;
155 if (
abs(los[0] - 90) > 90 ||
abs(los[1]) > 180) {
174 assert(
f_grid.nelem() == nf);
184 for (
Index iv = 0; iv < nf; iv++) {
186 for (
Index is = 0; is <
ns; is++) {
192 iy(iv, is) *= 2 * scfac;
198 else if (
iy_unit ==
"PlanckBT") {
199 for (
Index iv = 0; iv < nf; iv++) {
200 for (
Index is =
ns - 1; is >= 0; is--)
202 if (i_pol[is] == 1) {
204 }
else if (i_pol[is] < 5) {
205 assert(i_pol[0] == 1);
215 else if (
iy_unit ==
"W/(m^2 m sr)") {
216 for (
Index iv = 0; iv < nf; iv++) {
218 for (
Index is = 0; is <
ns; is++) {
224 else if (
iy_unit ==
"W/(m^2 m-1 sr)") {
230 os <<
"Unknown option: iy_unit = \"" <<
iy_unit <<
"\"\n"
231 <<
"Recognised choices are: \"1\", \"RJBT\", \"PlanckBT\""
232 <<
"\"W/(m^2 m sr)\" and \"W/(m^2 m-1 sr)\"";
234 throw runtime_error(os.str());
251 assert(J.
nrows() == nf);
253 assert(
f_grid.nelem() == nf);
263 for (
Index iv = 0; iv < nf; iv++) {
265 for (
Index is = 0; is <
ns; is++) {
268 for (
Index ip = 0; ip < np; ip++) {
269 J(ip, iv, is) *= scfac;
273 for (
Index ip = 0; ip < np; ip++) {
274 J(ip, iv, is) *= 2 * scfac;
281 else if (
iy_unit ==
"PlanckBT") {
283 for (
Index is =
ns - 1; is >= 0; is--) {
285 if (i_pol[is] == 1) {
287 }
else if (i_pol[is] < 5) {
288 assert(i_pol[0] == 1);
295 for (
Index ip = 0; ip < np; ip++) {
296 J(ip, iv, is) *= scfac;
302 else if (
iy_unit ==
"W/(m^2 m sr)") {
303 for (
Index iv = 0; iv < nf; iv++) {
305 for (
Index ip = 0; ip < np; ip++) {
306 for (
Index is = 0; is <
ns; is++) {
307 J(ip, iv, is) *= scfac;
313 else if (
iy_unit ==
"W/(m^2 m-1 sr)") {
319 os <<
"Unknown option: iy_unit = \"" <<
iy_unit <<
"\"\n"
320 <<
"Recognised choices are: \"1\", \"RJBT\", \"PlanckBT\""
321 <<
"\"W/(m^2 m sr)\" and \"W/(m^2 m-1 sr)\"";
323 throw runtime_error(os.str());
339 alpha =
ppath.start_los[0] -
ppath.end_los[0] + theta;
392 bool invert_lat =
false;
429 for (
Index i = 1; i <= ilast; i++) {
431 lox[i - 1] + ppx.
lstep[i - 1] * (ppx.
nreal[i - 1] + ppx.
nreal[i]) / 2.0;
437 if (lox[ilast] < lo0) {
438 const Numeric dl = lo0 - lox[ilast];
442 x, z,
dx, dz, ppx.
r[ilast], ppx.
pos(ilast, 1), ppx.
los(ilast, 0));
482 pos[0] =
interp(itw, ppx.
r, gp);
514 lp +=
ppath.lstep[i];
579 if (backg1 == backg2) {
582 distance2D(l12, pos1[0], pos1[1], pos2[0], pos2[1]);
584 distance3D(l12, pos1[0], pos1[1], pos1[2], pos2[0], pos2[1], pos2[2]);
587 dlf = lp * 2 *
DEG2RAD * dza / l12;
601 r +
ppath.end_pos[0],
609 dlf = lp *
DEG2RAD * dza / l12;
629 if (
ppath.end_los[0] < 90 ||
ppath.start_los[0] > 90)
631 "The function *defocusing_sat2sat* can only be used "
632 "for limb sounding geometry.");
642 lt +=
ppath.lstep[i];
644 for (
Index i = 0; i < it; i++) {
645 lr +=
ppath.lstep[i];
655 const Numeric lf = lr * lt / (lr + lt);
718 dada = (alpha2 - alpha1) / (
a2 -
a1);
720 dada = (alpha2 - alpha0) / (
a2 - a0);
724 const Numeric zlt = 1 / (1 - dada * lf);
740 const Numeric aa_f = atan2(u, v);
748 return f * (cos(za_f) * cos(za_p) + sin(za_f) * sin(za_p) * cos(aa_f - aa_p));
790 }
else if (
ext_mat(3, 2) != 0) {
814 assert(icase >= 0 && icase <= 3);
824 trans_mat(0, 0) = exp(-
ext_mat(0, 0) * lstep);
826 trans_mat(i, i) = trans_mat(0, 0);
835 trans_mat(0, 0) = tI * cosh(HQ);
836 trans_mat(1, 1) = trans_mat(0, 0);
837 trans_mat(1, 0) = -tI * sinh(HQ);
838 trans_mat(0, 1) = trans_mat(1, 0);
862 ext_mat_ds *= -lstep;
869 trans_mat, ext_mat_ds);
956 out3 <<
"Radiative background: " <<
ppath.background <<
"\n";
965 agenda_name =
"iy_space_agenda";
972 agenda_name =
"iy_surface_agenda";
1013 agenda_name =
"iy_cloudbox_agenda";
1026 os <<
"The size of *iy* returned from *" << agenda_name <<
"* is\n"
1028 <<
" expected size = [" << nf <<
"," <<
stokes_dim <<
"]\n"
1029 <<
" size of iy = [" <<
iy.nrows() <<
"," <<
iy.ncols() <<
"]\n";
1030 throw runtime_error(os.str());
1075 for (
Index is = 0; is <
ns; is++) {
1089 ppath_wind.
resize(3, np);
1168 bool any_dpnd =
false;
1171 ppath_dpnd_dx[iq].resize(0, 0);
1174 ppath_dpnd_dx[iq].resize(
pnd_field.nbooks(), np);
1180 clear2cloudy.resize(np);
1184 for (
Index ip = 0; ip < np; ip++)
1221 bool any_ppath_dpnd =
false;
1238 if (
max(ppath_dpnd_dx[iq](
joker, ip)) > 0. ||
1239 min(ppath_dpnd_dx[iq](
joker, ip)) < 0.)
1240 any_ppath_dpnd =
true;
1246 clear2cloudy[ip] = nin;
1249 clear2cloudy[ip] = -1;
1252 clear2cloudy[ip] = -1;
1271 for (
Index ip = 0; ip < np; ip++) {
1276 if (ppath_wind(1, ip) != 0 || ppath_wind(0, ip) != 0 ||
1277 ppath_wind(2, ip) != 0) {
1288 if (v_doppler == 0) {
1294 for (
Index iv = 0; iv < nf; iv++) {
1295 ppath_f(iv, ip) = a *
f_grid[iv];
1310 const Numeric& ppath_temperature,
1311 const bool& do_temperature_derivative) {
1314 for (
Index i = 0; i < nf; i++)
1315 B[i] =
planck(ppath_f_grid[i], ppath_temperature);
1317 if (do_temperature_derivative)
1318 for (
Index i = 0; i < nf; i++)
1319 dB_dT[i] =
dplanck_dt(ppath_f_grid[i], ppath_temperature);
1336 const Numeric& ppath_temperature,
1337 const Numeric& ppath_pressure,
1356 ppath_magnetic_field,
1357 ppath_line_of_sight,
1385 for (
Index i = 0; i < nq; i++) {
1398 dS_dx[i] += nlte_dx_dsource_dx[j];
1406 }
else if (jacobian_species[i] > -1)
1417 os <<
"We do not yet support species"
1418 <<
" tag and NLTE Jacobians.\n";
1419 throw std::runtime_error(os.str());
1445 for (
Index i1 = 0; i1 < nf; i1++) {
1473 for (
Index iq = 0; iq < nq; iq++) {
1487 dK_dx[iq].MatrixAtPosition(dk, i1);
1490 dj = da_dx[iq].VectorAtPosition(i1);
1504 dj += dS_dx[iq].VectorAtPosition(i1);
1518 if (nq) dJ_dx *= 0.5;
1529 if (ppath_wind[0] not_eq 0 or ppath_wind[1] not_eq 0 or
1530 ppath_wind[2] not_eq 0)
1538 if (v_doppler not_eq 0) ppath_f_grid *= 1 - v_doppler /
SPEED_OF_LIGHT;
1542 const Index& component,
1559 switch (component) {
1561 dv_doppler_dx = 1.0;
1576 throw std::runtime_error(
1577 "This being seen means that there is a development bug in interactions with get_ppath_df_dW.\n");
1582 if (dv_doppler_dx == 0.0) {
1600 const Index ppath_1p_id,
1617 Matrix dir_array(1, 2, 0.);
1618 dir_array(0,
joker) = dir;
1663 for (
Index iv = 0; iv < nf; iv++) {
1675 if (ppath_dpnd_dx[iq].empty()) {
1676 dap_dx[iq].SetZero();
1677 dKp_dx[iq].SetZero();
1687 ppath_dpnd_dx[iq](
joker,
Range(ppath_1p_id, 1)),
1695 for (
Index iv = 0; iv < nf; iv++) {
1697 dap_dx[iq].SetAtPosition(abs_vec_bulk(iv, 0, 0,
joker), iv);
1698 dKp_dx[iq].SetAtPosition(ext_mat_bulk(iv, 0, 0,
joker,
joker),
1701 dap_dx[iq].SetAtPosition(abs_vec_bulk(0, 0, 0,
joker), iv);
1702 dKp_dx[iq].SetAtPosition(ext_mat_bulk(0, 0, 0,
joker,
joker), iv);
1715 const Index ppath_1p_id,
1721 const GridPos& ppath_pressure,
1722 const Vector& temperature,
1725 const Index& t_interp_order) {
1727 throw runtime_error(
"This function handles so far only 1D atmospheres.");
1744 for (
Index iv = 0; iv < nf; iv++) {
1745 for (
Index iza = 0; iza < nza; iza++) {
1747 inc_field(iv, iza, i) =
1755 Matrix idir(nza * naa, 2);
1757 for (
Index iza = 0; iza < nza; iza++) {
1758 for (
Index iaa = 0; iaa < naa; iaa++) {
1771 pdir(0, 0) = ppath_line_of_sight(0, 0);
1777 Index duplicate_freqs = ((nf == nf_ssd) ? 0 : 1);
1789 if (ppath_1p_pnd[ise_flat] != 0) {
1792 for (
Index iq = 0; (!val_pnd) && (iq < nq); iq++) {
1794 !ppath_dpnd_dx[iq].empty() &&
1795 ppath_dpnd_dx[iq](ise_flat, ppath_1p_id) != 0) {
1813 os <<
"Interpolation error for (flat-array) scattering "
1814 <<
"element #" << ise_flat <<
"\n"
1815 <<
"at location/temperature point #" << ppath_1p_id <<
"\n";
1816 throw runtime_error(os.str());
1820 for (
Index iv = 0; iv < nf; iv++) {
1821 if (!duplicate_freqs) {
1827 for (
Index iza = 0; iza < nza; iza++) {
1828 for (
Index iaa = 0; iaa < naa; iaa++) {
1831 product_fields(iza, iaa, i) +=
1832 pha_mat_1se(this_iv, 0, 0, ia, i, j) *
1833 inc_field(iv, iza, j);
1852 for (
Index iv = 0; iv < nf; iv++) {
1854 for (ise_flat = 0; ise_flat < ne; ise_flat++) {
1857 scat_source_1se(ise_flat, iv, i) * ppath_1p_pnd[ise_flat];
1865 if (ppath_dpnd_dx[iq].empty()) { dSp_dx[iq].SetZero(); }
else {
1867 for (ise_flat = 0; ise_flat < ne; ise_flat++) {
1869 scat_source[i] += scat_source_1se(ise_flat, iv, i) *
1870 ppath_dpnd_dx[iq](ise_flat, ppath_1p_id);
1871 dSp_dx[iq].SetAtPosition(scat_source, iv);
1889 const Numeric& ppath_distance,
1890 const bool& first_level,
1891 const Numeric& dppath_distance_dT_HSE_close,
1892 const Numeric& dppath_distance_dT_HSE_far,
1893 const Index& temperature_derivative_position_if_hse_is_active) {
1900 for (
Index iv = 0; iv < nf; iv++)
1906 if (not dK_close_dx.
nelem())
1918 dppath_distance_dT_HSE_close,
1919 dppath_distance_dT_HSE_far,
1920 temperature_derivative_position_if_hse_is_active);
1924 for (
Index iv = 0; iv < nf; iv++)
1926 cumulative_transmission_close(iv,
joker,
joker),
1953 const Index& j_analytical_do,
2023 if (j_analytical_do) {
2026 ip < jacobian_indices[iq][1] - jacobian_indices[iq][0] + 1;
2042 catch (
const std::exception& e) {
2043 #pragma omp critical(iyb_calc_fail)
2045 fail_msg = e.what();
2069 const Index& j_analytical_do,
2084 if (j_analytical_do) {
2085 diyb_dx.resize(jacobian_indices.
nelem());
2087 niyb, jacobian_indices[iq][1] - jacobian_indices[iq][0] + 1);)
2092 geo_pos_matrix.
resize(nlos, 5);
2093 geo_pos_matrix = NAN;
2106 bool failed =
false;
2108 out3 <<
" Parallelizing los loop (" << nlos <<
" iterations, " << nf
2109 <<
" frequencies)\n";
2112 #pragma omp parallel for if (!arts_omp_in_parallel()) \
2113 firstprivate(l_ws, l_iy_main_agenda, l_geo_pos_agenda)
2114 for (
Index ilos = 0; ilos < nlos; ilos++) {
2116 if (failed)
continue;
2146 if (failed)
continue;
2154 throw runtime_error(
2155 "Wrong size of *geo_pos* obtained from *geo_pos_agenda*.\n"
2156 "The length of *geo_pos* must be zero or five.");
2160 }
catch (
const std::exception& e) {
2161 #pragma omp critical(iyb_calc_fail)
2163 fail_msg = e.what();
2169 out3 <<
" Not parallelizing los loop (" << nlos <<
" iterations, " << nf
2170 <<
" frequencies)\n";
2172 for (
Index ilos = 0; ilos < nlos; ilos++) {
2174 if (failed)
continue;
2204 if (failed)
continue;
2212 throw runtime_error(
2213 "Wrong size of *geo_pos* obtained from *geo_pos_agenda*.\n"
2214 "The length of *geo_pos* must be zero or five.");
2218 }
catch (
const std::exception& e) {
2219 #pragma omp critical(iyb_calc_fail)
2221 fail_msg = e.what();
2229 throw runtime_error(
"Run-time error in function: iyb_calc\n" + fail_msg);
2237 iyb_aux[
q].resize(niyb);
2239 for (
Index ilos = 0; ilos < nlos; ilos++) {
2241 for (
Index iv = 0; iv < nf; iv++) {
2246 iyb_aux[
q][row1 + is] = iy_aux_array[ilos][
q](i1, i2);
2259 assert(
ns == iy_trans_old.
nrows());
2260 assert(nf == iy_trans_new.
npages());
2261 assert(
ns == iy_trans_new.
nrows());
2262 assert(
ns == iy_trans_new.
ncols());
2266 for (
Index iv = 0; iv < nf; iv++) {
2279 assert(
ns == iy_trans.
nrows());
2280 assert(nf == iy_old.
nrows());
2285 for (
Index iv = 0; iv < nf; iv++) {
2296 los_mirrored[0] = 180 - los[0];
2297 los_mirrored[1] = 180;
2299 los_mirrored[0] = 180 - fabs(los[0]);
2301 los_mirrored[1] = 180;
2303 los_mirrored[1] = 0;
2306 los_mirrored[0] = 180 - los[0];
2307 los_mirrored[1] = los[1] + 180;
2308 if (los_mirrored[1] > 180) {
2309 los_mirrored[1] -= 360;
2367 const bool is_active) {
2368 const Index nn = is_active ? nf * np : nf;
2371 diy_dpath[iq] = 0.0;)
2387 :
Index(JacobianType::None);
2389 if (jac_scat_i[iq] + 1) {
2391 throw runtime_error(
2392 "*dpnd_field_dx* not allowed to be empty for "
2393 "scattering Jacobian species.");
2398 throw runtime_error(
2399 "*dpnd_field_dx* must be empty for "
2400 "non-scattering Jacobian species.");
2411 jacobian_indices[iq][1] - jacobian_indices[iq][0] + 1, nn,
ns);
2439 Y.
resize(
ns, diy_dpath[iq].npages());
2440 for (
Index iv = 0; iv < nf; iv++) {
2462 for (
Index ip = 0; ip < np; ip++) {
2469 for (
Index ip = 0; ip < np; ip++) {
2480 for (
Index ip = 0; ip < np; ip++) {
2504 if (jac_is_t[iq] !=
Index(JacobianType::None)) {
2509 for (
Index ip = 0; ip < np; ip++) {
2511 ddterm *=
ppvar_vmr(jac_species_i[ia], ip) *
2520 if (water_p_eq.
npages() == 0) {
2526 t_data(
joker, 0, 0) += 1;
2530 for (
Index ip = 0; ip < np; ip++) {
2531 const Numeric p_eq = water_p_eq(ip, 0, 0);
2532 const Numeric p_eq1K = water_p_eq1K(ip, 0, 0);
2534 ddterm *=
ppvar_vmr(jac_species_i[ia], ip) *
2535 (
ppvar_p[ip] /
pow(p_eq, 2.0)) * (p_eq1K - p_eq);
2562 const Index& j_analytical_do,
2567 if (
ppath.end_lstep == 0)
2569 n =
ppath.nreal[np - 1];
2574 for (
Index is = 0; is <
ns; is++) {
2580 if (j_analytical_do) {
2630 const Index& j_analytical_do) {
2673 for (
Index i = 0; i < n1y; i++) {
2674 const Index ii = row0 + i;
2675 if (std::isnan(
y[ii]))
2676 throw runtime_error(
"One or several NaNs found in *y*.");
2690 if (j_analytical_do) {
2693 Range(jacobian_indices[iq][0],
2694 jacobian_indices[iq][1] -
2695 jacobian_indices[iq][0] + 1)),
2708 if (!std::isnan(geo_pos_matrix(0, 0)))
2712 for (
Index i = 0; i < n1y; i++) {
2727 catch (
const std::exception& e) {
2728 #pragma omp critical(yCalc_fail)
2730 fail_msg = e.what();
2742 assert(
fac.nelem() == nf);
2753 for (
Index iv = 0; iv < nf; iv++) {
2759 Complex n(complex_n(iv, 0), complex_n(iv, 1));
2769 fac[iv] = a * la * la * la * la / K2;
Matrix y_pos(Workspace &ws) noexcept
Index atmosphere_dim(Workspace &ws) noexcept
std::size_t pos() const noexcept
Tensor3 wind_v_field(Workspace &ws) noexcept
void adapt_stepwise_partial_derivatives(ArrayOfPropagationMatrix &dK_dx, ArrayOfStokesVector &dS_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstVectorView ppath_f_grid, ConstVectorView ppath_line_of_sight, ConstVectorView ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const ArrayOfIndex &jacobian_species, const ArrayOfIndex &jacobian_wind, const Index <e, const Index &atmosphere_dim, const bool &jacobian_do)
Adapts clearsky partial derivatives.
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.
const Numeric SPEED_OF_LIGHT
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
Vector geo_pos(Workspace &ws) noexcept
Tensor3 z_field(Workspace &ws) noexcept
const String SURFACE_MAINTAG
void geo_pos_agendaExecute(Workspace &ws, Vector &geo_pos, const Ppath &ppath, const Agenda &input_agenda)
Vector rtp_los(Workspace &ws) noexcept
Numeric fac(const Index n)
fac
Stokes vector is as Propagation matrix but only has 4 possible values.
Agenda ppath_step_agenda(Workspace &ws) noexcept
const String PROPMAT_SUBSUBTAG
Numeric lat(Workspace &ws) noexcept
void bending_angle1d(Numeric &alpha, const Ppath &ppath)
Calculates the bending angle for a 1D atmosphere.
Agenda iy_cloudbox_agenda(Workspace &ws) noexcept
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
bool IsEmpty() const
Asks if the class is empty.
void iyb_calc_body(bool &failed, String &fail_msg, ArrayOfArrayOfMatrix &iy_aux_array, Workspace &ws, Ppath &ppath, Vector &iyb, ArrayOfMatrix &diyb_dx, const Index &mblock_index, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, ConstMatrixView sensor_pos, ConstMatrixView sensor_los, ConstMatrixView transmitter_pos, ConstMatrixView mblock_dlos_grid, const String &iy_unit, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, ConstVectorView f_grid, const ArrayOfString &iy_aux_vars, const Index &ilos, const Index &nf)
void iy_space_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Numeric lo(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Complex w(Complex z) noexcept
The Faddeeva function.
void get_stepwise_frequency_grid(VectorView ppath_f_grid, ConstVectorView f_grid, ConstVectorView ppath_wind, ConstVectorView ppath_line_of_sight, const Numeric &rte_alonglos_v, const Index &atmosphere_dim)
Inverse of get_stepwise_f_partials.
Matrix transmitter_pos(Workspace &ws) noexcept
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
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_grid, 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 &geo_pos_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 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 id_mat(MatrixView I)
Identity Matrix.
Matrix ppvar_vmr(Workspace &ws) noexcept
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
Tensor3 iy_transmission(Workspace &ws) noexcept
Sparse sensor_response(Workspace &ws) noexcept
void apply_iy_unit2(Tensor3View J, ConstMatrixView iy, const String &iy_unit, ConstVectorView f_grid, const Numeric &n, const ArrayOfIndex &i_pol)
Largely as apply_iy_unit but operates on jacobian data.
Vector lat_grid(Workspace &ws) noexcept
A constant view of a Tensor7.
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_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.
Tensor4 pnd_field(Workspace &ws) noexcept
Index iy_id(Workspace &ws) noexcept
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Numeric dplanck_dt(const Numeric &f, const Numeric &t)
dplanck_dt
Verbosity verbosity(Workspace &ws) noexcept
Numeric sphdist(const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
sphdist
ArrayOfArrayOfSingleScatteringData scat_data_mono(Workspace &ws) noexcept
ArrayOfStokesVector dnlte_dx_source(Workspace &ws) noexcept
void MatrixInverseAtPosition(MatrixView ret, const Index iv=0, const Index iz=0, const Index ia=0) const
Return the matrix inverse at the position.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
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.
Tensor3 ppvar_iy(Workspace &ws) noexcept
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion between gas species units.
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
Index jacobian_do(Workspace &ws) noexcept
Numeric dinvplanckdI(const Numeric &i, const Numeric &f)
dinvplanckdI
Numeric end_lstep
The distance between end pos and the first position in pos.
Tensor3 wind_u_field(Workspace &ws) noexcept
Vector y(Workspace &ws) noexcept
void resize(Index n)
Resize function.
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
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.
Matrix y_los(Workspace &ws) noexcept
bool is_singular(ConstMatrixView A)
Checks if a square matrix is singular.
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 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.
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
Tensor3 mag_w_field(Workspace &ws) noexcept
bool IsRotational(const Index iv=0, const Index iz=0, const Index ia=0) const
False if diagonal element is non-zero in internal Matrix representation.
Index stokes_dim(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
String iy_unit(Workspace &ws) noexcept
const Numeric DEG2RAD
Global constant, conversion from degrees to radians.
Matrix iy(Workspace &ws) noexcept
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
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
std::complex< Numeric > Complex
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
void compute_transmission_matrix(Tensor3View T, const Numeric &r, const PropagationMatrix &upper_level, const PropagationMatrix &lower_level, const Index iz, const Index ia)
Compute the matrix exponent as the transmission matrix of this propagation matrix.
void matrix_exp(MatrixView F, ConstMatrixView A, const Index &q)
General exponential of a Matrix.
Agenda iy_space_agenda(Workspace &ws) noexcept
The structure to describe a propagation path and releated quantities.
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 resize(Index p, Index r, Index c)
Resize function.
Numeric lon(Workspace &ws) noexcept
ArrayOfString dsurface_names(Workspace &ws) noexcept
Numeric sqrt(const Rational r)
Square root.
void dxdvmrscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion of derivatives with respect to VMR.
Index npages() const
Returns the number of pages.
void rtmethods_jacobian_init(ArrayOfIndex &jac_species_i, ArrayOfIndex &jac_scat_i, ArrayOfIndex &jac_is_t, ArrayOfIndex &jac_wind_i, ArrayOfIndex &jac_mag_i, ArrayOfIndex &jac_other, ArrayOfTensor3 &diy_dx, ArrayOfTensor3 &diy_dpath, const Index &ns, const Index &nf, const Index &np, const Index &nq, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const ArrayOfString &scat_species, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &iy_agenda_call1, const bool is_active)
This function fixes the initial steps around Jacobian calculations, to be done inside radiative trans...
constexpr Index get_start() const
Returns the start index of the range.
Vector lon_true(Workspace &ws) noexcept
void get_stepwise_scattersky_propmat(StokesVector &ap, PropagationMatrix &Kp, ArrayOfStokesVector &dap_dx, ArrayOfPropagationMatrix &dKp_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstMatrixView ppath_1p_pnd, const ArrayOfMatrix &ppath_dpnd_dx, const Index ppath_1p_id, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstVectorView ppath_line_of_sight, ConstVectorView ppath_temperature, const Index &atmosphere_dim, const bool &jacobian_do)
Computes the contribution by scattering at propagation path point.
A constant view of a Tensor4.
Numeric invrayjean(const Numeric &i, const Numeric &f)
invrayjean
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 rte_alonglos_v(Workspace &ws) noexcept
EnergyLevelMap nlte_field(Workspace &ws) noexcept
This can be used to make arrays out of anything.
Numeric pow(const Rational base, Numeric exp)
Power of.
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
Vector sensor_response_f(Workspace &ws) noexcept
void cart2pol(Numeric &r, Numeric &lat, const Numeric &x, const Numeric &z, const Numeric &lat0, const Numeric &za0)
cart2pol
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, ConstVectorView ppath_f_grid, ConstVectorView ppath_magnetic_field, ConstVectorView ppath_line_of_sight, const EnergyLevelMap &ppath_nlte, ConstVectorView ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const ArrayOfIndex &jacobian_species, const bool &jacobian_do)
Gets the clearsky propgation matrix and NLTE contributions.
void get_stepwise_effective_source(MatrixView J, Tensor3View dJ_dx, const PropagationMatrix &K, const StokesVector &a, const StokesVector &S, const ArrayOfPropagationMatrix &dK_dx, const ArrayOfStokesVector &da_dx, const ArrayOfStokesVector &dS_dx, ConstVectorView B, ConstVectorView dB_dT, const ArrayOfRetrievalQuantity &jacobian_quantities, const bool &jacobian_do)
Gets the effective source at propagation path point.
Vector rte_pos(Workspace &ws) noexcept
Vector y_f(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
ArrayOfIndex y_pol(Workspace &ws) noexcept
Matrix los
Line-of-sight at each ppath point.
ArrayOfStokesVector nlte_source(Workspace &ws) noexcept
Index np
Number of points describing the ppath.
Index nelem() const
Returns the number of elements.
Array< Index > ArrayOfIndex
An array of Index.
void iy_cloudbox_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Tensor4 vmr_field(Workspace &ws) noexcept
Vector rte_los(Workspace &ws) noexcept
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Vector ppvar_t(Workspace &ws) noexcept
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, ConstVectorView p_grid, ConstTensor3View t_field, const EnergyLevelMap &nlte_field, ConstTensor4View vmr_field, ConstTensor3View wind_u_field, ConstTensor3View wind_v_field, ConstTensor3View wind_w_field, ConstTensor3View mag_u_field, ConstTensor3View mag_v_field, ConstTensor3View mag_w_field)
Determines pressure, temperature, VMR, winds and magnetic field for each propgataion path point.
Vector p_grid(Workspace &ws) noexcept
Ppath ppath(Workspace &ws) noexcept
Index NumberOfFrequencies() const
The number of frequencies of the propagation matrix.
ArrayOfMatrix dsurface_emission_dx(Workspace &ws) noexcept
Tensor3 surface_props_data(Workspace &ws) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
Vector iyb(Workspace &ws) noexcept
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, ConstVectorView f_grid, ConstMatrixView sensor_pos, ConstMatrixView sensor_los, ConstMatrixView transmitter_pos, ConstMatrixView mblock_dlos_grid, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &geo_pos_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 propmat_clearsky_agendaExecute(Workspace &ws, ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, 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)
Index iy_agenda_call1(Workspace &ws) noexcept
Index nbooks() const
Returns the number of books.
Numeric invplanck(const Numeric &i, const Numeric &f)
invplanck
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.
Vector lstep
The length between ppath points.
Vector refellipsoid(Workspace &ws) noexcept
ArrayOfString iy_aux_vars(Workspace &ws) noexcept
void zaaa2cart(Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa)
Converts zenith and azimuth angles to a cartesian unit vector.
Vector f_grid(Workspace &ws) noexcept
void get_stepwise_scattersky_source(StokesVector &Sp, ArrayOfStokesVector &dSp_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstVectorView ppath_1p_pnd, const ArrayOfMatrix &ppath_dpnd_dx, const Index ppath_1p_id, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstTensor7View cloudbox_field, ConstVectorView za_grid, ConstVectorView aa_grid, 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.
Vector lat_true(Workspace &ws) noexcept
Matrix sensor_pos(Workspace &ws) noexcept
PropagationMatrix ext_mat(Workspace &ws) noexcept
void defocusing_sat2sat(Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView f_grid, ConstVectorView refellipsoid, 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.
ArrayOfArrayOfSingleScatteringData scat_data(Workspace &ws) noexcept
void resize(Index r, Index c)
Resize function.
Numeric AngIntegrate_trapezoid(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
AngIntegrate_trapezoid.
const String SCATSPECIES_MAINTAG
Vector za_grid(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
Vector nreal
The real part of the refractive index at each path position.
Vector lon_grid(Workspace &ws) noexcept
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true, ConstVectorView pos)
Determines the true alt and lon for an "ARTS position".
ArrayOfTensor4 dpnd_field_dx(Workspace &ws) noexcept
Numeric ppath_lmax(Workspace &ws) noexcept
A constant view of a Matrix.
Numeric ppath_lraytrace(Workspace &ws) noexcept
Agenda iy_surface_agenda(Workspace &ws) noexcept
Index nrows(Workspace &ws) noexcept
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
void SetZero()
Sets all data to zero.
void water_p_eq_agendaExecute(Workspace &ws, Tensor3 &water_p_eq_field, const Tensor3 &t_field, const Agenda &input_agenda)
Numeric planck(const Numeric &f, const Numeric &t)
planck
Matrix mblock_dlos_grid(Workspace &ws) noexcept
ArrayOfIndex sensor_response_pol(Workspace &ws) noexcept
void get_stepwise_f_partials(Vector &f_partials, const Index &component, ConstVectorView &line_of_sight, ConstVectorView f_grid, const Index &atmosphere_dim)
Computes the ratio that a partial derivative with regards to frequency relates to the wind of come co...
Structure to store a grid position.
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.
#define FOR_ANALYTICAL_JACOBIANS_DO2(what_to_do)
Propagation path structure and functions.
void apply_iy_unit(MatrixView iy, const String &iy_unit, 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 ...
ArrayOfMatrix iy_aux(Workspace &ws) noexcept
Agenda geo_pos_agenda(Workspace &ws) noexcept
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
ArrayOfPropagationMatrix dpropmat_clearsky_dx(Workspace &ws) noexcept
Numeric constant
The propagation path constant (only used for 1D)
Header file for logic.cc.
Agenda iy_main_agenda(Workspace &ws) noexcept
Vector rte_pos2(Workspace &ws) noexcept
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 mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
Index StokesDimensions() const
The stokes dimension of the propagation matrix.
Index ncols() const
Returns the number of columns.
void iy_transmission_mult(Tensor3 &iy_trans_total, ConstTensor3View iy_trans_old, ConstTensor3View iy_trans_new)
Multiplicates iy_transmission with transmissions.
Numeric dotprod_with_los(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.
Vector yb(Workspace &ws) noexcept
Declaration of functions in rte.cc.
void ext2trans(MatrixView trans_mat, Index &icase, ConstMatrixView ext_mat, const Numeric &lstep)
Converts an extinction matrix to a transmission matrix.
Tensor3 mag_v_field(Workspace &ws) noexcept
Tensor3 t_field(Workspace &ws) noexcept
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 get_iy(Workspace &ws, Matrix &iy, const Index &cloudbox_on, ConstVectorView f_grid, const EnergyLevelMap &nlte_field, ConstVectorView rte_pos, ConstVectorView rte_los, ConstVectorView rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda)
Basic call of iy_main_agenda.
A constant view of a Tensor3.
Vector r
Radius of each ppath point.
void defocusing_general(Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView f_grid, ConstVectorView refellipsoid, 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)
Header file for special_interp.cc.
Index equivalent_propmattype_index(const ArrayOfRetrievalQuantity &js, const Index i) noexcept
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Tensor3 wind_w_field(Workspace &ws) noexcept
void compute_transmission_matrix_and_derivative(Tensor3View T, Tensor4View dT_dx_upper_level, Tensor4View dT_dx_lower_level, const Numeric &r, const PropagationMatrix &upper_level, const PropagationMatrix &lower_level, const ArrayOfPropagationMatrix &dupper_level_dx, const ArrayOfPropagationMatrix &dlower_level_dx, const Numeric &dr_dTu, const Numeric &dr_dTl, const Index it, const Index iz, const Index ia)
void poslos2cart(Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za)
poslos2cart
Tensor7 cloudbox_field(Workspace &ws) noexcept
void get_stepwise_transmission_matrix(Tensor3View cumulative_transmission, Tensor3View T, Tensor4View dT_close_dx, Tensor4View dT_far_dx, ConstTensor3View cumulative_transmission_close, const PropagationMatrix &K_close, const PropagationMatrix &K_far, const ArrayOfPropagationMatrix &dK_close_dx, const ArrayOfPropagationMatrix &dK_far_dx, const Numeric &ppath_distance, const bool &first_level, const Numeric &dppath_distance_dT_HSE_close, const Numeric &dppath_distance_dT_HSE_far, const Index &temperature_derivative_position_if_hse_is_active)
Computes layer transmission matrix and cumulative transmission.
void jacobian_agendaExecute(Workspace &ws, Matrix &jacobian, const Index mblock_index, const Vector &iyb, const Vector &yb, const Agenda &input_agenda)
Agenda propmat_clearsky_agenda(Workspace &ws) noexcept
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_transmission, const Agenda &water_p_eq_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex jac_species_i, const ArrayOfIndex jac_is_t)
This function fixes the last steps to made on the Jacobian in some radiative transfer WSMs.
void iy_main_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const Tensor3 &iy_transmission, 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_surface_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, ArrayOfTensor4 &dsurface_rmatrix_dx, ArrayOfMatrix &dsurface_emission_dx, const String &iy_unit, const Tensor3 &iy_transmission, 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)
Matrix jacobian(Workspace &ws) noexcept
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
Matrix sensor_response_dlos(Workspace &ws) noexcept
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
ArrayOfString scat_species(Workspace &ws) noexcept
Tensor3 mag_u_field(Workspace &ws) noexcept
void defocusing_general_sub(Workspace &ws, Vector &pos, Vector &rte_los, Index &background, ConstVectorView rte_pos, const Numeric &lo0, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Verbosity &verbosity)
Just to avoid duplicatuion of code in defocusing_general.
Index ncols(Workspace &ws) noexcept
void cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen(MatrixView F, ConstMatrixView A)
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.
Index mblock_index(Workspace &ws) noexcept
const String TEMPERATURE_MAINTAG
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Agenda jacobian_agenda(Workspace &ws) noexcept
ArrayOfPropagationMatrix propmat_clearsky(Workspace &ws) noexcept
void get_iy_of_background(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, ConstTensor3View iy_transmission, const Index &iy_id, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, ConstVectorView rte_pos2, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, ConstVectorView f_grid, const String &iy_unit, 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 distance3D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &r2, const Numeric &lat2, const Numeric &lon2)
distance3D
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 ...
Vector ppvar_p(Workspace &ws) noexcept
Vector aa_grid(Workspace &ws) noexcept
void SetAtPosition(ConstVectorView x, const Index iv=0, const Index iz=0, const Index ia=0)
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.
Agenda water_p_eq_agenda(Workspace &ws) noexcept
A constant view of a Vector.
Matrix pos
The distance between start pos and the last position in pos.
Index nelem() const
Number of elements.
Matrix sensor_los(Workspace &ws) noexcept
Matrix y_geo(Workspace &ws) noexcept
ArrayOfTensor4 dsurface_rmatrix_dx(Workspace &ws) noexcept
void ext_mat_case(Index &icase, ConstMatrixView ext_mat, const Index stokes_dim)
void get_pointers_for_analytical_jacobians(ArrayOfIndex &abs_species_i, ArrayOfIndex &scat_species_i, ArrayOfIndex &is_t, ArrayOfIndex &wind_i, ArrayOfIndex &magfield_i, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const ArrayOfString &scat_species)
Help function for analytical jacobian calculations.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Matrix z_surface(Workspace &ws) noexcept
VectorView VectorAtPosition(const Index iv=0, const Index iz=0, const Index ia=0)
Get a vectorview to the position.
void get_stepwise_blackbody_radiation(VectorView B, VectorView dB_dT, ConstVectorView ppath_f_grid, const Numeric &ppath_temperature, const bool &do_temperature_derivative)
Get the blackbody radiation at propagation path point.
Numeric refell2r(ConstVectorView refellipsoid, const Numeric &lat)
refell2r
const Numeric PI
Global constant, pi.
Vector rtp_pos(Workspace &ws) noexcept
void get_ppath_f(Matrix &ppath_f, const Ppath &ppath, ConstVectorView f_grid, const Index &atmosphere_dim, const Numeric &rte_alonglos_v, ConstMatrixView ppath_wind)
Determines the Doppler shifted frequencies along the propagation path.
void distance2D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &r2, const Numeric &lat2)
distance2D
Index cloudbox_on(Workspace &ws) noexcept
void SetAtPosition(const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
Set the At Position object.