ARTS
2.0.49
|
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 "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 "auto_md.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"
Go to the source code of this file.
Functions | |
void | mc_IWP_cloud_opt_pathCalc (Workspace &ws, Numeric &mc_IWP, Numeric &mc_cloud_opt_path, Numeric &mc_IWP_error, Numeric &mc_cloud_opt_path_error, Index &mc_iteration_count, const MCAntenna &mc_antenna, const Matrix &sensor_pos, const Matrix &sensor_los, const Agenda &ppath_step_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Matrix &r_geoid, const Matrix &z_surface, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Vector &particle_masses, const Index &mc_seed, const Index &max_iter, const Verbosity &verbosity) |
WORKSPACE METHOD: mc_IWP_cloud_opt_pathCalc. More... | |
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 &iy_space_agenda, const Agenda &surface_prop_agenda, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &r_geoid, 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_mono, const Index &basics_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 Verbosity &verbosity) |
WORKSPACE METHOD: MCGeneral. More... | |
void | MCIPA (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 &iy_space_agenda, const Agenda &surface_prop_agenda, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Agenda &ppath_step_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &r_geoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Index &mc_seed, const String &y_unit, const Numeric &std_err, const Index &max_time, const Index &max_iter, const Index &z_field_is_1D, const Verbosity &verbosity) |
WORKSPACE METHOD: MCIPA. More... | |
void | MCSetSeedFromTime (Index &mc_seed, const Verbosity &) |
WORKSPACE METHOD: MCSetSeedFromTime. More... | |
void | pha_matExtractManually (Matrix &pha_mat, const Vector &f_grid, const Index &f_index, const Index &stokes_dim, const ArrayOfSingleScatteringData &scat_data_raw, const Numeric &rte_temperature, const Numeric &za_out, const Numeric &aa_out, const Numeric &za_in, const Numeric &aa_in, const Verbosity &verbosity) |
WORKSPACE METHOD: pha_matExtractManually. More... | |
Variables | |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const Numeric | PI |
const Numeric | BOLTZMAN_CONST |
const Numeric | SPEED_OF_LIGHT |
Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods. All of these functions refer to 3D calculations.
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_montecarlo.cc.
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.
[out] | mc_antenna | WS Output |
[in] | za_sigma | Generic Input |
[in] | aa_sigma | Generic Input |
Definition at line 155 of file m_montecarlo.cc.
References MCAntenna::set_gaussian().
Referenced by mc_antennaSetGaussian_g().
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.
[out] | mc_antenna | WS Output |
[in] | za_fwhm | Generic Input |
[in] | aa_fwhm | Generic Input |
Definition at line 166 of file m_montecarlo.cc.
References MCAntenna::set_gaussian_fwhm().
Referenced by mc_antennaSetGaussianByFWHM_g().
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.
[out] | mc_antenna | WS Output |
Definition at line 177 of file m_montecarlo.cc.
References MCAntenna::set_pencil_beam().
Referenced by mc_antennaSetPencilBeam_g().
void mc_IWP_cloud_opt_pathCalc | ( | Workspace & | ws, |
Numeric & | mc_IWP, | ||
Numeric & | mc_cloud_opt_path, | ||
Numeric & | mc_IWP_error, | ||
Numeric & | mc_cloud_opt_path_error, | ||
Index & | mc_iteration_count, | ||
const MCAntenna & | mc_antenna, | ||
const Matrix & | sensor_pos, | ||
const Matrix & | sensor_los, | ||
const Agenda & | ppath_step_agenda, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Matrix & | r_geoid, | ||
const Matrix & | z_surface, | ||
const Tensor3 & | z_field, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Tensor4 & | pnd_field, | ||
const ArrayOfSingleScatteringData & | scat_data_mono, | ||
const Vector & | particle_masses, | ||
const Index & | mc_seed, | ||
const Index & | max_iter, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: mc_IWP_cloud_opt_pathCalc.
Calculates the FOV averaged ice water path and cloud optical path for a given viewing direction
[in,out] | ws | Workspace |
[out] | mc_IWP | WS Output |
[out] | mc_cloud_opt_path | WS Output |
[out] | mc_IWP_error | WS Output |
[out] | mc_cloud_opt_path_error | WS Output |
[out] | mc_iteration_count | WS Output |
[in] | mc_antenna | WS Input |
[in] | sensor_pos | WS Input |
[in] | sensor_los | WS Input |
[in] | ppath_step_agenda | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | r_geoid | WS Input |
[in] | z_surface | WS Input |
[in] | z_field | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | pnd_field | WS Input |
[in] | scat_data_mono | WS Input |
[in] | particle_masses | WS Input |
[in] | mc_seed | WS Input |
[in] | max_iter | Generic Input |
Definition at line 73 of file m_montecarlo.cc.
References ANTENNA_TYPE_PENCIL_BEAM, MCAntenna::draw_los(), MCAntenna::get_type(), iwp_cloud_opt_pathCalc(), joker, and Rng::seed().
Referenced by mc_IWP_cloud_opt_pathCalc_g().
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 & | iy_space_agenda, | ||
const Agenda & | surface_prop_agenda, | ||
const Agenda & | opt_prop_gas_agenda, | ||
const Agenda & | abs_scalar_gas_agenda, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const Matrix & | r_geoid, | ||
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_mono, | ||
const Index & | basics_checked, | ||
const Index & | cloudbox_checked, | ||
const Index & | mc_seed, | ||
const String & | y_unit, | ||
const Numeric & | mc_std_err, | ||
const Index & | mc_max_time, | ||
const Index & | mc_max_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 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 <br> parameters then it isignored.
Negative values of mc_seed seed the random number generator according to system time, positive mc_seed values are taken literally.
[in,out] | ws | Workspace |
[out] | y | WS Output |
[out] | mc_iteration_count | WS Output |
[out] | mc_error | WS Output |
[out] | mc_points | WS Output |
[in] | mc_antenna | WS Input |
[in] | f_grid | WS Input |
[in] | f_index | WS Input |
[in] | sensor_pos | WS Input |
[in] | sensor_los | WS Input |
[in] | stokes_dim | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | iy_space_agenda | WS Input |
[in] | surface_prop_agenda | WS Input |
[in] | opt_prop_gas_agenda | WS Input |
[in] | abs_scalar_gas_agenda | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z_field | WS Input |
[in] | r_geoid | WS Input |
[in] | z_surface | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | cloudbox_on | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | pnd_field | WS Input |
[in] | scat_data_mono | WS Input |
[in] | basics_checked | WS Input |
[in] | cloudbox_checked | WS Input |
[in] | mc_seed | WS Input |
[in] | y_unit | WS Input |
[in] | mc_std_err | WS Input |
[in] | mc_max_time | WS Input |
[in] | mc_max_iter | WS Input |
Definition at line 185 of file m_montecarlo.cc.
References BOLTZMAN_CONST, CREATE_OUT2, 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, Vector::resize(), Tensor3::resize(), Sample_los(), Rng::seed(), SPEED_OF_LIGHT, and surface_prop_agendaExecute().
Referenced by iyMC(), and MCGeneral_g().
void MCIPA | ( | 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 & | iy_space_agenda, | ||
const Agenda & | surface_prop_agenda, | ||
const Agenda & | opt_prop_gas_agenda, | ||
const Agenda & | abs_scalar_gas_agenda, | ||
const Agenda & | ppath_step_agenda, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const Matrix & | r_geoid, | ||
const Matrix & | z_surface, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Tensor4 & | pnd_field, | ||
const ArrayOfSingleScatteringData & | scat_data_mono, | ||
const Index & | mc_seed, | ||
const String & | y_unit, | ||
const Numeric & | mc_std_err, | ||
const Index & | mc_max_time, | ||
const Index & | mc_max_iter, | ||
const Index & | mc_z_field_is_1D, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: MCIPA.
A specialised 3D reversed Monte Carlo radiative algorithm, that mimics independent pixel appoximation simulations.
[in,out] | ws | Workspace |
[out] | y | WS Output |
[out] | mc_iteration_count | WS Output |
[out] | mc_error | WS Output |
[out] | mc_points | WS Output |
[in] | mc_antenna | WS Input |
[in] | f_grid | WS Input |
[in] | f_index | WS Input |
[in] | sensor_pos | WS Input |
[in] | sensor_los | WS Input |
[in] | stokes_dim | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | iy_space_agenda | WS Input |
[in] | surface_prop_agenda | WS Input |
[in] | opt_prop_gas_agenda | WS Input |
[in] | abs_scalar_gas_agenda | WS Input |
[in] | ppath_step_agenda | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z_field | WS Input |
[in] | r_geoid | WS Input |
[in] | z_surface | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | pnd_field | WS Input |
[in] | scat_data_mono | WS Input |
[in] | mc_seed | WS Input |
[in] | y_unit | WS Input |
[in] | mc_std_err | WS Input |
[in] | mc_max_time | WS Input |
[in] | mc_max_iter | WS Input |
[in] | mc_z_field_is_1D | WS Input |
Definition at line 526 of file m_montecarlo.cc.
References Ppath::background, BOLTZMAN_CONST, Rng::draw(), MCAntenna::draw_los(), findZ11max(), Ppath::geom_tan_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), id_mat(), invrayjean(), is_anyptype30(), iy_space_agendaExecute(), joker, mcPathTraceIPA(), mult(), ConstTensor4View::nbooks(), ConstVectorView::nelem(), Ppath::np, ConstMatrixView::nrows(), planck(), ppath_calc(), q, Vector::resize(), Tensor3::resize(), Sample_los(), Rng::seed(), SPEED_OF_LIGHT, and surface_prop_agendaExecute().
Referenced by MCIPA_g().
WORKSPACE METHOD: MCSetSeedFromTime.
Sets the value of mc_seed from system time
[out] | mc_seed | WS Output |
Definition at line 817 of file m_montecarlo.cc.
Referenced by iyMC(), and MCSetSeedFromTime_g().
void pha_matExtractManually | ( | Matrix & | pha_mat_single, |
const Vector & | f_grid, | ||
const Index & | f_index, | ||
const Index & | stokes_dim, | ||
const ArrayOfSingleScatteringData & | scat_data_raw, | ||
const Numeric & | rte_temperature, | ||
const Numeric & | za_out, | ||
const Numeric & | aa_out, | ||
const Numeric & | za_in, | ||
const Numeric & | aa_in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: pha_matExtractManually.
A simple function for manually extract a single phase matrix.
The function returns the phase matrix for a single particle, for scattering from (za_in,aa_in) to (za_out,aa_out).
Only a single particle type is handled and scat_data_raw must have length 1. The frequency is selected by f_grid and f_index. The temperature is set by rte_temperature.
[out] | pha_mat_single | Generic output |
[in] | f_grid | WS Input |
[in] | f_index | WS Input |
[in] | stokes_dim | WS Input |
[in] | scat_data_raw | WS Input |
[in] | rte_temperature | WS Input |
[in] | za_out | Generic Input |
[in] | aa_out | Generic Input |
[in] | za_in | Generic Input |
[in] | aa_in | Generic Input |
Definition at line 825 of file m_montecarlo.cc.
References Array< base >::nelem(), pha_mat_singleCalc(), Matrix::resize(), and scat_data_monoCalc().
Referenced by pha_matExtractManually_g().
|
extern |
Referenced by MCGeneral(), and MCIPA().
|
extern |
|
extern |
|
extern |
|
extern |
Referenced by MCGeneral(), and MCIPA().