montecarlo.h File Reference

#include <stdexcept>
#include <cmath>
#include "messages.h"
#include "arts.h"
#include "ppath.h"
#include "matpackI.h"
#include "special_interp.h"
#include "check_input.h"
#include "rte.h"
#include "lin_alg.h"
#include "logic.h"
#include "optproperties.h"
#include "physics_funcs.h"
#include "xml_io.h"
#include "rng.h"
#include "scatrte.h"

Include dependency graph for montecarlo.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void clear_rt_vars_at_gp (Workspace &ws, MatrixView &ext_mat_mono, VectorView &abs_vec_mono, Numeric &temperature, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &f_index, const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, const ConstVectorView p_grid, const ConstVectorView lat_grid, const ConstVectorView lon_grid, const ConstTensor3View t_field, const ConstTensor4View vmr_field)
 clear_rt_vars_at_gp
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, const ConstVectorView p_grid_cloud, const ConstVectorView lat_grid_cloud, const ConstVectorView lon_grid_cloud, const ConstTensor3View t_field_cloud, const ConstTensor4View vmr_field_cloud, const ConstTensor4View pnd_field)
 cloud_atm_vars_by_gp
void Cloudbox_ppathCalc (Workspace &ws, Ppath &ppath, Ppath &ppath_step, 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 Matrix &r_geoid, const Matrix &z_surface, const ArrayOfIndex &cloudbox_limits, const Vector &rte_pos, const Vector &rte_los, const Index &z_field_is_1D)
 Cloudbox_ppath_calc.
void Cloudbox_ppath_rteCalc (Workspace &ws, Ppath &ppathcloud, Ppath &ppath, Ppath &ppath_step, Vector &rte_pos, Vector &rte_los, Vector &cum_l_step, ArrayOfMatrix &TArray, ArrayOfMatrix &ext_matArray, ArrayOfVector &abs_vecArray, Vector &t_ppath, Tensor3 &ext_mat, Matrix &abs_vec, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Matrix &iy, Matrix &pnd_ppath, 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 Matrix &r_geoid, const Matrix &z_surface, const ArrayOfIndex &cloudbox_limits, const Index &record_ppathcloud, const Index &record_ppath, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &f_index, const Index &stokes_dim, const Tensor3 &t_field, const Tensor4 &vmr_field, const Agenda &rte_agenda, const Agenda &iy_space_agenda, const Agenda &surface_prop_agenda, const Agenda &iy_cloudbox_agenda, const Vector &f_grid, const Index &photon_number, const Index &scattering_order, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Index &z_field_is_1D)
void cloudbox_ppath_start_stepping (Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, ConstVectorView rte_pos, ConstVectorView rte_los, const Index &z_field_is_1D)
void cloudy_rt_vars_at_gp (Workspace &ws, MatrixView &ext_mat_mono, VectorView &abs_vec_mono, VectorView &pnd_vec, Numeric &temperature, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &stokes_dim, const Index &f_index, const GridPos gp_p, const GridPos gp_lat, const GridPos gp_lon, const ConstVectorView p_grid_cloud, const ConstVectorView lat_grid_cloud, const ConstVectorView lon_grid_cloud, const ConstTensor3View t_field_cloud, const ConstTensor4View vmr_field_cloud, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const ArrayOfIndex &cloudbox_limits, const Vector &rte_los)
 cloudy_rt_vars_at_gp
void cum_l_stepCalc (Vector &cum_l_step, const Ppath &ppath)
 cum_l_stepCalc
void findZ11max (Vector &Z11maxvector, const ArrayOfSingleScatteringData &scat_data_mono)
 findZ11max
bool is_anyptype30 (const ArrayOfSingleScatteringData &scat_data_mono)
 is_anyptype30
void iwp_cloud_opt_pathCalc (Workspace &ws, Numeric &iwp, Numeric &cloud_opt_path, const Vector &rte_pos, const Vector &rte_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)
 iwp_cloud_opt_pathCalc
void matrix_exp_p30 (MatrixView &M, ConstMatrixView &A)
 matrix_exp_p30
