ARTS  2.2.66
m_montecarlo.cc File Reference

Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods. All of these functions refer to 3D calculations. More...

#include "messages.h"
#include "arts.h"
#include "auto_md.h"
#include "ppath.h"
#include "matpackI.h"
#include "special_interp.h"
#include "check_input.h"
#include <stdexcept>
#include <cmath>
#include "rte.h"
#include "lin_alg.h"
#include "logic.h"
#include "physics_funcs.h"
#include "xml_io.h"
#include "montecarlo.h"
#include "rng.h"
#include <ctime>
#include <fstream>
#include "mc_interp.h"
#include "math_funcs.h"
Include dependency graph for m_montecarlo.cc:

Go to the source code of this file.

Functions

void mc_antennaSetGaussian (MCAntenna &mc_antenna, const Numeric &za_sigma, const Numeric &aa_sigma, const Verbosity &)
 WORKSPACE METHOD: mc_antennaSetGaussian. More...
 
void mc_antennaSetGaussianByFWHM (MCAntenna &mc_antenna, const Numeric &za_fwhm, const Numeric &aa_fwhm, const Verbosity &)
 WORKSPACE METHOD: mc_antennaSetGaussianByFWHM. More...
 
void mc_antennaSetPencilBeam (MCAntenna &mc_antenna, const Verbosity &)
 WORKSPACE METHOD: mc_antennaSetPencilBeam. More...
 
void MCGeneral (Workspace &ws, Vector &y, Index &mc_iteration_count, Vector &mc_error, Tensor3 &mc_points, 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_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 ArrayOfSingleScatteringData &scat_data_array_mono, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &mc_seed, const String &y_unit, const Numeric &std_err, const Index &max_time, const Index &max_iter, const Index &min_iter, const Verbosity &verbosity)
 WORKSPACE METHOD: MCGeneral. More...
 
void MCSetSeedFromTime (Index &mc_seed, const Verbosity &)
 WORKSPACE METHOD: MCSetSeedFromTime. More...
 

Variables

const Numeric DEG2RAD
 
const Numeric RAD2DEG
 
const Numeric PI
 
const Numeric BOLTZMAN_CONST
 
const Numeric SPEED_OF_LIGHT
 

Detailed Description

Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods. All of these functions refer to 3D calculations.

Author
Cory Davis cory@.nosp@m.met..nosp@m.ed.ac.nosp@m..uk
Date
2003-06-19

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_montecarlo.cc.

Function Documentation

◆ mc_antennaSetGaussian()

void mc_antennaSetGaussian ( MCAntenna mc_antenna,
const Numeric za_sigma,
const Numeric aa_sigma,
const Verbosity verbosity 
)

WORKSPACE METHOD: mc_antennaSetGaussian.

Makes mc_antenna (used by MCGeneral) a 2D Gaussian pattern.

The gaussian antenna pattern is determined by za_sigma and aa_sigma*, which represent the standard deviations in the uncorrelated bivariate normal distribution.

Author
Cory Davis
Parameters
[out]mc_antennaWS Output
[in]za_sigmaGeneric Input
[in]aa_sigmaGeneric Input

Definition at line 73 of file m_montecarlo.cc.

References MCAntenna::set_gaussian().

Referenced by mc_antennaSetGaussian_g().

◆ mc_antennaSetGaussianByFWHM()

void mc_antennaSetGaussianByFWHM ( MCAntenna mc_antenna,
const Numeric za_fwhm,
const Numeric aa_fwhm,
const Verbosity verbosity 
)

WORKSPACE METHOD: mc_antennaSetGaussianByFWHM.

Makes mc_antenna (used by MCGeneral) a 2D Gaussian pattern.

The gaussian antenna pattern is determined by za_fwhm and aa_fwhm*, which represent the full width half maximum (FWHM) of the antenna response, in the zenith and azimuthal planes.

Author
Cory Davis
Parameters
[out]mc_antennaWS Output
[in]za_fwhmGeneric Input
[in]aa_fwhmGeneric Input

Definition at line 84 of file m_montecarlo.cc.

References MCAntenna::set_gaussian_fwhm().

Referenced by mc_antennaSetGaussianByFWHM_g().

◆ mc_antennaSetPencilBeam()

void mc_antennaSetPencilBeam ( MCAntenna mc_antenna,
const Verbosity verbosity 
)

WORKSPACE METHOD: mc_antennaSetPencilBeam.

