Go to the documentation of this file.
93 const Index& trans_in_jacobian,
95 const Index& t_interp_order,
110 "Recursive usage not possible (iy_agenda_call1 must be 1)");
112 throw runtime_error(
"*iy_transmission* must be empty");
113 if (rbi < 1 || rbi > 9)
115 "ppath.background is invalid. Check your "
116 "calculation of *ppath*?");
117 if (rbi == 3 || rbi == 4)
119 "The propagation path ends inside or at boundary of "
120 "the cloudbox.\nFor this method, *ppath* must be "
121 "calculated in this way:\n ppathCalc( cloudbox_on = 0 ).");
125 "The scattering data must be flagged to have\n"
126 "passed a consistency check (scat_data_checked=1).");
129 "*pnd_field* and *scat_data* inconsistent regarding total number of"
130 " scattering elements.");
135 "*dpnd_field_dx* not properly initialized:\n"
136 "Number of elements in dpnd_field_dx must be equal number of jacobian"
137 " quantities.\n(Note: jacobians have to be defined BEFORE *pnd_field*"
138 " is calculated/set.");
155 os <<
"The size of *iy* returned from *iy_transmitter_agenda* is\n"
157 <<
" expected size = [" << nf <<
"," <<
stokes_dim <<
"]\n"
158 <<
" size of iy = [" << iy0.
nrows() <<
"," << iy0.
ncols() <<
"]\n";
159 throw runtime_error(os.str());
161 for (
Index iv = 0; iv < nf; iv++) {
164 "The *iy* returned from *iy_transmitter_agenda* "
165 "must have the value 1 in the first column.");
169 Index j_analytical_do = 0;
176 ArrayOfIndex jac_species_i(nq), jac_scat_i(nq), jac_is_t(nq), jac_wind_i(nq);
179 if (j_analytical_do) {
204 Index auxBackScat = -1;
205 Index auxOptDepth = -1;
206 Index auxPartAtte = -1;
208 for (
Index i = 0; i < naux; i++) {
219 }
else if (
iy_aux_vars[i] ==
"Particle extinction") {
224 os <<
"The only allowed strings in *iy_aux_vars* are:\n"
225 <<
" \"Radiative background\"\n"
226 <<
" \"Backscattering\"\n"
227 <<
" \"Optical depth\"\n"
228 <<
" \"Particle extinction\"\n"
229 <<
"but you have selected: \"" <<
iy_aux_vars[i] <<
"\"";
230 throw runtime_error(os.str());
239 Tensor5 dtrans_partial_dx_above(0, 0, 0, 0, 0);
240 Tensor5 dtrans_partial_dx_below(0, 0, 0, 0, 0);
244 Matrix scalar_ext(np, nf, 0);
246 Index duplicate_freqs = ((nf == nf_ssd) ? 0 : 1);
248 Vector t_ok(1), t_array(1);
249 Matrix pdir(1, 2), idir(1, 2);
253 if (np == 1 && rbi == 1)
297 clear2cloudy.resize(np);
298 for (
Index ip = 0; ip < np; ip++) {
299 clear2cloudy[ip] = -1;
313 if (trans_in_jacobian && j_analytical_do) {
314 dtrans_partial_dx_above.
resize(np, nq, nf,
ns,
ns);
315 dtrans_partial_dx_below.
resize(np, nq, nf,
ns,
ns);
316 dtrans_partial_dx_above = 0;
317 dtrans_partial_dx_below = 0;
319 dK_past_dx.resize(nq);
334 for (
Index ip = 0; ip < np; ip++) {
351 trans_in_jacobian && j_analytical_do);
353 if (trans_in_jacobian && j_analytical_do) {
367 trans_in_jacobian && j_analytical_do);
370 if (clear2cloudy[ip] + 1) {
385 if (
abs(pext_scaling - 1) > 1e-6) {
387 if (trans_in_jacobian && j_analytical_do) {
394 if (auxPartAtte >= 0) {
398 if (trans_in_jacobian && j_analytical_do) {
407 pdir(0,
joker) = los_sca;
417 idir(0,
joker) = los_inc;
427 else if (j_analytical_do)
428 for (
Index iq = 0; iq < nq && !val_pnd; iq++)
429 if (jac_scat_i[iq] >= 0)
430 if (ppvar_dpnd_dx[iq](i_se_flat, ip) != 0) {
446 for (
Index iv = 0; iv < nf; iv++)
454 os <<
"Interpolation error for (flat-array) scattering"
455 <<
" element #" << i_se_flat <<
"\n"
456 <<
"at location/temperature point #" << ip <<
"\n";
457 throw runtime_error(os.str());
466 if (trans_in_jacobian && j_analytical_do) {
496 swap(K_past, K_this);
497 swap(dK_past_dx, dK_this_dx);
507 iy.resize(nf * np,
ns);
516 for (
Index ip = 0; ip < np; ip++) {
518 if (clear2cloudy[ip] >= 0) {
519 for (
Index iv = 0; iv < nf; iv++) {
522 for (
Index i = 0; i < ne; i++) {
524 for (
Index is1 = 0; is1 <
ns; is1++) {
525 for (
Index is2 = 0; is2 <
ns; is2++) {
526 P(is1, is2) +=
ppvar_pnd(i, ip) * Pe(i, ip, iv, is1, is2);
534 const Index iout = iv * np + ip;
539 if (auxBackScat >= 0) {
542 if (auxPartAtte >= 0 && ip > 0) {
543 iy_aux[auxPartAtte](iout, 0) =
544 iy_aux[auxPartAtte](iout - 1, 0) +
545 ppath.lstep[ip - 1] *
546 (scalar_ext(ip - 1, iv) + scalar_ext(ip - 1, iv));
550 if (j_analytical_do) {
553 for (
Index iq = 0; iq < nq; iq++) {
555 if (jac_scat_i[iq] >= 0) {
558 for (
Index i = 0; i < ne; i++) {
559 if (ppvar_dpnd_dx[iq](i, ip) != 0) {
560 for (
Index is1 = 0; is1 <
ns; is1++) {
561 for (
Index is2 = 0; is2 <
ns; is2++) {
563 ppvar_dpnd_dx[iq](i, ip) * Pe(i, ip, iv, is1, is2);
571 mult(iy_tmp, P, iy1);
582 if (auxPartAtte >= 0 && ip > 0) {
583 for (
Index iv = 0; iv < nf; iv++) {
584 const Index iout = iv * np + ip;
585 iy_aux[auxPartAtte](iout, 0) =
iy_aux[auxPartAtte](iout - nf, 0);
590 if (auxOptDepth >= 0) {
591 for (
Index iv = 0; iv < nf; iv++) {
592 const Index iout = iv * np + ip;
593 iy_aux[auxOptDepth](iout, 0) =
613 if (j_analytical_do) {
615 if (trans_in_jacobian) {
618 for (
Index ip = 0; ip < np; ip++)
620 for (
Index j = ip; j < np; j++)
627 const Index iout = iv * np + j;
631 dtrans_partial_dx_above(ip, iq, iv,
joker,
joker),
636 if (isnan(jnew[i])) jnew[i] = 0.0;
639 diy_dpath[iq](ip, iout,
joker) += jnew;
642 if (j > ip && j < np - 1) {
644 dtrans_partial_dx_below(ip, iq, iv,
joker,
joker),
649 if (isnan(jnew[i])) jnew[i] = 0.0;
652 diy_dpath[iq](ip, iout,
joker) += jnew;
724 const Index& trans_in_jacobian,
726 const Index& t_interp_order,
741 "Recursive usage not possible (iy_agenda_call1 must be 1)");
743 throw runtime_error(
"*iy_transmission* must be empty");
744 if (rbi < 1 || rbi > 9)
746 "ppath.background is invalid. Check your "
747 "calculation of *ppath*?");
748 if (rbi == 3 || rbi == 4)
750 "The propagation path ends inside or at boundary of "
751 "the cloudbox.\nFor this method, *ppath* must be "
752 "calculated in this way:\n ppathCalc( cloudbox_on = 0 ).");
756 "The scattering data must be flagged to have\n"
757 "passed a consistency check (scat_data_checked=1).");
760 "*pnd_field* and *scat_data* inconsistent regarding total number of"
761 " scattering elements.");
766 "*dpnd_field_dx* not properly initialized:\n"
767 "Number of elements in dpnd_field_dx must be equal number of jacobian"
768 " quantities.\n(Note: jacobians have to be defined BEFORE *pnd_field*"
769 " is calculated/set.");
786 os <<
"The size of *iy* returned from *iy_transmitter_agenda* is\n"
788 <<
" expected size = [" << nf <<
"," <<
stokes_dim <<
"]\n"
789 <<
" size of iy = [" << iy0.
nrows() <<
"," << iy0.
ncols() <<
"]\n";
790 throw runtime_error(os.str());
792 for (
Index iv = 0; iv < nf; iv++)
795 "The *iy* returned from *iy_transmitter_agenda* "
796 "must have the value 1 in the first column.");
799 Index j_analytical_do = 0;
804 ArrayOfIndex jac_species_i(nq), jac_scat_i(nq), jac_is_t(nq), jac_wind_i(nq);
837 for (
Index i = 0; i < naux; i++) {
855 os <<
"The only allowed strings in *iy_aux_vars* are:\n"
856 <<
" \"Radiative background\"\n"
860 <<
"but you have selected: \"" <<
iy_aux_vars[i] <<
"\"";
861 throw runtime_error(os.str());
887 Index duplicate_freqs = ((nf == nf_ssd) ? 0 : 1);
889 Vector t_ok(1), t_array(1);
890 Matrix pdir(1, 2), idir(1, 2);
893 if (np == 1 && rbi == 1) {
936 clear2cloudy.resize(np);
937 for (
Index ip = 0; ip < np; ip++) clear2cloudy[ip] = -1;
951 Index temperature_derivative_position = -1;
954 if (trans_in_jacobian && j_analytical_do) {
955 dK_this_dx.resize(nq);
956 dK_past_dx.resize(nq);
968 temperature_derivative_position = iq;
974 for (
Index ip = 0; ip < np; ip++) {
991 trans_in_jacobian && j_analytical_do);
993 if (trans_in_jacobian && j_analytical_do)
1007 trans_in_jacobian && j_analytical_do);
1009 if (clear2cloudy[ip] + 1) {
1024 if (
abs(pext_scaling - 1) > 1e-6) {
1026 if (trans_in_jacobian && j_analytical_do) {
1036 if (trans_in_jacobian && j_analytical_do)
1044 pdir(0,
joker) = los_sca;
1054 idir(0,
joker) = los_inc;
1056 Index i_se_flat = 0;
1064 else if (j_analytical_do)
1065 for (
Index iq = 0; iq < nq && !val_pnd; iq++)
1066 if (jac_scat_i[iq] >= 0)
1067 if (ppvar_dpnd_dx[iq](i_se_flat, ip) != 0) {
1081 if (t_ok[0] not_eq 0)
1082 if (duplicate_freqs)
1083 for (
Index iv = 0; iv < nf; iv++)
1091 os <<
"Interpolation error for (flat-array) scattering"
1092 <<
" element #" << i_se_flat <<
"\n"
1093 <<
"at location/temperature point #" << ip <<
"\n";
1094 throw runtime_error(os.str());
1105 do_hse ?
ppath.lstep[ip - 1] / (2.0 *
ppvar_t[ip - 1]) : 0;
1107 do_hse ?
ppath.lstep[ip - 1] / (2.0 *
ppvar_t[ip]) : 0;
1115 ppath.lstep[ip - 1],
1118 temperature_derivative_position);
1121 swap(K_past, K_this);
1122 swap(dK_past_dx, dK_this_dx);
1148 BackscatterSolver::CommutativeTransmission);
1152 iy.resize(nf * np,
ns);
1153 for (
Index ip = 0; ip < np; ip++) {
1154 for (
Index iv = 0; iv < nf; iv++) {
1156 iy(iv * np + ip, is) = lvl_rad[ip](iv, is);
1157 if (j_analytical_do) {
1159 diy_dpath[iq](ip, iv * np + ip2, is) =
1160 dlvl_rad[ip][ip2][iq](iv, is););
1169 if (j_analytical_do)
1237 throw runtime_error(
"The frequency grid is empty.");
1242 throw runtime_error(
"All frequencies in *f_grid* must be > 0.");
1247 throw runtime_error(
1248 "The atmospheric fields must be flagged to have "
1249 "passed a consistency check (atmfields_checked=1).");
1251 throw runtime_error(
1252 "The atmospheric geometry must be flagged to have "
1253 "passed a consistency check (atmgeom_checked=1).");
1255 throw runtime_error(
1256 "The cloudbox must be flagged to have "
1257 "passed a consistency check (cloudbox_checked=1).");
1259 throw runtime_error(
1260 "The sensor variables must be flagged to have "
1261 "passed a consistency check (sensor_checked=1).");
1266 throw runtime_error(
1267 "The vector *range_bins* must contain strictly "
1268 "increasing values.");
1270 throw runtime_error(
1271 "The vector *range_bins* is not allowed to contain "
1274 throw runtime_error(
1275 "The main length of *instrument_pol_array* must match "
1276 "the number of frequencies.");
1281 const Numeric jfac = 10 * log10(exp(1.0));
1285 }
else if (
iy_unit ==
"dBZe") {
1287 ze_min =
pow(10.0, dbze_min / 10);
1289 throw runtime_error(
1290 "For this method, *iy_unit* must be set to \"1\", "
1291 "\"Ze\" or \"dBZe\".");
1302 for (
Index i = 0; i < nf; i++) {
1304 npolcum[i + 1] = npolcum[i] + ni;
1306 for (
Index j = 0; j < ni; j++) {
1314 const Index ntot = npos * npolcum[nf] * nbins;
1321 y_geo.resize(ntot, 5);
1326 for (
Index i = 0; i < naux; i++) {
1327 y_aux[i].resize(ntot);
1333 Index j_analytical_do = 0;
1342 jacobian_indices[jacobian_indices.
nelem() - 1][1] + 1);
1356 for (
Index p = 0; p < npos; p++) {
1388 throw runtime_error(
1389 "A path consisting of a single point found. "
1390 "This is not allowed.");
1392 if (
iy.nrows() != nf * np)
1393 throw runtime_error(
1394 "The size of *iy* returned from *iy_main_agenda* "
1395 "is not correct (for this method).");
1403 for (
Index i = 1; i < np; i++) {
1404 range[i] = range[i - 1] +
ppath.lstep[i - 1] *
1409 const Numeric range_end1 =
min(range[0], range[np - 1]);
1410 const Numeric range_end2 =
max(range[0], range[np - 1]);
1413 for (
Index b = 0; b < nbins; b++) {
1426 hbin /= (blim2 - blim1);
1428 for (
Index iv = 0; iv < nf; iv++) {
1432 if (j_analytical_do) {
1437 for (
Index a = 0; a < naux; a++) {
1444 if (j_analytical_do) {
1448 for (
Index a = 0; a < naux; a++) {
1449 auxvar[a].resize(np);
1454 mult(refl, I, W[iv][ip]);
1455 if (j_analytical_do) {
1457 k < drefl[iq].nrows();
1462 for (
Index a = 0; a < naux; a++) {
1464 mult(auxvar[a], A[a], W[iv][ip]);
1466 for (
Index j = 0; j < np; j++) {
1467 auxvar[a][j] = A[a](j, 0);
1473 Index iout = nbins * (p * npolcum[nf] + npolcum[iv] + ip) + b;
1474 y[iout] = cfac[iv] * (hbin * refl);
1476 if (j_analytical_do) {
1478 for (
Index k = 0; k < drefl[iq].nrows(); k++) {
1479 jacobian(iout, jacobian_indices[iq][0] + k) =
1480 cfac[iv] * (hbin * drefl[iq](k,
joker));
1482 jacobian(iout, jacobian_indices[iq][0] + k) *=
1483 jfac /
max(
y[iout], ze_min);
1489 y[iout] =
y[iout] <= ze_min ? dbze_min : 10 * log10(
y[iout]);
1493 for (
Index a = 0; a < naux; a++) {
1495 y_aux[a][iout] = cfac[iv] * (hbin * auxvar[a]);
1499 : 10 * log10(
y_aux[a][iout]);
1502 y_aux[a][iout] = hbin * auxvar[a];
1515 throw runtime_error(
1516 "Wrong size of *geo_pos* obtained from "
1517 "*geo_pos_agenda*.\nThe length of *geo_pos* must "
1518 "be zero or equal to *atmosphere_dim*.");
1521 for (
Index b = 0; b < nbins; b++) {
1522 for (
Index iv = 0; iv < nf; iv++) {
1524 const Index iout = nbins * (p * npolcum[nf] + npolcum[iv] + ip) + b;
Matrix ppvar_mag(Workspace &ws) noexcept
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.
ArrayOfVector y_aux(Workspace &ws) noexcept
Vector geo_pos(Workspace &ws) noexcept
ArrayOfTransmissionMatrix cumulative_backscatter(ConstTensor5View t, ConstMatrixView m)
Accumulated backscatter (???)
PropagationMatrix PropagationMatrix
void geo_pos_agendaExecute(Workspace &ws, Vector &geo_pos, const Ppath &ppath, const Agenda &input_agenda)
Stokes vector is as Propagation matrix but only has 4 possible values.
Index atmgeom_checked(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
ArrayOfArrayOfIndex instrument_pol_array(Workspace &ws) noexcept
void iyActiveSingleScat2(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, Tensor4 &ppvar_trans_cumulat, 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 Index &scat_data_checked, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_transmitter_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Index &trans_in_jacobian, const Numeric &pext_scaling, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: iyActiveSingleScat2.
Matrix ppvar_vmr(Workspace &ws) noexcept
Tensor3 iy_transmission(Workspace &ws) noexcept
void integration_bin_by_vecmult(VectorView h, ConstVectorView x_g_in, const Numeric &limit1, const Numeric &limit2)
integration_bin_by_vecmult
Agenda iy_transmitter_agenda(Workspace &ws) noexcept
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
Verbosity verbosity(Workspace &ws) noexcept
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
ArrayOfArrayOfTransmissionMatrix cumulative_backscatter_derivative(ConstTensor5View t, const ArrayOfMatrix &aom)
Accumulated backscatter derivative (???)
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
Index jacobian_do(Workspace &ws) noexcept
Tensor3 wind_u_field(Workspace &ws) noexcept
Vector y(Workspace &ws) noexcept
void resize(Index n)
Resize function.
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
Matrix y_los(Workspace &ws) noexcept
Matrix ppvar_f(Workspace &ws) noexcept
Tensor3 mag_w_field(Workspace &ws) noexcept
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
Matrix iy(Workspace &ws) noexcept
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
The structure to describe a propagation path and releated quantities.
Vector range_bins(Workspace &ws) noexcept
const String SCATSPECIES_MAINTAG
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...
Tensor4 ppvar_trans_cumulat(Workspace &ws) noexcept
void set_backscatter_radiation_vector(ArrayOfRadiationVector &I, ArrayOfArrayOfArrayOfRadiationVector &dI, const RadiationVector &I_incoming, const ArrayOfTransmissionMatrix &T, const ArrayOfTransmissionMatrix &PiTf, const ArrayOfTransmissionMatrix &PiTr, const ArrayOfTransmissionMatrix &Z, const ArrayOfArrayOfTransmissionMatrix &dT1, const ArrayOfArrayOfTransmissionMatrix &dT2, const ArrayOfArrayOfTransmissionMatrix &dZ, const BackscatterSolver solver)
Set the backscatter radiation vector.
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.
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.
void yActive(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 String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &sensor_checked, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Agenda &iy_main_agenda, const Agenda &geo_pos_agenda, const ArrayOfArrayOfIndex &instrument_pol_array, const Vector &range_bins, const Numeric &ze_tref, const Numeric &k2, const Numeric &dbze_min, const Verbosity &)
WORKSPACE METHOD: yActive.
Sensor modelling functions.
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.
Array< ArrayOfRadiationVector > ArrayOfArrayOfRadiationVector
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
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.
Declarations having to do with the four output streams.
Vector y_f(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
ArrayOfIndex y_pol(Workspace &ws) noexcept
Matrix ppvar_pnd(Workspace &ws) noexcept
Index nelem() const
Returns the number of elements.
const Numeric SPEED_OF_LIGHT
Array< RadiationVector > ArrayOfRadiationVector
Tensor4 vmr_field(Workspace &ws) noexcept
EnergyLevelMap ppvar_nlte(Workspace &ws) noexcept
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Vector ppvar_t(Workspace &ws) noexcept
Index atmfields_checked(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
NUMERIC Numeric
The type to use for all floating point numbers.
Index iy_agenda_call1(Workspace &ws) noexcept
Index npages(Workspace &ws) noexcept
ArrayOfString iy_aux_vars(Workspace &ws) noexcept
Vector f_grid(Workspace &ws) noexcept
Matrix sensor_pos(Workspace &ws) noexcept
void iyActiveSingleScat(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, Tensor4 &ppvar_trans_cumulat, 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 Index &scat_data_checked, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_transmitter_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Index &trans_in_jacobian, const Numeric &pext_scaling, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: iyActiveSingleScat.
Stuff related to the propagation matrix.
Matrix ppvar_wind(Workspace &ws) noexcept
ArrayOfArrayOfSingleScatteringData scat_data(Workspace &ws) noexcept
void iy_transmitter_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
ArrayOfTensor4 dpnd_field_dx(Workspace &ws) noexcept
Array< TransmissionMatrix > ArrayOfTransmissionMatrix
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
Index scat_data_checked(Workspace &ws) noexcept
Radiation Vector for Stokes dimension 1-4.
ArrayOfMatrix iy_aux(Workspace &ws) noexcept
Agenda geo_pos_agenda(Workspace &ws) noexcept
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
Agenda iy_main_agenda(Workspace &ws) noexcept
Vector rte_pos2(Workspace &ws) noexcept
RadiationVector RadiationVector
void stokes2pol(VectorView w, const Index &stokes_dim, const Index &ipol_1based, const Numeric nv)
stokes2pol
void mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
Declaration of functions in rte.cc.
Tensor3 mag_v_field(Workspace &ws) noexcept
Tensor3 t_field(Workspace &ws) noexcept
VectorView Kjj(const Index iz=0, const Index ia=0)
Vector view to diagonal elements.
Tensor3 wind_w_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.
TransmissionMatrix TransmissionMatrix
Index sensor_checked(Workspace &ws) noexcept
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)
Matrix jacobian(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
ArrayOfString scat_species(Workspace &ws) noexcept
Tensor3 mag_u_field(Workspace &ws) noexcept
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Vector ppvar_p(Workspace &ws) noexcept
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
Index nelem() const
Number of elements.
Matrix sensor_los(Workspace &ws) noexcept
Matrix y_geo(Workspace &ws) noexcept
Index cloudbox_checked(Workspace &ws) noexcept
StokesVector StokesVector
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.
The global header file for ARTS.
Index cloudbox_on(Workspace &ws) noexcept
void solve(VectorView w, const CovarianceMatrix &A, ConstVectorView v)