void mcPathTrace (Workspace &ws, MatrixView &evol_op, VectorView &abs_vec_mono, Numeric &temperature, MatrixView &ext_mat_mono, Rng &rng, Vector &rte_pos, Vector &rte_los, Vector &pnd_vec, Numeric &g, bool &left_cloudbox, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &stokes_dim, const Index &f_index, 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 &z_field_is_1D)
 mcPathTrace
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 &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &stokes_dim, const Index &f_index, 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 &z_field_is_1D)
 mcPathTraceGeneral
void mcPathTraceIPA (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, Index &termination_flag, bool &inside_cloud, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &stokes_dim, const Index &f_index, 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 &z_field_is_1D, const Ppath &ppath)
 mcPathTraceIPA
void montecarloGetIncoming (Workspace &ws, Matrix &iy, Vector &rte_pos, Vector &rte_los, Ppath &ppath, const Agenda &ppath_step_agenda, const Agenda &rte_agenda, const Agenda &iy_space_agenda, const Agenda &surface_prop_agenda, const Agenda &iy_cloudbox_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const Matrix &r_geoid, const Matrix &z_surface, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &f_grid, const Index &stokes_dim)
 montecarloGetIncoming
Numeric opt_depth_calc (Workspace &ws, Tensor3 &ext_mat, Matrix &abs_vec, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, const Ppath &ppath, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &f_index, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const Index &atmosphere_dim)
 opt_depth_calc
void opt_propCalc (MatrixView &K, VectorView &K_abs, const Numeric za, const Numeric aa, const ArrayOfSingleScatteringData &scat_data_mono, const Index &stokes_dim, const VectorView &pnd_vec, const Numeric &rte_temperature)
 opt_propCalc
void opt_propExtract (MatrixView &K_spt, VectorView &K_abs_spt, const SingleScatteringData &scat_data, const Numeric &za, const Numeric &aa, const Numeric &rte_temperature, const Index &stokes_dim)
 Extract ext_mat_mono and abs_vec_mono from a monochromatic SingleScatteringData object.
void pha_mat_singleCalc (MatrixView &Z, Numeric za_sca, Numeric aa_sca, Numeric za_inc, Numeric aa_inc, const ArrayOfSingleScatteringData &scat_data_mono, const Index &stokes_dim, const VectorView &pnd_vec, const Numeric &rte_temperature)
 pha_mat_singleCalc
void pha_mat_singleExtract (MatrixView &Z_spt, const SingleScatteringData &scat_data, const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc, const Numeric &rte_temperature, const Index &stokes_dim)
 Extract the phase matrix from a monochromatic SingleScatteringData object.
void Sample_los (VectorView &new_rte_los, Numeric &g_los_csc_theta, MatrixView &Z, Rng &rng, const VectorView &rte_los, const ArrayOfSingleScatteringData &scat_data_mono, const Index &stokes_dim, const VectorView &pnd_vec, const bool &anyptype30, const VectorView &Z11maxvector, Numeric Csca, const Numeric &rte_temperature)
 Sample_los.
void Sample_ppathlengthLOS (Numeric &pathlength, Numeric &g, Rng &rng, const ArrayOfMatrix &TArray, const ConstVectorView &cum_l_step)
 Sample_ppathlengthLOS.
void TArrayCalc (Workspace &ws, ArrayOfMatrix &TArray, ArrayOfMatrix &ext_matArray, ArrayOfVector &abs_vecArray, Vector &t_ppath, Tensor3 &ext_mat, Matrix &abs_vec, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Matrix &pnd_ppath, const Ppath &ppath, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index &f_index, const Index &stokes_dim, const ConstVectorView &p_grid_cloud, const ConstVectorView &lat_grid_cloud, const ConstVectorView &lon_grid_cloud, const ConstTensor3View &t_field_cloud, const ConstTensor4View &vmr_field_cloud, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const ArrayOfIndex &cloudbox_limits)

Variables

const Numeric DEG2RAD
const Numeric RAD2DEG
const Numeric PI


Function Documentation

