91 Index& mc_iteration_count,
101 const Index& stokes_dim,
102 const Index& atmosphere_dim,
103 const Agenda& ppath_step_agenda,
105 const Numeric& ppath_lraytrace,
106 const Agenda& iy_space_agenda,
107 const Agenda& surface_rtprop_agenda,
108 const Agenda& propmat_clearsky_agenda,
113 const Vector& refellipsoid,
117 const Index& cloudbox_on,
121 const Index& atmfields_checked,
122 const Index& atmgeom_checked,
123 const Index& scat_data_checked,
124 const Index& cloudbox_checked,
126 const Index& mc_seed,
128 const Index& max_time,
129 const Index& max_iter,
130 const Index& min_iter,
132 const Index& l_mc_scat_order,
133 const Index& t_interp_order,
138 if (atmfields_checked != 1)
140 "The atmospheric fields must be flagged to have "
141 "passed a consistency check (atmfields_checked=1).");
142 if (atmgeom_checked != 1)
144 "The atmospheric geometry must be flagged to have "
145 "passed a consistency check (atmgeom_checked=1).");
148 throw runtime_error(
"The cloudbox must be activated (cloudbox_on=1).");
149 if (cloudbox_checked != 1)
151 "The cloudbox must be flagged to have "
152 "passed a consistency check (cloudbox_checked=1).");
153 if (scat_data_checked != 1)
155 "The scat_data must be flagged to have "
156 "passed a consistency check (scat_data_checked=1).");
158 if (min_iter < 100)
throw runtime_error(
"*mc_min_iter* must be >= 100.");
160 if (max_time < 0 && max_iter < 0 && std_err < 0)
162 "At least one of std_err, max_time, and max_iter "
163 "must be positive.");
165 if (l_mc_scat_order <= 0)
166 throw runtime_error(
"*l_max_scat_order* must be > 0.");
170 "The option of f_index < 0 is not handled by this "
172 if (f_index >= f_grid.
nelem())
173 throw runtime_error(
"*f_index* is outside the range of *f_grid*.");
175 if (atmosphere_dim != 3)
176 throw runtime_error(
"Only 3D atmospheres are handled. ");
178 if (sensor_pos.
ncols() != 3) {
180 os <<
"Expected number of columns in sensor_pos: 3.\n";
181 os <<
"Found: " << sensor_pos.
ncols();
182 throw runtime_error(os.str());
184 if (sensor_pos.
nrows() != 1) {
186 os <<
"Expected number of rows in sensor_pos: 1.\n";
187 os <<
"Found: " << sensor_pos.
nrows();
188 throw runtime_error(os.str());
191 if (!(sensor_los.
ncols() == 2)) {
193 os <<
"Expected number of columns in sensor_los: 2.\n";
194 os <<
"Found: " << sensor_los.
ncols();
195 throw runtime_error(os.str());
197 if (!(sensor_los.
nrows() == 1)) {
199 os <<
"Expected number of rows in sensor_los: 1.\n";
200 os <<
"Found: " << sensor_los.
nrows();
201 throw runtime_error(os.str());
206 time_t start_time = time(NULL);
215 Index this_f_index =
min(f_index, scat_data[0][0].f_grid.
nelem());
216 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++) {
217 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++) {
219 Z11maxvector[i_total] =
max(scat_data[i_ss][i_se].pha_mat_data(
224 rng.
seed(mc_seed, verbosity);
225 Numeric g, temperature, albedo, g_los_csc_theta;
226 Matrix A(stokes_dim, stokes_dim), Q(stokes_dim, stokes_dim);
227 Matrix evol_op(stokes_dim, stokes_dim), ext_mat_mono(stokes_dim, stokes_dim);
228 Matrix q(stokes_dim, stokes_dim), newQ(stokes_dim, stokes_dim);
229 Matrix Z(stokes_dim, stokes_dim);
231 R_stokes(stokes_dim, stokes_dim);
234 Vector vector1(stokes_dim), abs_vec_mono(stokes_dim), I_i(stokes_dim);
235 Vector Isum(stokes_dim), Isquaredsum(stokes_dim);
236 Index termination_flag = 0;
237 const Numeric f_mono = f_grid[f_index];
246 mc_iteration_count = 0;
247 mc_error.
resize(stokes_dim);
250 mc_scat_order.resize(l_mc_scat_order);
252 mc_source_domain.resize(4);
253 mc_source_domain = 0;
257 Matrix local_iy(1, stokes_dim), local_surface_emission(1, stokes_dim);
267 bool convert_to_rjbt =
false;
268 if (iy_unit ==
"RJBT") {
271 convert_to_rjbt =
true;
272 }
else if (iy_unit ==
"1") {
276 os <<
"Invalid value for *iy_unit*:" << iy_unit <<
".\n"
277 <<
"This method allows only the options \"RJBT\" and \"1\".";
278 throw runtime_error(os.str());
286 bool keepgoing, oksampling;
295 mc_iteration_count += 1;
296 Index scattering_order = 0;
304 local_rte_los, R_prop, rng, R_ant2enu, sensor_los(0,
joker));
308 R_stokes, stokes_dim, prop_dir, prop_dir, R_prop, R_ant2enu);
310 local_rte_pos = sensor_pos(0,
joker);
331 propmat_clearsky_agenda,
359 mc_iteration_count -= 1;
360 out0 <<
"WARNING: A rejected path sampling (g=0)!\n(if this"
361 <<
"happens repeatedly, try to decrease *ppath_lmax*)";
362 }
else if (termination_flag == 1) {
369 mult(vector1, evol_op, local_iy(0,
joker));
370 mult(I_i, Q, vector1);
373 mc_source_domain[0] += 1;
374 }
else if (termination_flag == 2) {
377 local_surface_skin_t,
378 local_surface_emission,
380 local_surface_rmatrix,
384 surface_rtprop_agenda);
391 if (local_surface_los.
empty()) {
392 mult(vector1, evol_op, local_surface_emission(0,
joker));
393 mult(I_i, Q, vector1);
396 mc_source_domain[1] += 1;
403 for (
Index i = 0; i < local_surface_rmatrix.
nbooks(); i++) {
404 R11 += local_surface_rmatrix(i, 0, 0, 0);
409 mult(vector1, evol_op, local_surface_emission(0,
joker));
410 mult(I_i, Q, vector1);
411 I_i /= g * (1 - R11);
413 mc_source_domain[1] += 1;
418 Numeric rsum = local_surface_rmatrix(i, 0, 0, 0);
421 rsum += local_surface_rmatrix(i, 0, 0, 0);
424 local_rte_los = local_surface_los(i,
joker);
429 Q /= g * local_surface_rmatrix(i, 0, 0, 0);
432 }
else if (inside_cloud) {
435 albedo = 1 - abs_vec_mono[0] / ext_mat_mono(0, 0);
438 if (rng.
draw() > albedo) {
441 Vector emission = abs_vec_mono;
442 emission *= planck_value;
443 Vector emissioncontri(stokes_dim);
444 mult(emissioncontri, evol_op, emission);
445 emissioncontri /= (g * (1 - albedo));
446 mult(I_i, Q, emissioncontri);
448 mc_source_domain[3] += 1;
461 ext_mat_mono(0, 0) - abs_vec_mono[0],
465 Z /= g * g_los_csc_theta * albedo;
470 scattering_order += 1;
471 local_rte_los = new_rte_los;
477 Vector emission = abs_vec_mono;
478 emission *= planck_value;
479 Vector emissioncontri(stokes_dim);
480 mult(emissioncontri, evol_op, emission);
482 mult(I_i, Q, emissioncontri);
484 mc_source_domain[2] += 1;
491 mc_points(ppath_step.
gp_p[np - 1].idx,
492 ppath_step.
gp_lat[np - 1].idx,
493 ppath_step.
gp_lon[np - 1].idx) += 1;
494 if (scattering_order < l_mc_scat_order) {
495 mc_scat_order[scattering_order] += 1;
499 Vector I_hold(stokes_dim);
500 mult(I_hold, R_stokes, I_i);
503 for (
Index j = 0; j < stokes_dim; j++) {
505 Isquaredsum[j] += I_i[j] * I_i[j];
508 y /= (
Numeric)mc_iteration_count;
509 for (
Index j = 0; j < stokes_dim; j++) {
511 (Isquaredsum[j] / (
Numeric)mc_iteration_count - y[j] * y[j]) /
514 if (std_err > 0 && mc_iteration_count >= min_iter &&
515 mc_error[0] < std_err_i) {
518 if (max_time > 0 && (
Index)(time(NULL) - start_time) >= max_time) {
521 if (max_iter > 0 && mc_iteration_count >= max_iter) {
527 catch (
const std::runtime_error& e) {
528 mc_iteration_count += 1;
530 out0 <<
"WARNING: A MC path sampling failed! Error was:\n";
531 cout << e.what() << endl;
534 "The MC path sampling has failed five times. A few failures "
535 "should be OK, but this number is suspiciously high and the "
536 "reason to these failures should be tracked down.");
541 if (convert_to_rjbt) {
542 for (
Index j = 0; j < stokes_dim; j++) {
544 mc_error[j] =
invrayjean(mc_error[j], f_mono);
560 const Index& f_index,
563 const Index& stokes_dim,
564 const Index& atmosphere_dim,
566 const Agenda& ppath_step_agenda,
567 const Numeric& ppath_lraytrace,
568 const Agenda& propmat_clearsky_agenda,
573 const Vector& refellipsoid,
577 const Index& cloudbox_on,
583 const Index& atmfields_checked,
584 const Index& atmgeom_checked,
585 const Index& scat_data_checked,
586 const Index& cloudbox_checked,
587 const String& iy_unit_radar,
588 const Index& mc_max_scatorder,
589 const Index& mc_seed,
590 const Index& mc_max_iter,
593 const Index& t_interp_order,
607 throw runtime_error(
"This method requires that stokes_dim >= 2");
608 if (atmfields_checked != 1)
610 "The atmospheric fields must be flagged to have "
611 "passed a consistency check (atmfields_checked=1).");
612 if (atmgeom_checked != 1)
614 "The atmospheric geometry must be flagged to have "
615 "passed a consistency check (atmgeom_checked=1).");
618 throw runtime_error(
"The cloudbox must be activated (cloudbox_on=1).");
619 if (cloudbox_checked != 1)
621 "The cloudbox must be flagged to have "
622 "passed a consistency check (cloudbox_checked=1).");
623 if (scat_data_checked != 1)
625 "The scat_data must be flagged to have "
626 "passed a consistency check (scat_data_checked=1).");
630 "The option of f_index < 0 is not handled by this "
632 if (f_index >= f_grid.
nelem())
633 throw runtime_error(
"*f_index* is outside the range of *f_grid*.");
635 if (atmosphere_dim != 3)
636 throw runtime_error(
"Only 3D atmospheres are handled.");
638 if (stokes_dim != mc_y_tx.
nelem())
639 throw runtime_error(
"*mc_y_tx* must have size of *stokes_dim*.");
641 if (sensor_pos.
ncols() != 3) {
643 os <<
"Expected number of columns in sensor_pos: 3.\n";
644 os <<
"Found: " << sensor_pos.
ncols();
645 throw runtime_error(os.str());
648 if (sensor_los.
ncols() != 2) {
650 os <<
"Expected number of columns in sensor_los: 2.\n";
651 os <<
"Found: " << sensor_los.
ncols();
652 throw runtime_error(os.str());
657 "mc_max_iter must be positive, "
658 "as it is the only limiter.");
662 "The vector *range_bins* must contain strictly "
663 "increasing values.");
667 "The vector *range_bins* is not allowed to contain "
668 "negative distance or round-trip time.");
672 "MCRadar only works with "
673 "Gaussian antenna patterns.");
682 bool is_dist =
max(range_bins) > 1;
683 rng.
seed(mc_seed, verbosity);
689 Matrix evol_op(stokes_dim, stokes_dim), ext_mat_mono(stokes_dim, stokes_dim);
690 Matrix trans_mat(stokes_dim, stokes_dim);
691 Matrix Z(stokes_dim, stokes_dim);
692 Matrix R_ant2enu(3, 3), R_enu2ant(3, 3), R_stokes(stokes_dim, stokes_dim);
693 Vector abs_vec_mono(stokes_dim), I_i(stokes_dim), I_i_rot(stokes_dim);
694 Vector Isum(nbins * stokes_dim), Isquaredsum(nbins * stokes_dim);
695 Index termination_flag = 0;
697 Vector range_bin_count(nbins);
710 Matrix pdir_array(1, 2), idir_array(1, 2);
720 const Numeric f_mono = f_grid[f_index];
724 for (
Index ibin = 0; ibin < nbins; ibin++) {
725 bin_height[ibin] = range_bins[ibin + 1] - range_bins[ibin];
731 y.
resize(nbins * stokes_dim);
738 mc_error.
resize(stokes_dim * nbins);
741 Matrix local_iy(1, stokes_dim), local_surface_emission(1, stokes_dim);
747 Vector Ipath(stokes_dim), Ihold(stokes_dim), Ipath_norm(stokes_dim);
755 if (iy_unit_radar ==
"1") {
759 else if (iy_unit_radar ==
"Ze") {
763 fac = cfac[0] / (2 *
PI);
766 os <<
"Invalid value for *iy_unit_radar*:" << iy_unit_radar <<
".\n"
767 <<
"This method allows only the options \"Ze\" and \"1\".";
768 throw runtime_error(os.str());
776 bool keepgoing, firstpass, integrity;
777 while (mc_iter < mc_max_iter) {
789 local_rte_los, R_tx, rng, R_ant2enu, sensor_los(0,
joker));
790 rotmat_stokes(R_stokes, stokes_dim, tx_dir, tx_dir, R_ant2enu, R_tx);
791 mult(Ihold, R_stokes, mc_y_tx);
794 local_rte_pos = sensor_pos(0,
joker);
818 propmat_clearsky_agenda,
836 pnds(
joker, 0) = pnd_vec;
837 if (!inside_cloud || termination_flag != 0) {
844 Csca = ext_mat_mono(0, 0) - abs_vec_mono[0];
845 Cext = ext_mat_mono(0, 0);
846 if (anyptype_nonTotRan) {
847 const Numeric Irat = Ihold[1] / Ihold[0];
848 Csca += Irat * (ext_mat_mono(1, 0) - abs_vec_mono[1]);
849 Cext += Irat * ext_mat_mono(0, 1);
851 albedo = Csca / Cext;
870 mirror_los(rte_los_geom, local_rte_los, atmosphere_dim);
880 sensor_pos(0,
joker),
889 Vector rte_los_antenna(2);
890 ppath_lraytrace_var = ppath_lraytrace;
900 sensor_pos(0,
joker),
917 sensor_pos(0,
joker),
929 for (
Index ip = 1; ip < np2; ip++) {
930 s_return += ppath.
lstep[ip - 1];
931 t_return += ppath.
lstep[ip - 1] * 0.5 *
938 r_trav = 0.5 * (s_tot + s_return);
943 r_trav = t_tot + t_return;
947 if (r_trav <= r_max) {
952 propmat_clearsky_agenda,
965 Matrix P(stokes_dim, stokes_dim);
967 pdir_array(0,
joker) = rte_los_geom;
968 idir_array(0,
joker) = local_rte_los;
985 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
992 mult(Ipath, evol_op, Ihold);
995 mult(Ihold, P, Ipath);
996 mult(I_i, trans_mat, Ihold);
998 if (Ihold[0] < 1e-40 || std::isnan(Ihold[0]) ||
999 std::isnan(Ihold[1]) ||
1000 (stokes_dim > 2 && std::isnan(Ihold[2])) ||
1001 (stokes_dim > 3 && std::isnan(Ihold[3]))) {
1005 if (r_trav > r_min && integrity) {
1009 while (r_bin < r_trav && ibin <= nbins + 1) {
1011 r_bin = range_bins[ibin];
1018 mc_antenna.
return_los(antenna_wgt, R_rx, R_enu2ant);
1020 R_stokes, stokes_dim, rx_dir, tx_dir, R_rx, R_ant2enu);
1021 mult(I_i_rot, R_stokes, I_i);
1023 for (
Index istokes = 0; istokes < stokes_dim; istokes++) {
1024 Index ibiny = ibin * stokes_dim + istokes;
1026 Isum[ibiny] += antenna_wgt * I_i_rot[istokes];
1027 Isquaredsum[ibiny] += antenna_wgt * antenna_wgt *
1028 I_i_rot[istokes] * I_i_rot[istokes];
1030 range_bin_count[ibin] += 1;
1036 pdir_array(0,
joker) = new_rte_los;
1055 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
1060 mult(Ipath, Z, Ihold);
1062 local_rte_los = new_rte_los;
1075 if (scat_order >= mc_max_scatorder) keepgoing =
false;
1076 if (!integrity) keepgoing =
false;
1082 for (
Index ibin = 0; ibin < nbins; ibin++) {
1083 for (
Index istokes = 0; istokes < stokes_dim; istokes++) {
1084 Index ibiny = ibin * stokes_dim + istokes;
1085 if (range_bin_count[ibin] > 0) {
1086 y[ibiny] = Isum[ibiny] / ((
Numeric)mc_iter) / bin_height[ibin];
1087 mc_error[ibiny] =
sqrt((Isquaredsum[ibiny] / (
Numeric)mc_iter /
1088 bin_height[ibin] / bin_height[ibin] -
1089 y[ibiny] * y[ibiny]) /
1101 mc_seed = (
Index)time(NULL);
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
The global header file for ARTS.
Constants of physical expressions as constexpr.
void iy_space_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void surface_rtprop_agendaExecute(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Index nelem() const ARTS_NOEXCEPT
bool empty() const noexcept
Index nrows() const noexcept
Index ncols() const noexcept
Index nbooks() const noexcept
Index nelem() const noexcept
Returns the number of elements.
double draw()
Draws a double from the uniform distribution [0,1)
void seed(unsigned long int n, const Verbosity &verbosity)
Seeds the Rng with the integer argument.
void resize(Index p, Index r, Index c)
Resize function.
void resize(Index n)
Resize function.
void mult(MatrixView C, ConstMatrixView A, const Block &B)
#define ARTS_ASSERT(condition,...)
void id_mat(MatrixView I)
Identity Matrix.
Linear algebra functions.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
void MCRadar(Workspace &ws, Vector &y, Vector &mc_error, const MCAntenna &mc_antenna, const Vector &f_grid, const Index &f_index, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &stokes_dim, const Index &atmosphere_dim, const Numeric &ppath_lmax, const Agenda &ppath_step_agenda, const Numeric &ppath_lraytrace, const Agenda &propmat_clearsky_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Vector &mc_y_tx, const Vector &range_bins, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &scat_data_checked, const Index &cloudbox_checked, const String &iy_unit_radar, const Index &mc_max_scatorder, const Index &mc_seed, const Index &mc_max_iter, const Numeric &ze_tref, const Numeric &k2, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: MCRadar.
constexpr Numeric BOLTZMAN_CONST
constexpr Numeric SPEED_OF_LIGHT
constexpr Numeric DEG2RAD
void mc_antennaSetPencilBeam(MCAntenna &mc_antenna, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetPencilBeam.
void MCSetSeedFromTime(Index &mc_seed, const Verbosity &)
WORKSPACE METHOD: MCSetSeedFromTime.
constexpr Numeric RAD2DEG
void MCGeneral(Workspace &ws, Vector &y, Index &mc_iteration_count, Vector &mc_error, Tensor3 &mc_points, ArrayOfIndex &mc_source_domain, ArrayOfIndex &mc_scat_order, const MCAntenna &mc_antenna, const Vector &f_grid, const Index &f_index, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &stokes_dim, const Index &atmosphere_dim, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Agenda &iy_space_agenda, const Agenda &surface_rtprop_agenda, const Agenda &propmat_clearsky_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &scat_data_checked, const Index &cloudbox_checked, const String &iy_unit, const Index &mc_seed, const Numeric &std_err, const Index &max_time, const Index &max_iter, const Index &min_iter, const Numeric &taustep_limit, const Index &l_mc_scat_order, const Index &t_interp_order, const Verbosity &verbosity)
WORKSPACE METHOD: MCGeneral.
void mc_antennaSetGaussian(MCAntenna &mc_antenna, const Numeric &za_sigma, const Numeric &aa_sigma, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetGaussian.
void mc_antennaSetGaussianByFWHM(MCAntenna &mc_antenna, const Numeric &za_fwhm, const Numeric &aa_fwhm, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetGaussianByFWHM.
void rte_losGeometricFromRtePosToRtePos2(Vector &rte_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Vector &rte_pos, const Vector &rte_pos2, const Verbosity &)
WORKSPACE METHOD: rte_losGeometricFromRtePosToRtePos2.
void ppathFromRtePos2(Workspace &ws, Ppath &ppath, Vector &rte_los, Numeric &ppath_lraytrace, 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 Vector &rte_pos, const Vector &rte_pos2, const Numeric &ppath_lmax, const Numeric &za_accuracy, const Numeric &pplrt_factor, const Numeric &pplrt_lowest, const Verbosity &verbosity)
WORKSPACE METHOD: ppathFromRtePos2.
Numeric fac(const Index n)
fac
Implementation of Matrix, Vector, and such stuff.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
void rotmat_stokes(MatrixView R_pra, const Index &stokes_dim, const Numeric &f1_dir, const Numeric &f2_dir, ConstMatrixView R_f1, ConstMatrixView R_f2)
rotmat_stokes.
void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los)
rotmat_enu.
Interpolation classes and functions created for use within Monte Carlo scattering simulations.
Declarations having to do with the four output streams.
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 Sample_los_uniform(VectorView new_rte_los, Rng &rng)
Sample_los_uniform.
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.
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 boltzmann_constant
Boltzmann constant [J/K] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date:...
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr Numeric speed_of_light
Speed of light [m/s] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date: 201...
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.
constexpr auto rad2deg(auto x) noexcept
Converts radians to degrees.
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 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.
Numeric planck(const Numeric &f, const Numeric &t)
planck
Numeric invrayjean(const Numeric &i, const Numeric &f)
invrayjean
This file contains declerations of functions of physical character.
Propagation path structure and functions.
Numeric sqrt(const Rational r)
Square root.
member functions of the Rng class and gsl_rng code
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 mirror_los(Vector &los_mirrored, const ConstVectorView &los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
Declaration of functions in rte.cc.
Header file for special_interp.cc.
An Antenna object used by MCGeneral.
void draw_los(VectorView sampled_rte_los, MatrixView R_los, Rng &rng, ConstMatrixView R_ant2enu, ConstVectorView bore_sight_los) const
draw_los.
void return_los(Numeric &wgt, ConstMatrixView R_return, ConstMatrixView R_enu2ant) const
return_los
void set_gaussian(const Numeric &za_sigma, const Numeric &aa_sigma)
set_gaussian.
void set_gaussian_fwhm(const Numeric &za_fwhm, const Numeric &aa_fwhm)
set_gaussian_fwhm.
void set_pencil_beam()
set_pencil_beam
The structure to describe a propagation path and releated quantities.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Index np
Number of points describing the ppath.
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.
This file contains basic functions to handle XML data files.