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,
261 Matrix vmr_mat(ns, 1), itw_field;
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_dx_source_dummy,
308 local_nlte_dsource_dx_dummy,
317 propmat_clearsky_agenda);
320 local_ext_mat, local_abs_vec, local_propmat_clearsky);
331 const Agenda& propmat_clearsky_agenda,
332 const Index stokes_dim,
349 Matrix pnd_ppath(N_se, 1);
355 Matrix vmr_ppath(ns, 1), itw_field;
361 local_dnlte_dx_source_dummy;
363 local_nlte_dsource_dx_dummy;
370 ao_gp_lat[0] = gp_lat;
371 ao_gp_lon[0] = gp_lon;
385 pnd_vec = pnd_ppath(
joker, 0);
386 temperature = t_ppath[0];
388 const Vector rtp_mag_dummy(3, 0);
389 const Vector ppath_los_dummy;
393 local_propmat_clearsky,
394 local_nlte_source_dummy,
396 local_dnlte_dx_source_dummy,
397 local_nlte_dsource_dx_dummy,
399 f_grid[
Range(f_index, 1)],
406 propmat_clearsky_agenda);
409 local_ext_mat, local_abs_vec, local_propmat_clearsky);
427 Matrix dir_array(1, 2, 0.);
428 dir_array(0,
joker) = sca_dir;
455 ext_mat_mono += ext_mat_bulk(0, 0, 0,
joker,
joker);
456 abs_vec_mono += abs_vec_bulk(0, 0, 0,
joker);
472 assert(pressure.
nelem() == np);
478 Index atmosphere_dim = 3;
482 gp_p_cloud[
i].idx -= cloudbox_limits[0];
483 gp_lat_cloud[
i].idx -= cloudbox_limits[2];
484 gp_lon_cloud[
i].idx -= cloudbox_limits[4];
487 const Index n1 = cloudbox_limits[1] - cloudbox_limits[0];
488 const Index n2 = cloudbox_limits[3] - cloudbox_limits[2];
489 const Index n3 = cloudbox_limits[5] - cloudbox_limits[4];
502 itw2p(pressure, p_grid_cloud, gp_p_cloud, itw_p);
509 itw_field, atmosphere_dim, gp_p_cloud, gp_lat_cloud, gp_lon_cloud);
519 for (
Index is = 0; is <
ns; is++) {
531 for (
Index i_se = 0; i_se < N_se; i_se++) {
547 const Agenda& propmat_clearsky_agenda,
548 const Index stokes_dim,
564 Vector abs_vec_mono(stokes_dim);
565 Matrix ext_mat(stokes_dim, stokes_dim);
566 Matrix ext_mat_mono(stokes_dim, stokes_dim);
567 Matrix incT(stokes_dim, stokes_dim, 0.0);
577 Range p_range(cloudbox_limits[0],
578 cloudbox_limits[1] - cloudbox_limits[0] + 1);
579 Range lat_range(cloudbox_limits[2],
580 cloudbox_limits[3] - cloudbox_limits[2] + 1);
581 Range lon_range(cloudbox_limits[4],
582 cloudbox_limits[5] - cloudbox_limits[4] + 1);
596 propmat_clearsky_agenda,
604 t_field(p_range, lat_range, lon_range),
605 vmr_field(
joker, p_range, lat_range, lon_range),
615 propmat_clearsky_agenda,
626 trans_matArray[1] = trans_mat;
627 ext_matArray[1] = ext_mat_mono;
630 for (
Index ip = np - 2; ip >= 0; ip--) {
631 dl = ppath.
lstep[ip];
633 ext_matArray[0] = ext_matArray[1];
634 trans_matArray[0] = trans_matArray[1];
648 propmat_clearsky_agenda,
656 t_field(p_range, lat_range, lon_range),
657 vmr_field(
joker, p_range, lat_range, lon_range),
667 propmat_clearsky_agenda,
678 ext_matArray[1] = ext_mat_mono;
679 ext_mat = ext_matArray[0];
680 ext_mat += ext_matArray[1];
683 Index extmat_case = 0;
684 ext2trans(incT, extmat_case, ext_mat, dl / 2);
687 mult(trans_mat, incT, trans_matArray[1]);
688 trans_matArray[1] = trans_mat;
698 is_anyptype_nonTotRan ==
false && i_ss < scat_data.
nelem();
701 is_anyptype_nonTotRan ==
false && i_se < scat_data[i_ss].
nelem();
704 is_anyptype_nonTotRan =
true;
722 Index& termination_flag,
724 const Agenda& ppath_step_agenda,
726 const Numeric& ppath_lraytrace,
728 const Agenda& propmat_clearsky_agenda,
729 const Index stokes_dim,
736 const Vector& refellipsoid,
748 Matrix ext_mat(stokes_dim, stokes_dim);
749 Matrix incT(stokes_dim, stokes_dim, 0.0);
751 Matrix T(stokes_dim, stokes_dim);
755 Matrix old_evol_op(stokes_dim, stokes_dim);
761 evol_opArray[1] = evol_op;
764 Range p_range(cloudbox_limits[0],
765 cloudbox_limits[1] - cloudbox_limits[0] + 1);
766 Range lat_range(cloudbox_limits[2],
767 cloudbox_limits[3] - cloudbox_limits[2] + 1);
768 Range lon_range(cloudbox_limits[4],
769 cloudbox_limits[5] - cloudbox_limits[4] + 1);
812 propmat_clearsky_agenda,
820 t_field(p_range, lat_range, lon_range),
821 vmr_field(
joker, p_range, lat_range, lon_range),
831 propmat_clearsky_agenda,
843 ext_matArray[1] = ext_mat_mono;
844 abs_vecArray[1] = abs_vec_mono;
845 tArray[1] = temperature;
846 pnd_vecArray[1] = pnd_vec;
851 termination_flag = 0;
853 while ((evol_op(0, 0) > r) && (!termination_flag)) {
856 if (istep > 100000) {
858 "100000 path points have been reached. " 859 "Is this an infinite loop?");
862 evol_opArray[0] = evol_opArray[1];
863 ext_matArray[0] = ext_matArray[1];
864 abs_vecArray[0] = abs_vecArray[1];
865 tArray[0] = tArray[1];
866 pnd_vecArray[0] = pnd_vecArray[1];
879 bool oktaustep =
false;
881 const Index lmax_limit = 10;
885 if (ip == ppath_step.
np - 1) {
886 Numeric lmax = taustep_limit / ext_mat_mono(0, 0);
887 if (ppath_lmax > 0) {
888 lmax =
min(ppath_lmax, lmax);
890 if (lmax < lmax_limit) {
900 f_grid[
Range(f_index, 1)],
920 propmat_clearsky_agenda,
928 t_field(p_range, lat_range, lon_range),
929 vmr_field(
joker, p_range, lat_range, lon_range),
939 propmat_clearsky_agenda,
950 dl = ppath_step.
lstep[ip - 1];
956 if (ppath_try > 1 || ext_mat_mono(0, 0) <= ext_matArray[0](0, 0) ||
957 (ext_mat_mono(0, 0) + ext_matArray[0](0, 0)) * dl / 2 <=
971 ext_matArray[1] = ext_mat_mono;
972 abs_vecArray[1] = abs_vec_mono;
973 tArray[1] = temperature;
974 pnd_vecArray[1] = pnd_vec;
975 ext_mat = ext_matArray[1];
976 ext_mat += ext_matArray[0];
979 Index extmat_case = 0;
980 ext2trans(incT, extmat_case, ext_mat, dl / 2);
983 mult(evol_op, evol_opArray[0], incT);
984 evol_opArray[1] = evol_op;
986 if (evol_op(0, 0) > r) {
991 if (ip == ppath_step.
np - 1) {
993 termination_flag = 2;
997 termination_flag = 1;
1003 if (termination_flag) {
1004 rte_pos = ppath_step.
pos(ip,
joker);
1005 rte_los = ppath_step.
los(ip,
joker);
1015 k = ext_mat(0, 0) / 2;
1016 ds = log(evol_opArray[0](0, 0) / r) / k;
1025 assert(gp[0].idx == 0);
1027 interp(ext_mat_mono, itw, ext_matArray, gp[0]);
1028 ext_mat = ext_mat_mono;
1029 ext_mat += ext_matArray[gp[0].idx];
1032 Index extmat_case = 0;
1033 ext2trans(incT, extmat_case, ext_mat, ds / 2);
1036 mult(evol_op, evol_opArray[gp[0].idx], incT);
1037 interp(abs_vec_mono, itw, abs_vecArray, gp[0]);
1038 temperature =
interp(itw, tArray, gp[0]);
1039 interp(pnd_vec, itw, pnd_vecArray, gp[0]);
1044 rte_pos[2] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), 2), gp[0]);
1047 assert(isfinite(g));
1050 const Index np = ip + 1;
1066 Index& termination_flag,
1068 const Agenda& ppath_step_agenda,
1070 const Numeric& ppath_lraytrace,
1071 const Agenda& propmat_clearsky_agenda,
1072 const bool& anyptype_nonTotRan,
1073 const Index stokes_dim,
1074 const Index f_index,
1081 const Vector& refellipsoid,
1093 Matrix ext_mat(stokes_dim, stokes_dim);
1094 Matrix incT(stokes_dim, stokes_dim, 0.0);
1096 Matrix T(stokes_dim, stokes_dim);
1098 Numeric ds, dt = -999, dl = -999;
1100 Matrix old_evol_op(stokes_dim, stokes_dim);
1111 evol_opArray[1] = evol_op;
1114 Range p_range(cloudbox_limits[0],
1115 cloudbox_limits[1] - cloudbox_limits[0] + 1);
1116 Range lat_range(cloudbox_limits[2],
1117 cloudbox_limits[3] - cloudbox_limits[2] + 1);
1118 Range lon_range(cloudbox_limits[4],
1119 cloudbox_limits[5] - cloudbox_limits[4] + 1);
1137 if (ppath_step.
np == 0) {
1138 termination_flag = 1;
1155 local_rte_los[0] = 180 - ppath_step.
los(0, 0);
1156 local_rte_los[1] = ppath_step.
los(0, 1) - 180;
1162 propmat_clearsky_agenda,
1170 t_field(p_range, lat_range, lon_range),
1171 vmr_field(
joker, p_range, lat_range, lon_range),
1181 propmat_clearsky_agenda,
1193 ext_matArray[1] = ext_mat_mono;
1194 abs_vecArray[1] = abs_vec_mono;
1195 tArray[1] = temperature;
1196 pnd_vecArray[1] = pnd_vec;
1201 termination_flag = 0;
1207 while ((evop0 > r) && (!termination_flag)) {
1210 if (istep > 25000) {
1211 throw runtime_error(
1212 "25000 path points have been reached. " 1213 "Is this an infinite loop?");
1216 evol_opArray[0] = evol_opArray[1];
1217 ext_matArray[0] = ext_matArray[1];
1218 abs_vecArray[0] = abs_vecArray[1];
1219 tArray[0] = tArray[1];
1220 pnd_vecArray[0] = pnd_vecArray[1];
1223 if (ip >= ppath_step.
np - 1) {
1229 f_grid[
Range(f_index, 1)],
1232 if (ppath_step.
np <= 1) {
1233 termination_flag = 1;
1246 dl = ppath_step.
lstep[ip - 1];
1247 dt = dl * 0.5 * (ppath_step.
ngroup[ip - 1] + ppath_step.
ngroup[ip]) /
1252 local_rte_los[0] = 180 - ppath_step.
los(ip, 0);
1253 local_rte_los[1] = ppath_step.
los(ip, 1) - 180;
1259 propmat_clearsky_agenda,
1263 ppath_step.
gp_p[ip],
1267 t_field(p_range, lat_range, lon_range),
1268 vmr_field(
joker, p_range, lat_range, lon_range),
1278 propmat_clearsky_agenda,
1280 ppath_step.
gp_p[ip],
1289 ext_matArray[1] = ext_mat_mono;
1290 abs_vecArray[1] = abs_vec_mono;
1291 tArray[1] = temperature;
1292 pnd_vecArray[1] = pnd_vec;
1293 ext_mat = ext_matArray[1];
1294 ext_mat += ext_matArray[0];
1297 Index extmat_case = 0;
1298 ext2trans(incT, extmat_case, ext_mat, dl / 2);
1302 mult(evol_op, incT, evol_opArray[0]);
1303 evol_opArray[1] = evol_op;
1304 evop0 = evol_op(0, 0);
1307 if (stokes_dim > 1 && anyptype_nonTotRan) {
1308 const Numeric Q1 = evol_op(0, 1) * Iprop[1] / Iprop[0];
1316 if (ip >= ppath_step.
np - 1) {
1318 termination_flag = 2;
1322 termination_flag = 1;
1328 if (termination_flag != 0) {
1329 if (ip < ppath_step.
np) {
1333 rte_pos = ppath_step.
pos(ip,
joker);
1334 rte_los = ppath_step.
los(ip,
joker);
1342 kI = ext_mat(0, 0) / 2;
1343 kQ = ext_mat(0, 1) / 2;
1344 if (anyptype_nonTotRan) {
1345 const Numeric I1 = evol_opArray[0](0, 0);
1346 const Numeric Q1 = evol_opArray[0](0, 1) * Iprop[1] / Iprop[0];
1350 ds, (
Numeric)0.0, ppath_step.
lstep[ip - 1], tol, r, I1, Q1, kI, kQ);
1353 ds = log(evol_opArray[0](0, 0) / r) / kI;
1356 ttot += ds * dt / dl;
1364 assert(gp[0].idx == 0);
1366 interp(ext_mat_mono, itw, ext_matArray, gp[0]);
1367 ext_mat = ext_mat_mono;
1368 ext_mat += ext_matArray[gp[0].idx];
1371 Index extmat_case = 0;
1372 ext2trans(incT, extmat_case, ext_mat, ds / 2);
1375 mult(evol_op, incT, evol_opArray[gp[0].idx]);
1376 interp(abs_vec_mono, itw, abs_vecArray, gp[0]);
1377 temperature =
interp(itw, tArray, gp[0]);
1378 interp(pnd_vec, itw, pnd_vecArray, gp[0]);
1383 rte_pos[2] =
interp(itw, ppath_step.
pos(
Range(ip - 1, 2), 2), gp[0]);
1387 const Index np = ip + 1;
1397 const Index f_index,
1398 const Index stokes_dim,
1402 const Numeric rtp_temperature,
1403 const Index t_interp_order) {
1405 bool tryagain =
true;
1414 Z11max += Z11maxvector[
i] * pnd_vec[
i];
1429 Matrix pdir(1, 2), idir(1, 2);
1430 Vector t(1, rtp_temperature);
1432 pnds(
joker, 0) = pnd_vec;
1435 new_rte_los[0] = acos(1 - 2 * rng.
draw()) *
RAD2DEG;
1436 new_rte_los[1] = rng.
draw() * 360 - 180;
1446 pdir(0,
joker) = sca_dir;
1447 idir(0,
joker) = inc_dir;
1459 pha_mat_ssbulk, ptype_ssbulk, pha_mat_Nse, ptypes_Nse, pnds, t_ok);
1460 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
1463 if (rng.
draw() <= Z(0, 0) / Z11max)
1468 g_los_csc_theta = Z(0, 0) / Csca;
1472 new_rte_los[1] = rng.
draw() * 360 - 180;
1473 new_rte_los[0] = acos(1 - 2 * rng.
draw()) *
RAD2DEG;
INDEX Index
The type to use for all integer numbers and indices.
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.
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
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.
VectorView VectorAtPosition(const Index iv=0, const Index iz=0, const Index ia=0)
Get a vectorview to the position.
Index nelem() const
Number of elements.
Interpolation classes and functions created for use within Monte Carlo scattering simulations...
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.
const Numeric SPEED_OF_LIGHT
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 gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
void MatrixAtPosition(MatrixView ret, const Index iv=0, const Index iz=0, const Index ia=0) const
Sets the dense matrix.
Matrix los
Line-of-sight at each ppath point.
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.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
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)
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Vector lstep
The length between ppath points.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
Numeric fractional_gp(const GridPos &gp)
fractional_gp
Numeric ext_I(const Numeric &I, const Numeric &Q, const Numeric &kI, const Numeric &kQ, const Numeric &s)
ext_I.
Matrix pos
The distance between start pos and the last position in pos.
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 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.
Vector ngroup
The group index of refraction.
Stokes vector is as Propagation matrix but only has 4 possible values.
void opt_prop_sum_propmat_clearsky(PropagationMatrix &ext_mat, StokesVector &abs_vec, const ArrayOfPropagationMatrix &propmat_clearsky)
Get optical properties from propmat_clearsky.
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.
Index nelem() const
Returns the number of elements.
Structure to store a grid position.
A constant view of a Tensor4.
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Numeric end_lstep
The distance between end pos and the first position in pos.
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
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 gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
NUMERIC Numeric
The type to use for all floating point numbers.
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 mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
double draw()
Draws a double from the uniform distribution [0,1)
This can be used to make arrays out of anything.
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.
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 Sample_los_uniform(VectorView new_rte_los, Rng &rng)
Sample_los_uniform.
A constant view of a Tensor3.
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.
A constant view of a Vector.
Index np
Number of points describing the ppath.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Index nbooks() const
Returns the number of books.
bool is_anyptype_nonTotRan(const ArrayOfArrayOfSingleScatteringData &scat_data)
is_anyptype_nonTotRan.
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 mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
void pha_mat_Bulk(Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss)
Scattering species bulk phase matrix.
void id_mat(MatrixView I)
Identity Matrix.
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)
The structure to describe a propagation path and releated quantities.
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 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.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
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.
void ext2trans(MatrixView trans_mat, Index &icase, ConstMatrixView ext_mat, const Numeric &lstep)
Converts an extinction matrix to a transmission matrix.
const Numeric RAD2DEG
Global constant, conversion from radians to degrees.
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.