void clear_rt_vars_at_gp ( Workspace &  ws,
MatrixView &  ext_mat_mono,
VectorView &  abs_vec_mono,
Numeric &  temperature,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  f_index,
const GridPos &  gp_p,
const GridPos &  gp_lat,
const GridPos &  gp_lon,
const ConstVectorView  p_grid,
const ConstVectorView  lat_grid,
const ConstVectorView  lon_grid,
const ConstTensor3View  t_field,
const ConstTensor4View  vmr_field 
)

clear_rt_vars_at_gp

Calculates a bunch of atmospheric variables at the end of a ppath.

Author:
Cory Davis
Date:
2005-02-19?

Definition at line 57 of file montecarlo.cc.

References abs_scalar_gas_agendaExecute(), interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ns, and opt_prop_gas_agendaExecute().

Referenced by mcPathTraceGeneral(), and mcPathTraceIPA().

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,
const ConstVectorView  p_grid_cloud,
const ConstVectorView  lat_grid_cloud,
const ConstVectorView  lon_grid_cloud,
const ConstTensor3View  t_field_cloud,
const ConstTensor4View  vmr_field_cloud,
const ConstTensor4View  pnd_field 
)

cloud_atm_vars_by_gp

Returns pressure, temperature, VMRs and PNDs, at points corresponding to arrays of gridpositions gp_p, gp_lat, and gp_lon. The field and grid input variables all span only the cloudbox

Parameters:
pressure Output: a vector of pressures
temperature Output: a vector of temperatures
vmr Output: a n_species by n matrix of VMRs
pnd Output: a n_ptypes by n matrix of VMRs
gp_p an array of pressre gridpoints
gp_lat an array of latitude gridpoints
gp_lon an array of longitude gridpoints
cloudbox_limits the WSV
p_grid_cloud the subset of the p_grid corresponding to the cloudbox
lat_grid_cloud the subset of the lat_grid corresponding to the cloudbox
lon_grid_cloud the subset of the lon_grid corresponding to the cloudbox
t_field_cloud the t_field within the cloudbox
vmr_field_cloud the t_field within the cloudbox
pnd_field The WSV
Author:
Cory Davis
Date:
2005-06-07

Definition at line 243 of file montecarlo.cc.

References fix_gridpos_at_boundary(), interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ConstVectorView::nelem(), Array< base >::nelem(), and ns.

Referenced by cloudy_rt_vars_at_gp(), iwp_cloud_opt_pathCalc(), and TArrayCalc().

void Cloudbox_ppath_rteCalc ( Workspace &  ws,
Ppath &  ppathcloud,
Ppath &  ppath,
Ppath &  ppath_step,
Vector &  rte_pos,
Vector &  rte_los,
Vector &  cum_l_step,
ArrayOfMatrix &  TArray,
ArrayOfMatrix &  ext_matArray,
ArrayOfVector &  abs_vecArray,
Vector &  t_ppath,
Tensor3 &  ext_mat,
Matrix &  abs_vec,
Numeric &  rte_pressure,
Numeric &  rte_temperature,
Vector &  rte_vmr_list,
Matrix &  iy,
Matrix &  pnd_ppath,
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 Matrix &  r_geoid,
const Matrix &  z_surface,
const ArrayOfIndex &  cloudbox_limits,
const Index &  record_ppathcloud,
const Index &  record_ppath,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  f_index,
const Index &  stokes_dim,
const Tensor3 &  t_field,
const Tensor4 &  vmr_field,
const Agenda &  rte_agenda,
const Agenda &  iy_space_agenda,
const Agenda &  surface_prop_agenda,
const Agenda &  iy_cloudbox_agenda,
const Vector &  f_grid,
const Index &  photon_number,
const Index &  scattering_order,
const Tensor4 &  pnd_field,
const ArrayOfSingleScatteringData &  scat_data_mono,
const Index &  z_field_is_1D 
)

void cloudbox_ppath_start_stepping ( Ppath &  ppath,
const Index &  atmosphere_dim,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstMatrixView  z_surface,
ConstVectorView  rte_pos,
ConstVectorView  rte_los,
const Index &  z_field_is_1D 
)

