65 fs = exp(-kI * s) * (I * cosh(kQ * s) +
Q * sinh(kQ * s));
160 fa =
ext_I(I,
Q, KI, KQ, sa);
162 fb =
ext_I(I,
Q, KI, KQ, sb);
170 macheps = DBL_EPSILON;
182 tol = 2.0 * macheps *
abs(sb) + t;
185 if (
abs(m) <= tol || fb == 0.0) {
189 if (
abs(e) < tol ||
abs(fa) <=
abs(fb)) {
201 p = s * (2.0 * m *
q * (
q - r) - (sb - sa) * (r - 1.0));
202 q = (
q - 1.0) * (r - 1.0) * (s - 1.0);
214 if (2.0 * p < 3.0 * m *
q -
abs(tol *
q) && p <
abs(0.5 * s *
q)) {
226 }
else if (0.0 < m) {
232 fb =
ext_I(I,
Q, KI, KQ, sb);
235 if ((0.0 < fb && 0.0 < fc) || (fb <= 0.0 && fc <= 0.0)) {
248 const Agenda& propmat_clearsky_agenda,
272 ao_gp_lat[0] = gp_lat;
273 ao_gp_lon[0] = gp_lon;
277 itw2p(p_vec, p_grid, ao_gp_p, itw_p);
284 t_vec, 3, t_field, ao_gp_p, ao_gp_lat, ao_gp_lon, itw_field);
286 for (
Index is = 0; is <
ns; is++) {
296 temperature = t_vec[0];
298 const Vector rtp_mag_dummy(3, 0);
299 const Vector ppath_los_dummy;
304 local_propmat_clearsky,
305 local_nlte_source_dummy,
307 local_dnlte_source_dx_dummy,
316 propmat_clearsky_agenda);
319 local_ext_mat, local_abs_vec, local_propmat_clearsky);
330 const Agenda& propmat_clearsky_agenda,
331 const Index stokes_dim,
348 Matrix pnd_ppath(N_se, 1);
366 ao_gp_lat[0] = gp_lat;
367 ao_gp_lon[0] = gp_lon;
381 pnd_vec = pnd_ppath(
joker, 0);
382 temperature = t_ppath[0];
384 const Vector rtp_mag_dummy(3, 0);
385 const Vector ppath_los_dummy;
389 local_propmat_clearsky,
390 local_nlte_source_dummy,
392 local_dnlte_source_dx_dummy,
394 f_grid[
Range(f_index, 1)],
401 propmat_clearsky_agenda);
404 local_ext_mat, local_abs_vec, local_propmat_clearsky);
422 Matrix dir_array(1, 2, 0.);
423 dir_array(0,
joker) = sca_dir;
450 ext_mat_mono += ext_mat_bulk(0, 0, 0,
joker,
joker);
451 abs_vec_mono += abs_vec_bulk(0, 0, 0,
joker);
473 Index atmosphere_dim = 3;
475 for (
Index i = 0; i < np; i++) {
477 gp_p_cloud[i].idx -= cloudbox_limits[0];
478 gp_lat_cloud[i].idx -= cloudbox_limits[2];
479 gp_lon_cloud[i].idx -= cloudbox_limits[4];
482 const Index n1 = cloudbox_limits[1] - cloudbox_limits[0];
483 const Index n2 = cloudbox_limits[3] - cloudbox_limits[2];
484 const Index n3 = cloudbox_limits[5] - cloudbox_limits[4];
497 itw2p(pressure, p_grid_cloud, gp_p_cloud, itw_p);
504 itw_field, atmosphere_dim, gp_p_cloud, gp_lat_cloud, gp_lon_cloud);
514 for (
Index is = 0; is <
ns; is++) {
526 for (
Index i_se = 0; i_se < N_se; i_se++) {
541 const Index stokes_dim) {
546 if (stokes_dim == 1) {
555 if (ext_mat(1, 0) != 0) {
559 if (stokes_dim >= 3) {
564 if (ext_mat(2, 0) != 0 || ext_mat(2, 1) != 0) {
568 if (stokes_dim > 3) {
576 if (ext_mat(3, 0) != 0 || ext_mat(3, 1) != 0) {
578 }
else if (ext_mat(3, 2) != 0) {
637 trans_mat(0, 0) = exp(-ext_mat(0, 0) * lstep);
638 for (
Index i = 1; i < stokes_dim; i++) {
639 trans_mat(i, i) = trans_mat(0, 0);
643 else if (icase == 2 && stokes_dim < 3) {
646 const Numeric tI = exp(-ext_mat(0, 0) * lstep);
647 const Numeric HQ = ext_mat(0, 1) * lstep;
648 trans_mat(0, 0) = tI * cosh(HQ);
649 trans_mat(1, 1) = trans_mat(0, 0);
650 trans_mat(1, 0) = -tI * sinh(HQ);
651 trans_mat(0, 1) = trans_mat(1, 0);
674 Matrix ext_mat_ds = ext_mat;
675 ext_mat_ds *= -lstep;
679 switch (stokes_dim) {
682 trans_mat, ext_mat_ds);
693 const Agenda& propmat_clearsky_agenda,
694 const Index stokes_dim,
710 Vector abs_vec_mono(stokes_dim);
711 Matrix ext_mat(stokes_dim, stokes_dim);
712 Matrix ext_mat_mono(stokes_dim, stokes_dim);
713 Matrix incT(stokes_dim, stokes_dim, 0.0);
723 Range p_range(cloudbox_limits[0],
724 cloudbox_limits[1] - cloudbox_limits[0] + 1);
725 Range lat_range(cloudbox_limits[2],
726 cloudbox_limits[3] - cloudbox_limits[2] + 1);
727 Range lon_range(cloudbox_limits[4],
728 cloudbox_limits[5] - cloudbox_limits[4] + 1);
742 propmat_clearsky_agenda,
750 t_field(p_range, lat_range, lon_range),
751 vmr_field(
joker, p_range, lat_range, lon_range),
761 propmat_clearsky_agenda,
772 trans_matArray[1] = trans_mat;
773 ext_matArray[1] = ext_mat_mono;
776 for (
Index ip = np - 2; ip >= 0; ip--) {
779 ext_matArray[0] = ext_matArray[1];
780 trans_matArray[0] = trans_matArray[1];
794 propmat_clearsky_agenda,
802 t_field(p_range, lat_range, lon_range),
803 vmr_field(
joker, p_range, lat_range, lon_range),
813 propmat_clearsky_agenda,
824 ext_matArray[1] = ext_mat_mono;
825 ext_mat = ext_matArray[0];
826 ext_mat += ext_matArray[1];
829 Index extmat_case = 0;
833 mult(trans_mat, incT, trans_matArray[1]);
834 trans_matArray[1] = trans_mat;
868 Index& termination_flag,
870 const Agenda& ppath_step_agenda,
872 const Numeric& ppath_lraytrace,
874 const Agenda& propmat_clearsky_agenda,
875 const Index stokes_dim,
882 const Vector& refellipsoid,
894 Matrix ext_mat(stokes_dim, stokes_dim);
895 Matrix incT(stokes_dim, stokes_dim, 0.0);
897 Matrix T(stokes_dim, stokes_dim);
901 Matrix old_evol_op(stokes_dim, stokes_dim);
907 evol_opArray[1] = evol_op;
910 Range p_range(cloudbox_limits[0],
911 cloudbox_limits[1] - cloudbox_limits[0] + 1);
912 Range lat_range(cloudbox_limits[2],
913 cloudbox_limits[3] - cloudbox_limits[2] + 1);
914 Range lon_range(cloudbox_limits[4],
915 cloudbox_limits[5] - cloudbox_limits[4] + 1);
958 propmat_clearsky_agenda,
966 t_field(p_range, lat_range, lon_range),
967 vmr_field(
joker, p_range, lat_range, lon_range),
977 propmat_clearsky_agenda,
989 ext_matArray[1] = ext_mat_mono;
990 abs_vecArray[1] = abs_vec_mono;
991 tArray[1] = temperature;
992 pnd_vecArray[1] = pnd_vec;
997 termination_flag = 0;
999 while ((evol_op(0, 0) > r) && (!termination_flag)) {
1003 "100000 path points have been reached. "
1004 "Is this an infinite loop?");
1006 evol_opArray[0] = evol_opArray[1];
1007 ext_matArray[0] = ext_matArray[1];
1008 abs_vecArray[0] = abs_vecArray[1];
1009 tArray[0] = tArray[1];
1010 pnd_vecArray[0] = pnd_vecArray[1];
1023 bool oktaustep =
false;
1024 Index ppath_try = 1;
1025 const Index lmax_limit = 10;
1027 while (!oktaustep) {
1029 if (ip == ppath_step.
np - 1) {
1030 Numeric lmax = taustep_limit / ext_mat_mono(0, 0);
1031 if (ppath_lmax > 0) {
1032 lmax =
min(ppath_lmax, lmax);
1034 if (lmax < lmax_limit) {
1044 f_grid[
Range(f_index, 1)],
1064 propmat_clearsky_agenda,
1068 ppath_step.
gp_p[ip],
1072 t_field(p_range, lat_range, lon_range),
1073 vmr_field(
joker, p_range, lat_range, lon_range),
1083 propmat_clearsky_agenda,
1085 ppath_step.
gp_p[ip],
1094 dl = ppath_step.
lstep[ip - 1];
1100 if (ppath_try > 1 || ext_mat_mono(0, 0) <= ext_matArray[0](0, 0) ||
1101 (ext_mat_mono(0, 0) + ext_matArray[0](0, 0)) *
dl / 2 <=
1115 ext_matArray[1] = ext_mat_mono;
1116 abs_vecArray[1] = abs_vec_mono;
1117 tArray[1] = temperature;
1118 pnd_vecArray[1] = pnd_vec;
1119 ext_mat = ext_matArray[1];
1120 ext_mat += ext_matArray[0];
1123 Index extmat_case = 0;
1127 mult(evol_op, evol_opArray[0], incT);
1128 evol_opArray[1] = evol_op;
1130 if (evol_op(0, 0) > r) {
1135 if (ip == ppath_step.
np - 1) {
1137 termination_flag = 2;
1141 termination_flag = 1;
1147 if (termination_flag) {
1148 rte_pos = ppath_step.
pos(ip,
joker);
1149 rte_los = ppath_step.
los(ip,
joker);
1159 k = ext_mat(0, 0) / 2;
1160 ds = log(evol_opArray[0](0, 0) / r) / k;
1171 interp(ext_mat_mono, itw, ext_matArray, gp[0]);
1172 ext_mat = ext_mat_mono;
1173 ext_mat += ext_matArray[gp[0].idx];
1176 Index extmat_case = 0;
1177 ext2trans(incT, extmat_case, ext_mat, ds / 2);
1180 mult(evol_op, evol_opArray[gp[0].idx], incT);
1181 interp(abs_vec_mono, itw, abs_vecArray, gp[0]);
1182 temperature =
interp(itw, tArray, gp[0]);
1183 interp(pnd_vec, itw, pnd_vecArray, gp[0]);
1184 for (
Index i = 0; i < 2; i++) {
1185 rte_pos[i] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), i), gp[0]);
1186 rte_los[i] =
interp(itw, ppath_step.
los(
Range(ip - 1, 2), i), gp[0]);
1188 rte_pos[2] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), 2), gp[0]);
1194 const Index np = ip + 1;
1210 Index& termination_flag,
1212 const Agenda& ppath_step_agenda,
1214 const Numeric& ppath_lraytrace,
1215 const Agenda& propmat_clearsky_agenda,
1216 const bool& anyptype_nonTotRan,
1217 const Index stokes_dim,
1218 const Index f_index,
1225 const Vector& refellipsoid,
1237 Matrix ext_mat(stokes_dim, stokes_dim);
1238 Matrix incT(stokes_dim, stokes_dim, 0.0);
1240 Matrix T(stokes_dim, stokes_dim);
1244 Matrix old_evol_op(stokes_dim, stokes_dim);
1255 evol_opArray[1] = evol_op;
1258 Range p_range(cloudbox_limits[0],
1259 cloudbox_limits[1] - cloudbox_limits[0] + 1);
1260 Range lat_range(cloudbox_limits[2],
1261 cloudbox_limits[3] - cloudbox_limits[2] + 1);
1262 Range lon_range(cloudbox_limits[4],
1263 cloudbox_limits[5] - cloudbox_limits[4] + 1);
1281 if (ppath_step.
np == 0) {
1282 termination_flag = 1;
1299 local_rte_los[0] = 180 - ppath_step.
los(0, 0);
1300 local_rte_los[1] = ppath_step.
los(0, 1) - 180;
1306 propmat_clearsky_agenda,
1314 t_field(p_range, lat_range, lon_range),
1315 vmr_field(
joker, p_range, lat_range, lon_range),
1325 propmat_clearsky_agenda,
1337 ext_matArray[1] = ext_mat_mono;
1338 abs_vecArray[1] = abs_vec_mono;
1339 tArray[1] = temperature;
1340 pnd_vecArray[1] = pnd_vec;
1345 termination_flag = 0;
1351 while ((evop0 > r) && (!termination_flag)) {
1355 "25000 path points have been reached. "
1356 "Is this an infinite loop?");
1358 evol_opArray[0] = evol_opArray[1];
1359 ext_matArray[0] = ext_matArray[1];
1360 abs_vecArray[0] = abs_vecArray[1];
1361 tArray[0] = tArray[1];
1362 pnd_vecArray[0] = pnd_vecArray[1];
1365 if (ip >= ppath_step.
np - 1) {
1371 f_grid[
Range(f_index, 1)],
1374 if (ppath_step.
np <= 1) {
1375 termination_flag = 1;
1388 dl = ppath_step.
lstep[ip - 1];
1389 dt =
dl * 0.5 * (ppath_step.
ngroup[ip - 1] + ppath_step.
ngroup[ip]) /
1394 local_rte_los[0] = 180 - ppath_step.
los(ip, 0);
1395 local_rte_los[1] = ppath_step.
los(ip, 1) - 180;
1401 propmat_clearsky_agenda,
1405 ppath_step.
gp_p[ip],
1409 t_field(p_range, lat_range, lon_range),
1410 vmr_field(
joker, p_range, lat_range, lon_range),
1420 propmat_clearsky_agenda,
1422 ppath_step.
gp_p[ip],
1431 ext_matArray[1] = ext_mat_mono;
1432 abs_vecArray[1] = abs_vec_mono;
1433 tArray[1] = temperature;
1434 pnd_vecArray[1] = pnd_vec;
1435 ext_mat = ext_matArray[1];
1436 ext_mat += ext_matArray[0];
1439 Index extmat_case = 0;
1444 mult(evol_op, incT, evol_opArray[0]);
1445 evol_opArray[1] = evol_op;
1446 evop0 = evol_op(0, 0);
1449 if (stokes_dim > 1 && anyptype_nonTotRan) {
1450 const Numeric Q1 = evol_op(0, 1) * Iprop[1] / Iprop[0];
1458 if (ip >= ppath_step.
np - 1) {
1460 termination_flag = 2;
1464 termination_flag = 1;
1470 if (termination_flag != 0) {
1471 if (ip < ppath_step.
np) {
1475 rte_pos = ppath_step.
pos(ip,
joker);
1476 rte_los = ppath_step.
los(ip,
joker);
1484 kI = ext_mat(0, 0) / 2;
1485 kQ = ext_mat(0, 1) / 2;
1486 if (anyptype_nonTotRan) {
1487 const Numeric I1 = evol_opArray[0](0, 0);
1488 const Numeric Q1 = evol_opArray[0](0, 1) * Iprop[1] / Iprop[0];
1492 ds, (
Numeric)0.0, ppath_step.
lstep[ip - 1], tol, r, I1, Q1, kI, kQ);
1495 ds = log(evol_opArray[0](0, 0) / r) / kI;
1498 ttot += ds * dt /
dl;
1508 interp(ext_mat_mono, itw, ext_matArray, gp[0]);
1509 ext_mat = ext_mat_mono;
1510 ext_mat += ext_matArray[gp[0].idx];
1513 Index extmat_case = 0;
1514 ext2trans(incT, extmat_case, ext_mat, ds / 2);
1517 mult(evol_op, incT, evol_opArray[gp[0].idx]);
1518 interp(abs_vec_mono, itw, abs_vecArray, gp[0]);
1519 temperature =
interp(itw, tArray, gp[0]);
1520 interp(pnd_vec, itw, pnd_vecArray, gp[0]);
1521 for (
Index i = 0; i < 2; i++) {
1522 rte_pos[i] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), i), gp[0]);
1523 rte_los[i] =
interp(itw, ppath_step.
los(
Range(ip - 1, 2), i), gp[0]);
1525 rte_pos[2] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), 2), gp[0]);
1529 const Index np = ip + 1;
1539 const Index f_index,
1540 const Index stokes_dim,
1544 const Numeric rtp_temperature,
1545 const Index t_interp_order) {
1547 bool tryagain =
true;
1555 for (
Index i = 0; i < np; i++) {
1556 Z11max += Z11maxvector[i] * pnd_vec[i];
1571 Matrix pdir(1, 2), idir(1, 2);
1572 Vector t(1, rtp_temperature);
1574 pnds(
joker, 0) = pnd_vec;
1577 new_rte_los[0] = acos(1 - 2 * rng.
draw()) *
RAD2DEG;
1578 new_rte_los[1] = rng.
draw() * 360 - 180;
1588 pdir(0,
joker) = sca_dir;
1589 idir(0,
joker) = inc_dir;
1601 pha_mat_ssbulk, ptype_ssbulk, pha_mat_Nse, ptypes_Nse, pnds, t_ok);
1602 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
1605 if (rng.
draw() <= Z(0, 0) / Z11max)
1610 g_los_csc_theta = Z(0, 0) / Csca;
1614 new_rte_los[1] = rng.
draw() * 360 - 180;
1615 new_rte_los[0] = acos(1 - 2 * rng.
draw()) *
RAD2DEG;
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
void ppath_step_agendaExecute(Workspace &ws, Ppath &ppath_step, const Numeric ppath_lmax, const Numeric ppath_lraytrace, const Vector &f_grid, const Agenda &input_agenda)
void propmat_clearsky_agendaExecute(Workspace &ws, PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const 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 nelem() const ARTS_NOEXCEPT
Number of elements.
A constant view of a Matrix.
Index nrows() const noexcept
Index ncols() const noexcept
A constant view of a Tensor3.
A constant view of a Tensor4.
Index nbooks() const noexcept
A constant view of a Vector.
Index nelem() const noexcept
Returns the number of elements.
void MatrixAtPosition(MatrixView ret, const Index iv=0, const Index iz=0, const Index ia=0) const
Sets the dense matrix.
double draw()
Draws a double from the uniform distribution [0,1)
Stokes vector is as Propagation matrix but only has 4 possible values.
VectorView VectorAtPosition(const Index iv=0, const Index iz=0, const Index ia=0)
Get a vectorview to the position.
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)
const Numeric RAD2DEG
Global constant, conversion from radians to degrees.
void mult(MatrixView C, ConstMatrixView A, const Block &B)
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR_IF(condition,...)
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Numeric fractional_gp(const GridPos &gp)
fractional_gp
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
void id_mat(MatrixView I)
Identity Matrix.
void cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen(MatrixView F, ConstMatrixView A)
void matrix_exp(MatrixView F, ConstMatrixView A, const Index &q)
General exponential of a Matrix.
bool is_singular(ConstMatrixView A)
Checks if a square matrix is singular.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
Interpolation classes and functions created for use within Monte Carlo scattering simulations.
void mcPathTraceRadar(Workspace &ws, MatrixView evol_op, Vector &abs_vec_mono, Numeric &temperature, MatrixView ext_mat_mono, Rng &rng, Vector &rte_pos, Vector &rte_los, Vector &pnd_vec, Numeric &stot, Numeric &ttot, Ppath &ppath_step, Index &termination_flag, bool &inside_cloud, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Agenda &propmat_clearsky_agenda, const bool &anyptype_nonTotRan, const Index stokes_dim, const Index f_index, const Vector &f_grid, const Vector &Iprop, 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 ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Verbosity &verbosity)
mcPathTraceRadar.
bool is_anyptype_nonTotRan(const ArrayOfArrayOfSingleScatteringData &scat_data)
is_anyptype_nonTotRan.
void ext_mat_case(Index &icase, ConstMatrixView ext_mat, const Index stokes_dim)
void Sample_los_uniform(VectorView new_rte_los, Rng &rng)
Sample_los_uniform.
void clear_rt_vars_at_gp(Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, Numeric &temperature, const Agenda &propmat_clearsky_agenda, const Numeric &f_mono, const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, ConstVectorView p_grid, ConstTensor3View t_field, ConstTensor4View vmr_field)
clear_rt_vars_at_gp.
void cloud_atm_vars_by_gp(VectorView pressure, VectorView temperature, MatrixView vmr, MatrixView pnd, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, const ArrayOfIndex &cloudbox_limits, ConstVectorView p_grid_cloud, ConstTensor3View t_field_cloud, ConstTensor4View vmr_field_cloud, ConstTensor4View pnd_field)
cloud_atm_vars_by_gp.
void ext2trans(MatrixView trans_mat, Index &icase, ConstMatrixView ext_mat, const Numeric &lstep)
Converts an extinction matrix to a transmission matrix.
void brent_zero(Numeric &sb, const Numeric &a, const Numeric &b, const Numeric &t, const Numeric &rn, const Numeric &I, const Numeric &Q, const Numeric &KI, const Numeric &KQ)
brent_zero.
const Numeric SPEED_OF_LIGHT
void Sample_los(VectorView new_rte_los, Numeric &g_los_csc_theta, MatrixView Z, Rng &rng, ConstVectorView rte_los, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index f_index, const Index stokes_dim, ConstVectorView pnd_vec, ConstVectorView Z11maxvector, const Numeric Csca, const Numeric rtp_temperature, const Index t_interp_order)
Sample_los.
void mcPathTraceGeneral(Workspace &ws, MatrixView evol_op, Vector &abs_vec_mono, Numeric &temperature, MatrixView ext_mat_mono, Rng &rng, Vector &rte_pos, Vector &rte_los, Vector &pnd_vec, Numeric &g, Ppath &ppath_step, Index &termination_flag, bool &inside_cloud, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Numeric &taustep_limit, const Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Index f_index, const Vector &f_grid, 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 ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Verbosity &verbosity)
mcPathTraceGeneral.
Numeric ext_I(const Numeric &I, const Numeric &Q, const Numeric &kI, const Numeric &kQ, const Numeric &s)
ext_I.
void cloudy_rt_vars_at_gp(Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, VectorView pnd_vec, Numeric &temperature, const Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Index f_index, const Vector &f_grid, const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, ConstVectorView p_grid_cloud, ConstTensor3View t_field_cloud, ConstTensor4View vmr_field_cloud, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfIndex &cloudbox_limits, const Vector &rte_los)
cloudy_rt_vars_at_gp.
void get_ppath_transmat(Workspace &ws, MatrixView &trans_mat, const Ppath &ppath, const Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Index f_index, const Vector &f_grid, const Vector &p_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Verbosity &verbosity)
get_ppath_transmat.
constexpr Numeric dl(const Index p0, const Index n, const Numeric x, const SortedVectorType &xi, const LagrangeVectorType &li, const Index j, const std::pair< Numeric, Numeric > cycle={-180, 180}) noexcept
constexpr Numeric Q(Numeric T, const Species::IsotopeRecord &ir)
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
void opt_prop_ScatSpecBulk(ArrayOfTensor5 &ext_mat, ArrayOfTensor4 &abs_vec, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor5 &ext_mat_se, const ArrayOfArrayOfTensor4 &abs_vec_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk extinction and absorption.
void opt_prop_sum_propmat_clearsky(PropagationMatrix &ext_mat, StokesVector &abs_vec, const PropagationMatrix &propmat_clearsky)
Get optical properties from propmat_clearsky.
void pha_mat_ScatSpecBulk(ArrayOfTensor6 &pha_mat, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor6 &pha_mat_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk phase matrices.
void pha_mat_Bulk(Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss)
Scattering species bulk phase matrix.
void opt_prop_Bulk(Tensor5 &ext_mat, Tensor4 &abs_vec, Index &ptype, const ArrayOfTensor5 &ext_mat_ss, const ArrayOfTensor4 &abs_vec_ss, const ArrayOfIndex &ptypes_ss)
one-line descript
void opt_prop_NScatElems(ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order)
Extinction and absorption from all scattering elements.
void pha_mat_NScatElems(ArrayOfArrayOfTensor6 &pha_mat, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_index, const Index &t_interp_order)
Phase matrices from all scattering elements.
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
void ppath_start_stepping(Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const bool &ppath_inside_cloudbox_do, ConstVectorView rte_pos, ConstVectorView rte_los, const Verbosity &verbosity)
Initiates a Ppath structure for calculation of a path with ppath_step.
void mirror_los(Vector &los_mirrored, const ConstVectorView &los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
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_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.
Structure to store a grid position.
The structure to describe a propagation path and releated quantities.
Matrix los
Line-of-sight at each ppath point.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
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.
Vector ngroup
The group index of refraction.