89 Index& mc_iteration_count,
99 const Index& stokes_dim,
100 const Index& atmosphere_dim,
101 const Agenda& ppath_step_agenda,
103 const Numeric& ppath_lraytrace,
104 const Agenda& iy_space_agenda,
105 const Agenda& surface_rtprop_agenda,
106 const Agenda& propmat_clearsky_agenda,
111 const Vector& refellipsoid,
115 const Index& cloudbox_on,
119 const Index& atmfields_checked,
120 const Index& atmgeom_checked,
121 const Index& scat_data_checked,
122 const Index& cloudbox_checked,
124 const Index& mc_seed,
126 const Index& max_time,
127 const Index& max_iter,
128 const Index& min_iter,
130 const Index& l_mc_scat_order,
131 const Index& t_interp_order,
136 if (atmfields_checked != 1)
138 "The atmospheric fields must be flagged to have " 139 "passed a consistency check (atmfields_checked=1).");
140 if (atmgeom_checked != 1)
142 "The atmospheric geometry must be flagged to have " 143 "passed a consistency check (atmgeom_checked=1).");
146 throw runtime_error(
"The cloudbox must be activated (cloudbox_on=1).");
147 if (cloudbox_checked != 1)
149 "The cloudbox must be flagged to have " 150 "passed a consistency check (cloudbox_checked=1).");
151 if (scat_data_checked != 1)
153 "The scat_data must be flagged to have " 154 "passed a consistency check (scat_data_checked=1).");
156 if (min_iter < 100)
throw runtime_error(
"*mc_min_iter* must be >= 100.");
158 if (max_time < 0 && max_iter < 0 && std_err < 0)
160 "At least one of std_err, max_time, and max_iter " 161 "must be positive.");
163 if (l_mc_scat_order <= 0)
164 throw runtime_error(
"*l_max_scat_order* must be > 0.");
168 "The option of f_index < 0 is not handled by this " 170 if (f_index >= f_grid.
nelem())
171 throw runtime_error(
"*f_index* is outside the range of *f_grid*.");
173 if (atmosphere_dim != 3)
174 throw runtime_error(
"Only 3D atmospheres are handled. ");
176 if (sensor_pos.
ncols() != 3) {
178 os <<
"Expected number of columns in sensor_pos: 3.\n";
179 os <<
"Found: " << sensor_pos.
ncols();
180 throw runtime_error(os.
str());
182 if (sensor_pos.
nrows() != 1) {
184 os <<
"Expected number of rows in sensor_pos: 1.\n";
185 os <<
"Found: " << sensor_pos.
nrows();
186 throw runtime_error(os.
str());
189 if (!(sensor_los.
ncols() == 2)) {
191 os <<
"Expected number of columns in sensor_los: 2.\n";
192 os <<
"Found: " << sensor_los.
ncols();
193 throw runtime_error(os.
str());
195 if (!(sensor_los.
nrows() == 1)) {
197 os <<
"Expected number of rows in sensor_los: 1.\n";
198 os <<
"Found: " << sensor_los.
nrows();
199 throw runtime_error(os.
str());
204 time_t start_time = time(NULL);
213 Index this_f_index =
min(f_index, scat_data[0][0].f_grid.
nelem());
214 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++) {
215 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++) {
217 Z11maxvector[i_total] =
max(scat_data[i_ss][i_se].pha_mat_data(
222 rng.
seed(mc_seed, verbosity);
223 Numeric g, temperature, albedo, g_los_csc_theta;
224 Matrix A(stokes_dim, stokes_dim), Q(stokes_dim, stokes_dim);
225 Matrix evol_op(stokes_dim, stokes_dim), ext_mat_mono(stokes_dim, stokes_dim);
226 Matrix q(stokes_dim, stokes_dim), newQ(stokes_dim, stokes_dim);
227 Matrix Z(stokes_dim, stokes_dim);
229 R_stokes(stokes_dim, stokes_dim);
232 Vector vector1(stokes_dim), abs_vec_mono(stokes_dim), I_i(stokes_dim);
233 Vector Isum(stokes_dim), Isquaredsum(stokes_dim);
234 Index termination_flag = 0;
235 const Numeric f_mono = f_grid[f_index];
244 mc_iteration_count = 0;
245 mc_error.
resize(stokes_dim);
248 mc_scat_order.resize(l_mc_scat_order);
250 mc_source_domain.resize(4);
251 mc_source_domain = 0;
255 Matrix local_iy(1, stokes_dim), local_surface_emission(1, stokes_dim);
265 bool convert_to_rjbt =
false;
266 if (iy_unit ==
"RJBT") {
269 convert_to_rjbt =
true;
270 }
else if (iy_unit ==
"1") {
274 os <<
"Invalid value for *iy_unit*:" << iy_unit <<
".\n" 275 <<
"This method allows only the options \"RJBT\" and \"1\".";
276 throw runtime_error(os.
str());
284 bool keepgoing, oksampling;
293 mc_iteration_count += 1;
294 Index scattering_order = 0;
302 local_rte_los, R_prop, rng, R_ant2enu, sensor_los(0,
joker));
306 R_stokes, stokes_dim, prop_dir, prop_dir, R_prop, R_ant2enu);
308 local_rte_pos = sensor_pos(0,
joker);
329 propmat_clearsky_agenda,
357 mc_iteration_count -= 1;
358 out0 <<
"WARNING: A rejected path sampling (g=0)!\n(if this" 359 <<
"happens repeatedly, try to decrease *ppath_lmax*)";
360 }
else if (termination_flag == 1) {
371 mc_source_domain[0] += 1;
372 }
else if (termination_flag == 2) {
375 local_surface_skin_t,
376 local_surface_emission,
378 local_surface_rmatrix,
382 surface_rtprop_agenda);
389 if (local_surface_los.
empty()) {
394 mc_source_domain[1] += 1;
402 R11 += local_surface_rmatrix(
i, 0, 0, 0);
409 I_i /= g * (1 - R11);
411 mc_source_domain[1] += 1;
416 Numeric rsum = local_surface_rmatrix(i, 0, 0, 0);
419 rsum += local_surface_rmatrix(i, 0, 0, 0);
422 local_rte_los = local_surface_los(i,
joker);
427 Q /= g * local_surface_rmatrix(i, 0, 0, 0);
430 }
else if (inside_cloud) {
433 albedo = 1 - abs_vec_mono[0] / ext_mat_mono(0, 0);
436 if (rng.
draw() > albedo) {
439 Vector emission = abs_vec_mono;
440 emission *= planck_value;
441 Vector emissioncontri(stokes_dim);
442 mult(emissioncontri, evol_op, emission);
443 emissioncontri /= (g * (1 - albedo));
444 mult(I_i, Q, emissioncontri);
446 mc_source_domain[3] += 1;
459 ext_mat_mono(0, 0) - abs_vec_mono[0],
463 Z /= g * g_los_csc_theta * albedo;
468 scattering_order += 1;
469 local_rte_los = new_rte_los;
475 Vector emission = abs_vec_mono;
476 emission *= planck_value;
477 Vector emissioncontri(stokes_dim);
478 mult(emissioncontri, evol_op, emission);
480 mult(I_i, Q, emissioncontri);
482 mc_source_domain[2] += 1;
489 mc_points(ppath_step.gp_p[np - 1].idx,
490 ppath_step.gp_lat[np - 1].idx,
491 ppath_step.gp_lon[np - 1].idx) += 1;
492 if (scattering_order < l_mc_scat_order) {
493 mc_scat_order[scattering_order] += 1;
497 Vector I_hold(stokes_dim);
498 mult(I_hold, R_stokes, I_i);
501 for (
Index j = 0; j < stokes_dim; j++) {
502 assert(!std::isnan(I_i[j]));
503 Isquaredsum[j] += I_i[j] * I_i[j];
506 y /= (
Numeric)mc_iteration_count;
507 for (
Index j = 0; j < stokes_dim; j++) {
509 (Isquaredsum[j] / (
Numeric)mc_iteration_count - y[j] * y[j]) /
512 if (std_err > 0 && mc_iteration_count >= min_iter &&
513 mc_error[0] < std_err_i) {
516 if (max_time > 0 && (
Index)(time(NULL) - start_time) >= max_time) {
519 if (max_iter > 0 && mc_iteration_count >= max_iter) {
525 catch (
const std::runtime_error& e) {
526 mc_iteration_count += 1;
528 out0 <<
"WARNING: A MC path sampling failed! Error was:\n";
529 cout << e.what() << endl;
532 "The MC path sampling has failed five times. A few failures " 533 "should be OK, but this number is suspiciously high and the " 534 "reason to these failures should be tracked down.");
539 if (convert_to_rjbt) {
540 for (
Index j = 0; j < stokes_dim; j++) {
542 mc_error[j] =
invrayjean(mc_error[j], f_mono);
556 const Index& f_index,
559 const Index& stokes_dim,
560 const Index& atmosphere_dim,
562 const Agenda& ppath_step_agenda,
563 const Numeric& ppath_lraytrace,
564 const Agenda& propmat_clearsky_agenda,
569 const Vector& refellipsoid,
573 const Index& cloudbox_on,
579 const Index& atmfields_checked,
580 const Index& atmgeom_checked,
581 const Index& scat_data_checked,
582 const Index& cloudbox_checked,
584 const Index& mc_max_scatorder,
585 const Index& mc_seed,
586 const Index& mc_max_iter,
589 const Index& t_interp_order,
603 throw runtime_error(
"This method requires that stokes_dim >= 2");
604 if (atmfields_checked != 1)
606 "The atmospheric fields must be flagged to have " 607 "passed a consistency check (atmfields_checked=1).");
608 if (atmgeom_checked != 1)
610 "The atmospheric geometry must be flagged to have " 611 "passed a consistency check (atmgeom_checked=1).");
614 throw runtime_error(
"The cloudbox must be activated (cloudbox_on=1).");
615 if (cloudbox_checked != 1)
617 "The cloudbox must be flagged to have " 618 "passed a consistency check (cloudbox_checked=1).");
619 if (scat_data_checked != 1)
621 "The scat_data must be flagged to have " 622 "passed a consistency check (scat_data_checked=1).");
626 "The option of f_index < 0 is not handled by this " 628 if (f_index >= f_grid.
nelem())
629 throw runtime_error(
"*f_index* is outside the range of *f_grid*.");
631 if (atmosphere_dim != 3)
632 throw runtime_error(
"Only 3D atmospheres are handled.");
634 if (stokes_dim != mc_y_tx.
nelem())
635 throw runtime_error(
"*mc_y_tx* must have size of *stokes_dim*.");
637 if (sensor_pos.
ncols() != 3) {
639 os <<
"Expected number of columns in sensor_pos: 3.\n";
640 os <<
"Found: " << sensor_pos.
ncols();
641 throw runtime_error(os.
str());
644 if (sensor_los.
ncols() != 2) {
646 os <<
"Expected number of columns in sensor_los: 2.\n";
647 os <<
"Found: " << sensor_los.
ncols();
648 throw runtime_error(os.
str());
653 "mc_max_iter must be positive, " 654 "as it is the only limiter.");
658 "The vector *range_bins* must contain strictly " 659 "increasing values.");
663 "The vector *range_bins* is not allowed to contain " 664 "negative distance or round-trip time.");
668 "MCRadar only works with " 669 "Gaussian antenna patterns.");
678 bool is_dist =
max(range_bins) > 1;
679 rng.
seed(mc_seed, verbosity);
685 Matrix evol_op(stokes_dim, stokes_dim), ext_mat_mono(stokes_dim, stokes_dim);
686 Matrix trans_mat(stokes_dim, stokes_dim);
687 Matrix Z(stokes_dim, stokes_dim);
688 Matrix R_ant2enu(3, 3), R_enu2ant(3, 3), R_stokes(stokes_dim, stokes_dim);
689 Vector abs_vec_mono(stokes_dim), I_i(stokes_dim), I_i_rot(stokes_dim);
690 Vector Isum(nbins * stokes_dim), Isquaredsum(nbins * stokes_dim);
691 Index termination_flag = 0;
693 Vector range_bin_count(nbins);
706 Matrix pdir_array(1, 2), idir_array(1, 2);
716 const Numeric f_mono = f_grid[f_index];
720 for (
Index ibin = 0; ibin < nbins; ibin++) {
721 bin_height[ibin] = range_bins[ibin + 1] - range_bins[ibin];
727 y.
resize(nbins * stokes_dim);
734 mc_error.
resize(stokes_dim * nbins);
737 Matrix local_iy(1, stokes_dim), local_surface_emission(1, stokes_dim);
743 Vector Ipath(stokes_dim), Ihold(stokes_dim), Ipath_norm(stokes_dim);
751 if (iy_unit ==
"1") {
755 else if (iy_unit ==
"Ze") {
759 fac = cfac[0] / (2 *
PI);
762 os <<
"Invalid value for *iy_unit*:" << iy_unit <<
".\n" 763 <<
"This method allows only the options \"Ze\" and \"1\".";
764 throw runtime_error(os.
str());
772 bool keepgoing, firstpass, integrity;
773 while (mc_iter < mc_max_iter) {
785 local_rte_los, R_tx, rng, R_ant2enu, sensor_los(0,
joker));
786 rotmat_stokes(R_stokes, stokes_dim, tx_dir, tx_dir, R_ant2enu, R_tx);
787 mult(Ihold, R_stokes, mc_y_tx);
790 local_rte_pos = sensor_pos(0,
joker);
814 propmat_clearsky_agenda,
832 pnds(
joker, 0) = pnd_vec;
833 if (!inside_cloud || termination_flag != 0) {
840 Csca = ext_mat_mono(0, 0) - abs_vec_mono[0];
841 Cext = ext_mat_mono(0, 0);
842 if (anyptype_nonTotRan) {
843 const Numeric Irat = Ihold[1] / Ihold[0];
844 Csca += Irat * (ext_mat_mono(1, 0) - abs_vec_mono[1]);
845 Cext += Irat * ext_mat_mono(0, 1);
847 albedo = Csca / Cext;
866 mirror_los(rte_los_geom, local_rte_los, atmosphere_dim);
876 sensor_pos(0,
joker),
885 Vector rte_los_antenna(2);
886 ppath_lraytrace_var = ppath_lraytrace;
896 sensor_pos(0,
joker),
913 sensor_pos(0,
joker),
925 for (
Index ip = 1; ip < np2; ip++) {
926 s_return += ppath.
lstep[ip - 1];
927 t_return += ppath.
lstep[ip - 1] * 0.5 *
934 r_trav = 0.5 * (s_tot + s_return);
939 r_trav = t_tot + t_return;
943 if (r_trav <= r_max) {
948 propmat_clearsky_agenda,
961 Matrix P(stokes_dim, stokes_dim);
963 pdir_array(0,
joker) = rte_los_geom;
964 idir_array(0,
joker) = local_rte_los;
981 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
988 mult(Ipath, evol_op, Ihold);
991 mult(Ihold, P, Ipath);
992 mult(I_i, trans_mat, Ihold);
994 if (Ihold[0] < 1e-40 || std::isnan(Ihold[0]) ||
995 std::isnan(Ihold[1]) ||
996 (stokes_dim > 2 && std::isnan(Ihold[2])) ||
997 (stokes_dim > 3 && std::isnan(Ihold[3]))) {
1001 if (r_trav > r_min && integrity) {
1005 while (r_bin < r_trav && ibin <= nbins + 1) {
1007 r_bin = range_bins[ibin];
1014 mc_antenna.
return_los(antenna_wgt, R_rx, R_enu2ant);
1016 R_stokes, stokes_dim, rx_dir, tx_dir, R_rx, R_ant2enu);
1017 mult(I_i_rot, R_stokes, I_i);
1019 for (
Index istokes = 0; istokes < stokes_dim; istokes++) {
1020 Index ibiny = ibin * stokes_dim + istokes;
1021 assert(!std::isnan(I_i_rot[istokes]));
1022 Isum[ibiny] += antenna_wgt * I_i_rot[istokes];
1023 Isquaredsum[ibiny] += antenna_wgt * antenna_wgt *
1024 I_i_rot[istokes] * I_i_rot[istokes];
1026 range_bin_count[ibin] += 1;
1032 pdir_array(0,
joker) = new_rte_los;
1051 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
1056 mult(Ipath, Z, Ihold);
1058 local_rte_los = new_rte_los;
1071 if (scat_order >= mc_max_scatorder) keepgoing =
false;
1072 if (!integrity) keepgoing =
false;
1078 for (
Index ibin = 0; ibin < nbins; ibin++) {
1079 for (
Index istokes = 0; istokes < stokes_dim; istokes++) {
1080 Index ibiny = ibin * stokes_dim + istokes;
1081 if (range_bin_count[ibin] > 0) {
1082 y[ibiny] = Isum[ibiny] / ((
Numeric)mc_iter) / bin_height[ibin];
1083 mc_error[ibiny] =
sqrt((Isquaredsum[ibiny] / (
Numeric)mc_iter /
1084 bin_height[ibin] / bin_height[ibin] -
1085 y[ibiny] * y[ibiny]) /
1097 mc_seed = (
Index)time(NULL);
INDEX Index
The type to use for all integer numbers and indices.
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 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 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
Number of elements.
bool empty() const
Returns true if variable size is zero.
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.
Declarations having to do with the four output streams.
void set_gaussian(const Numeric &za_sigma, const Numeric &aa_sigma)
set_gaussian.
Numeric invrayjean(const Numeric &i, const Numeric &f)
invrayjean
Numeric fac(const Index n)
fac
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
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.
Vector lstep
The length between ppath points.
Linear algebra functions.
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.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
This file contains basic functions to handle XML data files.
void mc_antennaSetPencilBeam(MCAntenna &mc_antenna, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetPencilBeam.
Vector ngroup
The group index of refraction.
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.
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, 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.
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.
Numeric end_lstep
The distance between end pos and the first position in pos.
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 mc_antennaSetGaussianByFWHM(MCAntenna &mc_antenna, const Numeric &za_fwhm, const Numeric &aa_fwhm, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetGaussianByFWHM.
const Numeric SPEED_OF_LIGHT
Index ncols() const
Returns the number of columns.
The global header file for ARTS.
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.
_CS_string_type str() const
void iy_space_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
member functions of the Rng class and gsl_rng code
Numeric vector1(const StokesVector &a, const ConstVectorView &B, const StokesVector &da, const ConstVectorView &dB_dT, const StokesVector &dS, bool dT, Index i) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
const Numeric BOLTZMAN_CONST
void set_pencil_beam()
set_pencil_beam
void draw_los(VectorView sampled_rte_los, MatrixView R_los, Rng &rng, ConstMatrixView R_ant2enu, ConstVectorView bore_sight_los) const
draw_los.
An Antenna object used by MCGeneral.
Implementation of Matrix, Vector, and such stuff.
Header file for special_interp.cc.
Propagation path structure and functions.
void resize(Index p, Index r, Index c)
Resize function.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
double draw()
Draws a double from the uniform distribution [0,1)
Header file for logic.cc.
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 Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Numeric &f_mono, 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 Tensor3 &edensity_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_array_mono, const Verbosity &verbosity)
mcPathTraceGeneral
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
void MCSetSeedFromTime(Index &mc_seed, const Verbosity &)
WORKSPACE METHOD: MCSetSeedFromTime.
void Sample_los_uniform(VectorView new_rte_los, Rng &rng)
Sample_los_uniform.
void return_los(Numeric &wgt, ConstMatrixView R_return, ConstMatrixView R_enu2ant) const
return_los
void resize(Index n)
Resize function.
Index np
Number of points describing the ppath.
AntennaType get_type() const
AntennaType get_type.
void mc_antennaSetGaussian(MCAntenna &mc_antenna, const Numeric &za_sigma, const Numeric &aa_sigma, const Verbosity &)
WORKSPACE METHOD: mc_antennaSetGaussian.
Numeric planck(const Numeric &f, const Numeric &t)
planck
Index nbooks() const
Returns the number of books.
bool is_anyptype_nonTotRan(const ArrayOfArrayOfSingleScatteringData &scat_data)
is_anyptype_nonTotRan.
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 rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los)
rotmat_enu.
void seed(unsigned long int n, const Verbosity &verbosity)
Seeds the Rng with the integer argument.
The structure to describe a propagation path and releated quantities.
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 set_gaussian_fwhm(const Numeric &za_fwhm, const Numeric &aa_fwhm)
set_gaussian_fwhm.
This file contains declerations of functions of physical character.
Index nrows() const
Returns the number of rows.
Declaration of functions in rte.cc.
Numeric sqrt(const Rational r)
Square root.