void Cloudbox_ppathCalc ( Workspace &  ws,
Ppath &  ppath,
Ppath &  ppath_step,
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 Matrix &  r_geoid,
const Matrix &  z_surface,
const ArrayOfIndex &  cloudbox_limits,
const Vector &  rte_pos,
const Vector &  rte_los,
const Index &  z_field_is_1D 
)

Cloudbox_ppath_calc.

This function performs the same task as ppath_calc, except inside the cloudbox. It has been derived from the clear sky version. See the online help (arts -d FUNCTION_NAME) for a description of parameters.

Author:
Cory Davis
Date:
2003-06-19

Definition at line 335 of file montecarlo.cc.

References Ppath::background, chk_if_in_range(), chk_if_over_0(), chk_vector_length(), cloudbox_ppath_start_stepping(), Ppath::constant, Ppath::geom_tan_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, joker, Ppath::l_step, Ppath::los, Ppath::method, min, ConstVectorView::nelem(), Array< base >::nelem(), Ppath::np, ConstTensor3View::npages(), out2, out3, Ppath::pos, ppath_init_structure(), ppath_set_background(), ppath_step_agendaExecute(), ppath_what_background(), Ppath::refraction, Vector::resize(), Ppath::tan_pos, WriteXML(), and Ppath::z.

Referenced by Cloudbox_ppath_rteCalc().

void cloudy_rt_vars_at_gp ( Workspace &  ws,
MatrixView &  ext_mat_mono,
VectorView &  abs_vec_mono,
VectorView &  pnd_vec,
Numeric &  temperature,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  stokes_dim,
const Index &  f_index,
const GridPos  gp_p,
const GridPos  gp_lat,
const GridPos  gp_lon,
const ConstVectorView  p_grid_cloud,
const ConstVectorView  lat_grid_cloud,
const ConstVectorView  lon_grid_cloud,
const ConstTensor3View  t_field_cloud,
const ConstTensor4View  vmr_field_cloud,
const Tensor4 &  pnd_field,
const ArrayOfSingleScatteringData &  scat_data_mono,
const ArrayOfIndex &  cloudbox_limits,
const Vector &  rte_los 
)

cloudy_rt_vars_at_gp

Calculates a bunch of atmospheric variables at the end of a ppath.

Author:
Cory Davis
Date:
2005-02-19?

Definition at line 137 of file montecarlo.cc.

References abs_scalar_gas_agendaExecute(), cloud_atm_vars_by_gp(), joker, ConstTensor4View::nbooks(), ns, opt_prop_gas_agendaExecute(), and opt_propCalc().

Referenced by mcPathTrace(), mcPathTraceGeneral(), and mcPathTraceIPA().

void cum_l_stepCalc ( Vector &  cum_l_step,
const Ppath &  ppath 
)

cum_l_stepCalc

Returns a vector of cumulative pathlengths for a given ppath by adding ppath.l_step

Parameters:
cum_l_step Output: vector of cumulative pathlengths.
ppath a Ppath.
Author:
Cory Davis
Date:
2003-06-19

Definition at line 907 of file montecarlo.cc.

References Ppath::l_step, Ppath::np, and Vector::resize().

Referenced by Cloudbox_ppath_rteCalc(), mcPathTrace(), and mcPathTraceGeneral().

void findZ11max ( Vector &  Z11maxvector,
const ArrayOfSingleScatteringData &  scat_data_mono 
)

findZ11max

The direction sampling method requires a bounding value for Z11. This returns a vector with the maximum value of Z11 for each particle type.

Parameters:
[out] Z11maxvector Maximum value of Z11 for each particle type
[in] scat_data_mono 
Author:
Cory Davis
Date:
2004-31-1

Definition at line 933 of file montecarlo.cc.

References joker, max, Array< base >::nelem(), PTYPE_HORIZ_AL, PTYPE_MACROS_ISO, and Vector::resize().

Referenced by MCGeneral(), MCIPA(), and ScatteringMonteCarlo().