Makes mc_antenna (used by MCGeneral) a pencil beam.

This WSM makes the subsequent MCGeneral WSM perform pencil beam RT calculations.

Author
Cory Davis
Parameters
[out]mc_antennaWS Output

Definition at line 95 of file m_montecarlo.cc.

References MCAntenna::set_pencil_beam().

Referenced by mc_antennaSetPencilBeam_g().

◆ MCGeneral()

void MCGeneral ( Workspace ws,
Vector y,
Index mc_iteration_count,
Vector mc_error,
Tensor3 mc_points,
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_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 ArrayOfSingleScatteringData scat_data_array_mono,
const Index atmfields_checked,
const Index atmgeom_checked,
const Index cloudbox_checked,
const Index mc_seed,
const String iy_unit,
const Numeric mc_std_err,
const Index mc_max_time,
const Index mc_max_iter,
const Index mc_min_iter,
const Verbosity verbosity 
)

WORKSPACE METHOD: MCGeneral.

A generalised 3D reversed Monte Carlo radiative algorithm, that allows for 2D antenna patterns, surface reflection and arbitrary sensor positions.

The main output variables y and mc_error represent the Stokes vector integrated over the antenna function, and the estimated error in this vector, respectively.

The WSV mc_max_iter describes the maximum number of `photons' used in the simulation (more photons means smaller mc_error). mc_std_err* is the desired value of mc_error. mc_max_time is the maximum allowed number of seconds for MCGeneral. The method will terminate once any of the max_iter, std_err, max_time criteria are met. If negative values are given for these parameters then it is ignored.

The WSV mc_min_iter sets the minimum number of photons to apply before the condition set by mc_std_err is considered. Values of mc_min_iter below 100 are not accepted.

Negative values of mc_seed seed the random number generator according to system time, positive mc_seed values are taken literally.

Only "1" and "RJBT" are allowed for iy_unit. The value of mc_error* follows the selection for iy_unit (both for in- and output.

Author
Cory Davis
Parameters
[in,out]wsWorkspace
[out]yWS Output
[out]mc_iteration_countWS Output
[out]mc_errorWS Output
[out]mc_pointsWS Output
[in]mc_antennaWS Input
[in]f_gridWS Input
[in]f_indexWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]stokes_dimWS Input
[in]atmosphere_dimWS Input
[in]ppath_step_agendaWS Input
[in]ppath_lraytraceWS Input
[in]iy_space_agendaWS Input
[in]surface_rtprop_agendaWS Input
[in]propmat_clearsky_agendaWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]scat_data_array_monoWS Input
[in]atmfields_checkedWS Input
[in]atmgeom_checkedWS Input
[in]cloudbox_checkedWS Input
[in]mc_seedWS Input
[in]iy_unitWS Input
[in]mc_std_errWS Input
[in]mc_max_timeWS Input
[in]mc_max_iterWS Input
[in]mc_min_iterWS Input

Definition at line 103 of file m_montecarlo.cc.

References BOLTZMAN_CONST, chk_if_in_range(), CREATE_OUT0, Rng::draw(), MCAntenna::draw_los(), findZ11max(), id_mat(), invrayjean(), is_anyptype30(), iy_space_agendaExecute(), joker, mcPathTraceGeneral(), mult(), ConstTensor4View::nbooks(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), planck(), q, Tensor3::resize(), Vector::resize(), Sample_los(), Rng::seed(), SPEED_OF_LIGHT, and surface_rtprop_agendaExecute().

Referenced by iyMC(), and MCGeneral_g().

◆ MCSetSeedFromTime()

void MCSetSeedFromTime ( Index mc_seed,
const Verbosity verbosity 
)

WORKSPACE METHOD: MCSetSeedFromTime.

Sets the value of mc_seed from system time

Author
Cory Davis
Parameters
[out]mc_seedWS Output

Definition at line 448 of file m_montecarlo.cc.

Referenced by iyMC(), and MCSetSeedFromTime_g().

Variable Documentation

◆ BOLTZMAN_CONST

const Numeric BOLTZMAN_CONST

Referenced by MCGeneral().

◆ DEG2RAD

const Numeric DEG2RAD

◆ PI

const Numeric PI

◆ RAD2DEG

const Numeric RAD2DEG

◆ SPEED_OF_LIGHT

const Numeric SPEED_OF_LIGHT

Referenced by MCGeneral().