bool is_anyptype30 ( const ArrayOfSingleScatteringData &  scat_data_mono  ) 

is_anyptype30

Some operations in Monte Carlo simulations are different depending on the particle type of the scattering particles. This function searches scat_data_mono to determine if any of the particle types have ptype=30

Author:
Cory Davis
Date:
2004-1-31

Definition at line 970 of file montecarlo.cc.

References Array< base >::nelem(), and PTYPE_HORIZ_AL.

Referenced by MCGeneral(), MCIPA(), and ScatteringMonteCarlo().

void iwp_cloud_opt_pathCalc ( Workspace &  ws,
Numeric &  iwp,
Numeric &  cloud_opt_path,
const Vector &  rte_pos,
const Vector &  rte_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 
)

iwp_cloud_opt_pathCalc

Calculated the ice water path(iwp) and cloud optical path (cloud_opt_path) for a given sensor_pos_ and sensor_los

Author:
Cory Davis
Date:
2006-6-15

Definition at line 999 of file montecarlo.cc.

References cloud_atm_vars_by_gp(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, joker, Ppath::l_step, Ppath::los, ConstTensor4View::nbooks(), ConstVectorView::nelem(), Ppath::np, opt_propCalc(), Ppath::pos, ppath_calc(), and ppath_what_background().

Referenced by mc_IWP_cloud_opt_pathCalc().

void matrix_exp_p30 ( MatrixView &  M,
ConstMatrixView &  A 
)

matrix_exp_p30

When we have p30 particles, and therefore the extinction matrix has a block diagonal form with 3 independent elements, the matrix expontential can be calculated very quickly and exactly using this function.

Parameters:
M output matrix
A input matrix (must be of the form described above)
Author:
Cory Davis
Date:
2005-3-2

Definition at line 1098 of file montecarlo.cc.

References M, ConstMatrixView::ncols(), and ConstMatrixView::nrows().

Referenced by interpTArray(), mcPathTrace(), mcPathTraceGeneral(), mcPathTraceIPA(), and TArrayCalc().

void mcPathTrace ( Workspace &  ws,
MatrixView &  evol_op,
VectorView &  abs_vec_mono,
Numeric &  rte_temperature,
MatrixView &  ext_mat_mono,
Rng &  rng,
Vector &  rte_pos,
Vector &  rte_los,
Vector &  pnd_vec,
Numeric &  g,
bool &  left_cloudbox,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  stokes_dim,
const Index &  f_index,
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 &  z_field_is_1D 
)

mcPathTrace

Performs the tasks of pathlength sampling, ray tracing (but now only as far as determined by pathlength sampling) and calculation of the evolution operator and several atmospheric variables at the new point.

Author:
Cory Davis
Date:
2005-2-21

Definition at line 1751 of file montecarlo.cc.

References cloudbox_ppath_start_stepping(), cloudy_rt_vars_at_gp(), cum_l_stepCalc(), Rng::draw(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), id_mat(), interp(), interpweights(), is_diagonal(), is_inside_cloudbox(), joker, Ppath::los, matrix_exp_p30(), mult(), Ppath::np, Ppath::pos, and ppath_step_geom_3d().

Referenced by ScatteringMonteCarlo().

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 &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  stokes_dim,
const Index &  f_index,
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 &  z_field_is_1D 
)

mcPathTraceGeneral

Performs the tasks of pathlength sampling, ray tracing (but now only as far as determined by pathlength sampling) and calculation of the evolution operator and several atmospheric variables at the new point.

Author:
Cory Davis
Date:
2005-2-21

Definition at line 1137 of file montecarlo.cc.

References clear_rt_vars_at_gp(), cloudy_rt_vars_at_gp(), cum_l_stepCalc(), Rng::draw(), fractional_gp(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), id_mat(), interp(), interpweights(), is_diagonal(), is_inside_cloudbox(), joker, Ppath::los, matrix_exp_p30(), mult(), ConstVectorView::nelem(), Ppath::np, Ppath::pos, ppath_start_stepping(), ppath_step_geom_3d(), and ppath_what_background().

Referenced by MCGeneral().

void mcPathTraceIPA ( 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,
Index &  termination_flag,
bool &  inside_cloud,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  stokes_dim,
const Index &  f_index,
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 &  z_field_is_1D,
const Ppath &  ppath 
)

mcPathTraceIPA

Performs the tasks of pathlength sampling, ray tracing (but now only as far as determined by pathlength sampling) and calculation of the evolution operator and several atmospheric variables at the new point. THis is the same as mcPathTraceGeneral modified for the independent pixel approximation.

Author:
Cory Davis
Date:
2005-2-21

Definition at line 1393 of file montecarlo.cc.

References abs, cart2poslos(), clear_rt_vars_at_gp(), cloudy_rt_vars_at_gp(), DEG2RAD, Rng::draw(), dx, fractional_gp(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), id_mat(), GridPos::idx, interp(), interp_atmfield_by_gp(), interpweights(), is_diagonal(), is_gp_inside_cloudbox(), is_inside_cloudbox(), joker, Ppath::los, matrix_exp_p30(), mult(), ConstVectorView::nelem(), Ppath::np, Ppath::pos, poslos2cart(), ppath_start_stepping(), and z_at_latlon().

Referenced by MCIPA().

void montecarloGetIncoming ( Workspace &  ws,
Matrix &  iy,
Vector &  rte_pos,
Vector &  rte_los,
Ppath &  ppath,
const Agenda &  ppath_step_agenda,
const Agenda &  rte_agenda,
const Agenda &  iy_space_agenda,
const Agenda &  surface_prop_agenda,
const Agenda &  iy_cloudbox_agenda,
const Vector &  p_grid,
const Vector &  lat_grid,
const Vector &  lon_grid,
const Tensor3 &  z_field,
const Tensor3 &  t_field,
const Tensor4 &  vmr_field,
const Matrix &  r_geoid,
const Matrix &  z_surface,
const ArrayOfIndex &  cloudbox_limits,
const Index &  atmosphere_dim,
const Vector &  f_grid,
const Index &  stokes_dim 
)

montecarloGetIncoming

Gets incoming radiance at the cloud box boundary in a single propagation direction, determined by the cloudbox Ppath 'pptahcloud'. Used in ScatteringMonteCarlo.

Author:
Cory Davis
Date:
2003-11-28

Definition at line 1949 of file montecarlo.cc.

References iy_calc_no_jacobian().

Referenced by ScatteringMonteCarlo().

Numeric opt_depth_calc ( Workspace &  ws,
Tensor3 &  ext_mat,
Matrix &  abs_vec,
Numeric &  rte_pressure,
Numeric &  rte_temperature,
Vector &  rte_vmr_list,
const Ppath &  ppath,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  f_index,
const Vector &  p_grid,
const Vector &  lat_grid,
const Vector &  lon_grid,
const Tensor3 &  t_field,
const Tensor4 &  vmr_field,
const Index &  atmosphere_dim 
)

opt_depth_calc

Used at the beginning of a MC simulation to calculate the optical depth between the sensor and the cloudbox boundary.

Author:
Cory Davis
Date:
Late 2004

Definition at line 2014 of file montecarlo.cc.

References abs_scalar_gas_agendaExecute(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, Ppath::l_step, ConstTensor4View::nbooks(), Ppath::np, ns, and opt_prop_gas_agendaExecute().

Referenced by ScatteringMonteCarlo().

void opt_propCalc ( MatrixView &  ext_mat_mono,
VectorView &  abs_vec_mono,
const Numeric  za,
const Numeric  aa,
const ArrayOfSingleScatteringData &  scat_data_mono,
const Index &  stokes_dim,
const VectorView &  pnd_vec,
const Numeric &  rte_temperature 
)

opt_propCalc

Returns the extinction matrix and absorption vector due to scattering particles from scat_data_mono

Parameters:
ext_mat_mono Output: extinction matrix
abs_vec_mono Output: absorption coefficient vector
za zenith angle of propagation direction
aa azimuthal angle of propagation
scat_data_mono workspace variable
stokes_dim workspace variable
pnd_vec vector pf particle number densities (one element per particle type)
rte_temperature loacl temperature (workspace variable)
Author:
Cory Davis
Date:
2004-7-16

Definition at line 2103 of file montecarlo.cc.

References Array< base >::nelem(), and opt_propExtract().

Referenced by cloudy_rt_vars_at_gp(), iwp_cloud_opt_pathCalc(), and TArrayCalc().

void opt_propExtract ( MatrixView &  ext_mat_mono_spt,
VectorView &  abs_vec_mono_spt,
const SingleScatteringData &  scat_data,
const Numeric &  za,
const Numeric &  aa,
const Numeric &  rte_temperature,
const Index &  stokes_dim 
)

Extract ext_mat_mono and abs_vec_mono from a monochromatic SingleScatteringData object.

Given a monochromatic SingleScatteringData object, propagation directions, and the temperature, this function returns the extinction matrix and the absorption coefficient vector Output:

Parameters:
ext_mat_mono_spt the extinction matrix (spt: this is for a single particle)
abs_vec_mono_spt the absorption coefficient vector Input:
scat_data a monochromatic SingleScatteringData object
za 
aa 
rte_temperature 
stokes_dim 
Author:
Cory Davis
Date:
2004-07-16

Definition at line 2162 of file montecarlo.cc.

References SingleScatteringData::abs_vec_data, SingleScatteringData::ext_mat_data, gridpos(), interp(), interpweights(), joker, ConstTensor5View::ncols(), out0, SingleScatteringData::ptype, PTYPE_GENERAL, PTYPE_HORIZ_AL, PTYPE_MACROS_ISO, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.

Referenced by opt_propCalc().

void pha_mat_singleCalc ( MatrixView &  Z,
Numeric  za_sca,
Numeric  aa_sca,
Numeric  za_inc,
Numeric  aa_inc,
const ArrayOfSingleScatteringData &  scat_data_mono,
const Index &  stokes_dim,
const VectorView &  pnd_vec,
const Numeric &  rte_temperature 
)

pha_mat_singleCalc

Returns the total phase matrix for given incident and scattered directions . It requires a vector of particle number densities to be precalculated

Parameters:
[out] Z Output: phase matrix
[out] za_sca scattered
[out] aa_sca and
[out] za_inc incident
[out] aa_inc directions
[in] scat_data_mono workspace variable
[in] stokes_dim workspace variable
[in] pnd_vec vector of particle number densities at the point in question
[in] rte_temperature workspace variable
Author:
Cory Davis
Date:
2003-11-27

Definition at line 2319 of file montecarlo.cc.

References ConstVectorView::nelem(), and pha_mat_singleExtract().

Referenced by Sample_los().

void pha_mat_singleExtract ( MatrixView &  Z_spt,
const SingleScatteringData &  scat_data,
const Numeric &  za_sca,
const Numeric &  aa_sca,
const Numeric &  za_inc,
const Numeric &  aa_inc,
const Numeric &  rte_temperature,
const Index &  stokes_dim 
)

Extract the phase matrix from a monochromatic SingleScatteringData object.

Given a monochromatic SingleScatteringData object, incident and scattered directions, and the temperature, this function returns the phase matrix in the laboratory frame

Parameters:
[out] Z_spt the phase matrix
[in] scat_data a monochromatic SingleScatteringData object
[in] za_sca 
[in] aa_sca 
[in] za_inc 
[in] aa_inc 
[in] rte_temperature 
[in] stokes_dim 
Author:
Cory Davis
Date:
2004-07-16

Definition at line 2369 of file montecarlo.cc.

References SingleScatteringData::aa_grid, abs, gridpos(), interp(), interp_scat_angle_temperature(), interpweights(), joker, ConstTensor7View::ncols(), out0, SingleScatteringData::pha_mat_data, pha_mat_labCalc(), SingleScatteringData::ptype, PTYPE_GENERAL, PTYPE_HORIZ_AL, PTYPE_MACROS_ISO, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.

Referenced by pha_mat_singleCalc().

void Sample_los ( VectorView &  new_rte_los,
Numeric &  g_los_csc_theta,
MatrixView &  Z,
Rng &  rng,
const VectorView &  rte_los,
const ArrayOfSingleScatteringData &  scat_data_mono,
const Index &  stokes_dim,
const VectorView &  pnd_vec,
const bool &  anyptype30,
const VectorView &  Z11maxvector,
Numeric  Csca,
const Numeric &  rte_temperature 
)

Sample_los.

Implementation one of two line of sight sampling methods determined by the input Index 'sampling_method'

sampling_method==1: Randomly samples incident direction using a probability density function proportional to sin(za)(cos(za)+1). sin(za) because dsolid_angle=sin(za)dzadaa , and (cos(za)+1) because upward radiances tend to be greater than downward radiances. NOTE: THIS IS TERRIBLE IN OPTICALLY THICK CASES AND WILL BE REMOVED

sampling_method==2: Randomly samples incident direction using a probability density function proportional to sin(za). Better, but again, not very good.

THIS WHOLE FUNCTION MAY BE SOON REDUNDANT TO SAMPLE_LOS_Z WHICH USES A PDF PROPORTIONAL TO Z11SINZA

Parameters:
[out] new_rte_los incident line of sight for subsequent
[out] g_los_csc_theta probability density for the chosen direction multiplied by sin(za)
[out] Z 
[in,out] rng Rng random number generator instance
[in] rte_los incident line of sight for subsequent ray-tracing.
[in] scat_data_mono 
[in] stokes_dim 
[in] pnd_vec 
[in] anyptype30 
[in] Z11maxvector 
[in] Csca 
[in] rte_temperature 
Author:
Cory Davis
Date:
2003-06-19

Definition at line 2576 of file montecarlo.cc.

References Rng::draw(), Array< base >::nelem(), ConstVectorView::nelem(), pha_mat_singleCalc(), and RAD2DEG.

Referenced by MCGeneral(), MCIPA(), and ScatteringMonteCarlo().

void Sample_ppathlengthLOS ( Numeric &  pathlength,
Numeric &  g,
Rng &  rng,
const ArrayOfMatrix &  TArray,
const ConstVectorView &  cum_l_step 
)

Sample_ppathlengthLOS.

Similar to Sample_ppathlength, but ensures that the sampled point lies within the cloudbox

Parameters:
[out] pathlength the pathlength.
[out] g the probability density of the returned pathlength.
[in,out] rng Rng random number generator instance
[in] TArray FIXME: DOC
[in] cum_l_step FIXME: DOC
Author:
Cory Davis
Date:
2003-03-10

Definition at line 2649 of file montecarlo.cc.

References Rng::draw(), gridpos(), GridPos::idx, Array< base >::nelem(), and ConstVectorView::nelem().

Referenced by ScatteringMonteCarlo().

void TArrayCalc ( Workspace &  ws,
ArrayOfMatrix &  TArray,
ArrayOfMatrix &  ext_matArray,
ArrayOfVector &  abs_vecArray,
Vector &  t_ppath,
Tensor3 &  ext_mat,
Matrix &  abs_vec,
Numeric &  rte_pressure,
Numeric &  rte_temperature,
Vector &  rte_vmr_list,
Matrix &  pnd_ppath,
const Ppath &  ppath,
const Agenda &  opt_prop_gas_agenda,
const Agenda &  abs_scalar_gas_agenda,
const Index &  f_index,
const Index &  stokes_dim,
const ConstVectorView &  p_grid_cloud,
const ConstVectorView &  lat_grid_cloud,
const ConstVectorView &  lon_grid_cloud,
const ConstTensor3View &  t_field_cloud,
const ConstTensor4View &  vmr_field_cloud,
const Tensor4 &  pnd_field,
const ArrayOfSingleScatteringData &  scat_data_mono,
const ArrayOfIndex &  cloudbox_limits 
)


Variable Documentation

const Numeric PI


Generated on Mon Mar 23 14:06:47 2009 for ARTS by  doxygen 1.5.6