ARTS 2.5.11 (git: 6827797f)
|
This file contains definitions and functions related to the optical properties of particles. More...
#include "optproperties.h"
#include <cfloat>
#include <cmath>
#include <stdexcept>
#include "array.h"
#include "arts.h"
#include "check_input.h"
#include "arts_conversions.h"
#include "interpolation.h"
#include "interp.h"
#include "logic.h"
#include "math_funcs.h"
#include "matpack_data.h"
#include "messages.h"
#include "xml_io.h"
Go to the source code of this file.
Macros | |
#define | F11 pha_mat_int[0] |
#define | F12 pha_mat_int[1] |
#define | F22 pha_mat_int[2] |
#define | F33 pha_mat_int[3] |
#define | F34 pha_mat_int[4] |
#define | F44 pha_mat_int[5] |
Functions | |
void | opt_prop_Bulk (Tensor5 &ext_mat, Tensor4 &abs_vec, Index &ptype, const ArrayOfTensor5 &ext_mat_ss, const ArrayOfTensor4 &abs_vec_ss, const ArrayOfIndex &ptypes_ss) |
one-line descript | |
void | opt_prop_ScatSpecBulk (ArrayOfTensor5 &ext_mat, ArrayOfTensor4 &abs_vec, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor5 &ext_mat_se, const ArrayOfArrayOfTensor4 &abs_vec_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok) |
Scattering species bulk extinction and absorption. | |
void | opt_prop_NScatElems (ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order) |
Extinction and absorption from all scattering elements. | |
ArrayOfLagrangeInterpolation | ssd_tinterp_parameters (VectorView t_ok, Index &this_T_interp_order, ConstVectorView T_grid, const Vector &T_array, const Index &t_interp_order) |
Determine T-interpol parameters for a specific scattering element. | |
void | opt_prop_1ScatElem (Tensor5View ext_mat, Tensor4View abs_vec, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Matrix &dir_array, const Index &f_start, const Index &t_interp_order) |
Preparing extinction and absorption from one scattering element. | |
void | ext_mat_SSD2Stokes (MatrixView ext_mat_stokes, ConstVectorView ext_mat_ssd, const Index &stokes_dim, const Index &ptype) |
Extinction matrix scat_data to stokes format conversion. | |
void | abs_vec_SSD2Stokes (VectorView abs_vec_stokes, ConstVectorView abs_vec_ssd, const Index &stokes_dim, const Index &ptype) |
Absorption vector scat_data to stokes format conversion. | |
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_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_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. | |
void | pha_mat_1ScatElem (Tensor6View pha_mat, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_start, const Index &t_interp_order) |
Preparing phase matrix from one scattering element. | |
void | abs_vecTransform (StokesVector &abs_vec_lab, ConstTensor3View abs_vec_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Numeric &za_sca, const Numeric &aa_sca, const Verbosity &verbosity) |
Transformation of absorption vector. | |
void | ext_matTransform (PropagationMatrix &ext_mat_lab, ConstTensor3View ext_mat_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Numeric &za_sca, const Numeric &aa_sca, const Verbosity &verbosity) |
Transformation of extinction matrix. | |
void | pha_matTransform (MatrixView pha_mat_lab, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Index &za_sca_idx, const Index &aa_sca_idx, const Index &za_inc_idx, const Index &aa_inc_idx, ConstVectorView za_grid, ConstVectorView aa_grid, const Verbosity &verbosity) |
Transformation of phase matrix. | |
void | ext_matFromabs_vec (MatrixView ext_mat, ConstVectorView abs_vec, const Index &stokes_dim) |
Derive extinction matrix from absorption vector. | |
Numeric | scat_angle (const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc) |
Calculates the scattering angle. | |
void | interpolate_scat_angle (VectorView pha_mat_int, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, const Numeric theta) |
Interpolate data on the scattering angle. | |
void | pha_mat_labCalc (MatrixView pha_mat_lab, ConstVectorView pha_mat_int, const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc, const Numeric &theta_rad) |
Calculate phase matrix in laboratory coordinate system. | |
ostream & | operator<< (ostream &os, const SingleScatteringData &) |
ostream & | operator<< (ostream &os, const ScatteringMetaData &) |
void | opt_prop_sum_propmat_clearsky (PropagationMatrix &ext_mat, StokesVector &abs_vec, const PropagationMatrix &propmat_clearsky) |
Get optical properties from propmat_clearsky. | |
PType | PTypeFromString (const String &ptype_string) |
Convert ptype name to enum value. | |
PType | PType2FromString (const String &ptype_string) |
Convert ptype name to enum value. | |
String | PTypeToString (const PType &ptype) |
Convert particle type enum value to String. | |
void | ConvertAzimuthallyRandomSingleScatteringData (SingleScatteringData &ssd) |
Convert azimuthally-random oriented SingleScatteringData to latest version. | |
ParticleSSDMethod | ParticleSSDMethodFromString (const String &particle_ssdmethod_string) |
Convert particle ssd method name to enum value. | |
String | PTypeToString (const ParticleSSDMethod &particle_ssdmethod) |
Convert particle type enum value to String. | |
void | ext_abs_pfun_from_tro (MatrixView ext_data, MatrixView abs_data, Tensor3View pfun_data, const ArrayOfSingleScatteringData &scat_data, const Index &iss, ConstMatrixView pnd_data, ArrayOfIndex &cloudbox_limits, ConstVectorView T_grid, ConstVectorView sa_grid) |
Extinction, absorption and phase function for one scattering species, 1D and TRO. | |
Variables | |
constexpr Numeric | DEG2RAD =Conversion::deg2rad(1) |
constexpr Numeric | RAD2DEG =Conversion::rad2deg(1) |
constexpr Numeric | PI =pi |
This file contains definitions and functions related to the optical properties of particles.
Definition in file optproperties.cc.
#define F11 pha_mat_int[0] |
Definition at line 41 of file optproperties.cc.
#define F12 pha_mat_int[1] |
Definition at line 42 of file optproperties.cc.
#define F22 pha_mat_int[2] |
Definition at line 43 of file optproperties.cc.
#define F33 pha_mat_int[3] |
Definition at line 44 of file optproperties.cc.
#define F34 pha_mat_int[4] |
Definition at line 45 of file optproperties.cc.
#define F44 pha_mat_int[5] |
Definition at line 46 of file optproperties.cc.
void abs_vec_SSD2Stokes | ( | VectorView | abs_vec_stokes, |
ConstVectorView | abs_vec_ssd, | ||
const Index & | stokes_dim, | ||
const Index & | ptype | ||
) |
Absorption vector scat_data to stokes format conversion.
Converts absorption vector from scat_data ptype-dependent compact format to Stokes-notation matrix.
[out] | abs_vec_stokes | absvec in stokes notation (stokes_dim). |
[in] | abs_vec_ssd | absvec at 1f, 1T, 1dir in scat_data compact (vector) format. |
[in] | stokes_dim | as the WSM. |
[in] | ptype | Type of scattering element. |
Definition at line 705 of file optproperties.cc.
References ARTS_ASSERT, PTYPE_AZIMUTH_RND, and PTYPE_TOTAL_RND.
Referenced by opt_prop_1ScatElem().
void abs_vecTransform | ( | StokesVector & | abs_vec_lab, |
ConstTensor3View | abs_vec_data, | ||
ConstVectorView | za_datagrid, | ||
ConstVectorView | aa_datagrid, | ||
const PType & | ptype, | ||
const Numeric & | za_sca, | ||
const Numeric & | aa_sca, | ||
const Verbosity & | verbosity | ||
) |
Transformation of absorption vector.
In the single scattering database the data of the absorption vector is stored in different coordinate systems, depending on the type (ptype) of the scattering particle (scattering element).
See AUG for information about the different classifications of the scattering elements.
Output and Input:
abs_vec_lab | Absorption vector in Laboratory frame. Input: |
abs_vec_data | Absorption vector in database. |
za_datagrid | Zenith angle grid in the database. |
aa_datagrid | Zenith angle grid in the database. |
ptype | Type of scattering element. |
za_sca | Zenith angle of scattered direction. |
aa_sca | Azimuth angle of scattered direction. |
Definition at line 1280 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR_IF, CREATE_OUT0, gridpos(), interp(), interpweights(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by opt_prop_sptFromData(), opt_prop_sptFromMonoData(), and opt_prop_sptFromScat_data().
void ConvertAzimuthallyRandomSingleScatteringData | ( | SingleScatteringData & | ssd | ) |
Convert azimuthally-random oriented SingleScatteringData to latest version.
Converts SingleScatteringData to version 3.
[in,out] | ssd | SingleScatteringData |
Definition at line 2222 of file optproperties.cc.
References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, ARTS_USER_ERROR_IF, chk_size(), SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, SingleScatteringData::pha_mat_data, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by xml_read_from_stream().
void ext_abs_pfun_from_tro | ( | MatrixView | ext_data, |
MatrixView | abs_data, | ||
Tensor3View | pfun_data, | ||
const ArrayOfSingleScatteringData & | scat_data, | ||
const Index & | iss, | ||
ConstMatrixView | pnd_data, | ||
ArrayOfIndex & | cloudbox_limits, | ||
ConstVectorView | T_grid, | ||
ConstVectorView | sa_grid | ||
) |
Extinction, absorption and phase function for one scattering species, 1D and TRO.
This function interpolates scat_data and sums up values to obtain the extinction, absorption and phase function for one scattering species, on the condition that scat_data only contains data of TRO-type and a 1D atmosphere is given.
For flexibility, the quantities are added to ext, mat and pfun. This means that you need to set these variables to zero before calling this function for the first or each scattering species.
The function gives error if not all data are TRO.
ext, abs, pfun and T_grid shall match the complete atmosphere, while pnd shall match the cloudbox.
[in,out] | ext_data | Extinction [frequency, temperature] |
[in,out] | abs_data | Absorption [frequency, temperature] |
[in,out] | pfun_data | Phase function [frequency, temperature, scattering angle] |
[in] | scat_data | Scattering data for one scattering species |
[in] | iss | Index for scattering species, only used for error |
[in] | pnd | Particle number density [scattering element, cloudbox level] |
[in] | T_grid | Temperatures |
[in] | sa_grid | Scattering angles |
[in] | cloudbox_limits | Limits in pressure dimension |
Definition at line 2400 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR_IF, gridpos(), interp(), interpweights(), last(), Array< base >::nelem(), and PTYPE_TOTAL_RND.
Referenced by HydrotableCalc(), run_cdisort(), and run_cdisort_flux().
void ext_mat_SSD2Stokes | ( | MatrixView | ext_mat_stokes, |
ConstVectorView | ext_mat_ssd, | ||
const Index & | stokes_dim, | ||
const Index & | ptype | ||
) |
Extinction matrix scat_data to stokes format conversion.
Converts extinction matrix from scat_data ptype-dependent compact format to Stokes-notation matrix.
[out] | ext_mat_stokes | extmat in stokes notation (stokes_dim,stokes_dim). |
[in] | ext_mat_ssd | extmat at 1f, 1T, 1dir in scat_data compact (vector) format. |
[in] | stokes_dim | as the WSM. |
[in] | ptype | type of scattering element. |
Definition at line 657 of file optproperties.cc.
References ARTS_ASSERT, PTYPE_AZIMUTH_RND, and PTYPE_TOTAL_RND.
Referenced by opt_prop_1ScatElem().
void ext_matFromabs_vec | ( | MatrixView | ext_mat, |
ConstVectorView | abs_vec, | ||
const Index & | stokes_dim | ||
) |
Derive extinction matrix from absorption vector.
In case, when only absorption of a scattering element shall be considered, and the scattering is neglected, the extinction matrix is set from the absorption vector only.
Extinction matrix is set the following way:
K11 = K22 = K33 = K44 = a1 K12 = K21 = a2 K13 = K31 = a3 K14 = K41 = a4
Other elements remain 0. However, note that the other elements might be supposed to contain non-zero values as well. We couldn't find an appropriate solution yet, though, and these elements are expected to be rather small. Also, using the absorption part only is anyway only a rough approximation. Hence, we deem the assumption of setting the remaining elements to zero reasonable.
Output and Input:
ext_mat | Extinction matrix. Input: |
abs_vec | Absorption vector. |
stokes_dim | as the WSV. |
Definition at line 1769 of file optproperties.cc.
References ARTS_ASSERT.
void ext_matTransform | ( | PropagationMatrix & | ext_mat_lab, |
ConstTensor3View | ext_mat_data, | ||
ConstVectorView | za_datagrid, | ||
ConstVectorView | aa_datagrid, | ||
const PType & | ptype, | ||
const Numeric & | za_sca, | ||
const Numeric & | aa_sca, | ||
const Verbosity & | verbosity | ||
) |
Transformation of extinction matrix.
In the single scattering database the data of the extinction matrix is stored in different coordinate systems, depending on the type (ptype) of the scattering particle (scattering element).
See AUG for information about the different classifications of the scattering elements.
Output and Input:
ext_mat_lab | Extinction matrix in Laboratory frame. Input: |
ext_mat_data | Extinction matrix in database. |
za_datagrid | Zenith angle grid in the database. |
aa_datagrid | Zenith angle grid in the database. |
ptype | Type of scattering element. |
za_sca | Zenith angle of scattered direction. |
aa_sca | Azimuth angle of scattered direction. |
Definition at line 1376 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR_IF, CREATE_OUT0, gridpos(), interp(), interpweights(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by opt_prop_sptFromData(), opt_prop_sptFromMonoData(), and opt_prop_sptFromScat_data().
void interpolate_scat_angle | ( | VectorView | pha_mat_int, |
ConstTensor5View | pha_mat_data, | ||
ConstVectorView | za_datagrid, | ||
const Numeric | theta | ||
) |
Interpolate data on the scattering angle.
This function is used for the transformation of the phase matrix from scattering frame to the laboratory frame for randomly oriented scattering media (case PTYPE_TOTAL_RND).
The scattering angle is calculated from the angles defining the directions of the incoming and scattered radiation. After that the data (which is stored in the data files as a function of the scattering angle) is interpolated on the calculated scattering angle.
[out] | pha_mat_int | Interpolated phase matrix. |
[out] | theta_rad | Scattering angle [rad]. |
[in] | pha_mat_data | Phase matrix in database. |
[in] | za_datagrid | Zenith angle grid in the database. |
[in] | za_sca | Zenith angle of scattered direction [rad]. |
[in] | aa_sca | Azimuth angle of scattered direction [rad]. |
[in] | za_inc | Zenith angle of incoming direction [rad]. |
[in] | aa_inc | Azimuth angle of incoming direction [rad]. |
Definition at line 1858 of file optproperties.cc.
References ARTS_ASSERT, gridpos(), interp(), and interpweights().
Referenced by pha_matTransform().
ostream & operator<< | ( | ostream & | os, |
const ScatteringMetaData & | ssd | ||
) |
Definition at line 2083 of file optproperties.cc.
ostream & operator<< | ( | ostream & | os, |
const SingleScatteringData & | ssd | ||
) |
Definition at line 2078 of file optproperties.cc.
void opt_prop_1ScatElem | ( | Tensor5View | ext_mat, |
Tensor4View | abs_vec, | ||
Index & | ptype, | ||
VectorView | t_ok, | ||
const SingleScatteringData & | ssd, | ||
const Vector & | T_array, | ||
const Matrix & | dir_array, | ||
const Index & | f_start, | ||
const Index & | t_interp_order | ||
) |
Preparing extinction and absorption from one scattering element.
Extracts and prepares extinction matrix and absorption vector data for one scattering element for one or all frequencies from the single scattering data. Includes interpolation in temperature and to propagation direction. Handles multiple output temperatures and propagation directions at a time. Temperature interpolation order can be chosen.
[out] | ext_mat | 1-scattering element extinction matrix (over freq, temp, propagation direction). |
[out] | abs_vec | 1-scattering element absorption vector (over freq, temp, propagation direction). |
[out] | ptype | Type of scattering element. |
[out] | t_ok | Flag whether T-interpol valid (length of T_array). |
[in] | ssd | Single scattering data of one scattering element. |
[in] | T_array | Temperatures to extract ext/abs for. |
[in] | dir_array | Propagation directions to extract ext/abs for (as pairs of zenith and azimuth angle per direction). |
[in] | f_start | Start index of frequency/ies to extract. |
[in] | t_interp_order | Temperature interpolation order. |
Definition at line 407 of file optproperties.cc.
References SingleScatteringData::abs_vec_data, abs_vec_SSD2Stokes(), ARTS_ASSERT, SingleScatteringData::ext_mat_data, ext_mat_SSD2Stokes(), SingleScatteringData::f_grid, gridpos(), interp(), interpweights(), SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, ssd_tinterp_parameters(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by opt_prop_NScatElems().
void opt_prop_Bulk | ( | Tensor5 & | ext_mat, |
Tensor4 & | abs_vec, | ||
Index & | ptype, | ||
const ArrayOfTensor5 & | ext_mat_ss, | ||
const ArrayOfTensor4 & | abs_vec_ss, | ||
const ArrayOfIndex & | ptypes_ss | ||
) |
one-line descript
Descript/Doc
[out] | name | desc. |
[in] | name | desc. |
Derives bulk properties from per-scat-species bulk properties.
Ptype is defined by the most complex ptype of the individual scattering elements.
[out] | ext_mat | Bulk extinction matrix (over freq, temp/location, propagation direction). |
[out] | abs_vec | Bulk absorption vector (over freq, temp/location, propagation direction). |
[out] | ptype | Bulk ptype. |
[in] | ext_mat_ss | Bulk extinction matrix per scattering species (over freq, temp/location, propagation direction). |
[in] | abs_vec_ss | Bulk absorption vector per scattering species (over freq, temp/location, propagation direction). |
[in] | ptypes_ss | Scattering species ptypes. |
Definition at line 88 of file optproperties.cc.
References ARTS_ASSERT, and max().
Referenced by cloudy_rt_vars_at_gp(), get_paroptprop(), and get_stepwise_scattersky_propmat().
void opt_prop_NScatElems | ( | ArrayOfArrayOfTensor5 & | ext_mat, |
ArrayOfArrayOfTensor4 & | abs_vec, | ||
ArrayOfArrayOfIndex & | ptypes, | ||
Matrix & | t_ok, | ||
const ArrayOfArrayOfSingleScatteringData & | scat_data, | ||
const Index & | stokes_dim, | ||
const Vector & | T_array, | ||
const Matrix & | dir_array, | ||
const Index & | f_index, | ||
const Index & | t_interp_order | ||
) |
Extinction and absorption from all scattering elements.
Derives temperature and direction interpolated extinction matrices and absorption vectors for all scattering elements present in scat_data.
ATTENTION: If scat_data has only one freq point, f_index=-1 (i.e. all) extracts only this one freq point. To duplicate that as needed if f_grid has more freqs is TASK of the CALLING METHOD!
Loops over opt_prop_1ScatElem and packs its output into all-scat-elements containers.
[out] | ext_mat | Extinction matrix (over scat elements, freq, temp, propagation direction). |
[out] | abs_vec | Absorption vector (over scat elements, freq, temp, propagation direction). |
[out] | ptypes | Scattering element types. |
[out] | t_ok | Flag whether T-interpol valid (over scat elements, temp). |
[in] | scat_data | as the WSV. |
[in] | stokes_dim | as the WSV. |
[in] | T_array | Temperatures to extract ext/abs for. |
[in] | dir_array | Propagation directions to extract ext/abs for (as pairs of zenith and azimuth angle per direction). |
[in] | f_index | Index of frequency to extract. -1 extracts data for all freqs available in ssd. |
[in] | t_interp_order | Temperature interpolation order. |
Definition at line 233 of file optproperties.cc.
References ARTS_ASSERT, Array< base >::nelem(), opt_prop_1ScatElem(), and TotalNumberOfElements().
Referenced by cloudy_rt_vars_at_gp(), get_paroptprop(), get_stepwise_scattersky_propmat(), and propmat_clearskyAddParticles().
void opt_prop_ScatSpecBulk | ( | ArrayOfTensor5 & | ext_mat, |
ArrayOfTensor4 & | abs_vec, | ||
ArrayOfIndex & | ptype, | ||
const ArrayOfArrayOfTensor5 & | ext_mat_se, | ||
const ArrayOfArrayOfTensor4 & | abs_vec_se, | ||
const ArrayOfArrayOfIndex & | ptypes_se, | ||
ConstMatrixView | pnds, | ||
ConstMatrixView | t_ok | ||
) |
Scattering species bulk extinction and absorption.
Derives bulk properties separately per scattering species from (input) per-scattering-elements extinction and absorption given over frequency, temperature and propagation direction.
Temperature dimension in per-scattering-element properties is assumed to correspond to column dimension of pnds (leading dimension, i.e. row, corresponds to scattering elements).
Ptype of each scattering species is defined by the most complex ptype of the individual scattering elements within this species.
[out] | ext_mat | Bulk extinction matrix per scattering species (over freq, temp/location, propagation direction). |
[out] | abs_vec | Bulk absorption vector per scattering species (over freq, temp/location, propagation direction). |
[out] | ptype | Scattering species ptypes. |
[in] | ext_mat_se | Extinction matrix per scattering element. |
[in] | abs_vec_se | Absorption vector per scattering element. |
[in] | ptypes_se | Scattering element types. |
[in] | pnds | Particle number density vectors (multiple locations). |
Definition at line 134 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR, max(), and TotalNumberOfElements().
Referenced by cloudy_rt_vars_at_gp(), get_paroptprop(), and get_stepwise_scattersky_propmat().
void opt_prop_sum_propmat_clearsky | ( | PropagationMatrix & | ext_mat, |
StokesVector & | abs_vec, | ||
const PropagationMatrix & | propmat_clearsky | ||
) |
Get optical properties from propmat_clearsky.
This turns propmat_clearsky into the extinction matrix and absorption vector for use when these are important.
Internal function to replace the old opt_prop_gas_agenda.
Output and Input:
ext_mat | Extinction matrix. |
abs_vec | Absorption vector. Input: |
propmat_clearsky | as the WSV. |
Definition at line 2104 of file optproperties.cc.
Referenced by clear_rt_vars_at_gp(), cloud_ppath_update1D_planeparallel(), cloud_RT_no_background(), and cloudy_rt_vars_at_gp().
ParticleSSDMethod ParticleSSDMethodFromString | ( | const String & | particle_ssdmethod_string | ) |
Convert particle ssd method name to enum value.
Returns the ParticleSSDMethod enum value for the given String.
[in] | particle_ssdmethod_string | Particle SSD method name |
Definition at line 2330 of file optproperties.cc.
References ARTS_USER_ERROR, and PARTICLE_SSDMETHOD_TMATRIX.
void pha_mat_1ScatElem | ( | Tensor6View | pha_mat, |
Index & | ptype, | ||
VectorView | t_ok, | ||
const SingleScatteringData & | ssd, | ||
const Vector & | T_array, | ||
const Matrix & | pdir_array, | ||
const Matrix & | idir_array, | ||
const Index & | f_start, | ||
const Index & | t_interp_order | ||
) |
Preparing phase matrix from one scattering element.
Extracts and prepares phase matrix data for one scattering element for one or all frequencies from the single scattering data. Includes interpolation in temperature as well as in incident and to propagation direction. Handles multiple output temperatures, propagation and incident directions at a time. Temperature interpolation order can be chosen.
[out] | pha_mat | 1-scattering element phase matrix (over freq, temp, propagation dir, incident dir). |
[out] | ptype | Type of scattering element. |
[out] | t_ok | Flag whether T-interpol valid (length of T_array). |
[in] | ssd | Single scattering data of one scattering element. |
[in] | T_array | Temperatures to extract pha for. |
[in] | pdir_array | Propagation directions to extract pha for (as pairs of zenith and azimuth angle per direction). |
[in] | idir_array | Inident directions to extract pha for (as pairs of zenith and azimuth angle per direction). |
[in] | f_start | Start index of frequency/ies to extract. |
[in] | t_interp_order | Temperature interpolation order. |
Definition at line 952 of file optproperties.cc.
References SingleScatteringData::aa_grid, ARTS_ASSERT, SingleScatteringData::f_grid, gridpos(), interp(), interpweights(), SingleScatteringData::pha_mat_data, pha_mat_labCalc(), SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, RAD2DEG, scat_angle(), ssd_tinterp_parameters(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by get_stepwise_scattersky_source(), iyRadarSingleScat(), and pha_mat_NScatElems().
void pha_mat_Bulk | ( | Tensor6 & | pha_mat, |
Index & | ptype, | ||
const ArrayOfTensor6 & | pha_mat_ss, | ||
const ArrayOfIndex & | ptypes_ss | ||
) |
Scattering species bulk phase matrix.
Derives bulk properties from per-scat-species bulk properties.
Ptype is defined by the most complex ptype of the individual scattering elements.
[out] | pha_mat | Bulk phase matrix (over freq, temp/location, propagation direction, incident direction). |
[out] | ptype | Bulk ptype. |
[in] | pha_mat_ss | Bulk phase matrix per scattering species (over freq, temp/location, propagation direction, incident direction). |
[in] | ptypes_ss | Scattering species ptypes. |
Definition at line 742 of file optproperties.cc.
References max().
Referenced by get_parZ(), MCRadar(), and Sample_los().
void pha_mat_labCalc | ( | MatrixView | pha_mat_lab, |
ConstVectorView | pha_mat_int, | ||
const Numeric & | za_sca, | ||
const Numeric & | aa_sca, | ||
const Numeric & | za_inc, | ||
const Numeric & | aa_inc, | ||
const Numeric & | theta_rad | ||
) |
Calculate phase matrix in laboratory coordinate system.
Transformation function for the phase matrix for the case of randomly oriented particles (case PTYPE_TOTAL_RND).
Some of the formulas can be found in
Mishchenkho: "Scattering, Absorption and Emission of Light by Small Particles", Cambridge University Press, 2002 Capter 4
The full set of formulas will be documented in AUG.
Output and Input:
pha_mat_lab | Phase matrix in laboratory frame. Input: |
pha_mat_int | Interpolated phase matrix. |
za_sca | Zenith angle of scattered direction. |
aa_sca | Azimuth angle of scattered direction. |
za_inc | Zenith angle of incoming direction. |
aa_inc | Azimuth angle of incoming direction. |
theta_rad | Scattering angle [rad]. |
Definition at line 1902 of file optproperties.cc.
References ARTS_USER_ERROR_IF, Conversion::deg2rad(), F11, F12, F22, F33, F34, F44, Constant::pi, and Constant::two_pi.
Referenced by gas_scattering_matRayleigh(), pha_mat_1ScatElem(), and pha_matTransform().
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.
Derives temperature and direction interpolated phase matrices for all scattering elements present in scat_data.
ATTENTION: If scat_data has only one freq point, f_index=-1 (i.e. all) extracts only this one freq point. To duplicate that as needed if f_grid has more freqs is TASK of the CALLING METHOD!
Loops over pha_mat_1ScatElem and packs its output into all-scat-elements containers.
[out] | pha_mat | Phase matrix (over scat elements, freq, temp, propagation direction, incident direction). |
[out] | ptypes | Scattering element types. |
[out] | t_ok | Flag whether T-interpol valid (over scat elements, temp). |
[in] | scat_data | as the WSV. |
[in] | stokes_dim | as the WSV. |
[in] | T_array | Temperatures to extract pha for. |
[in] | pdir_array | Propagation directions to extract pha for (as pairs of zenith and azimuth angle per direction). |
[in] | idir_array | Incident directions to extract pha for (as pairs of zenith and azimuth angle per direction). |
[in] | f_index | Index of frequency to extract. -1 extracts data for all freqs available in ssd. |
[in] | t_interp_order | Temperature interpolation order. |
Definition at line 867 of file optproperties.cc.
References ARTS_ASSERT, Array< base >::nelem(), pha_mat_1ScatElem(), and TotalNumberOfElements().
Referenced by get_parZ(), MCRadar(), and Sample_los().
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.
Derives bulk properties separately per scattering species from (input) per-scattering-elements phase matrices given over frequency, temperature and propagation direction.
Temperature dimension in per-scattering-element properties is assumed to correspond to column dimension of pnds (leading dimension, i.e. row, corresponds to scattering elements).
Ptype of each scattering species is defined by the most complex ptype of the individual scattering elements within this species.
[out] | pha_mat | Bulk phase matrix per scattering species (over freq, temp/location, propagation direction, incident direction). |
[out] | ptype | Scattering species ptypes. |
[in] | pha_mat_se | Phase matrix per scattering element. |
[in] | ptypes_se | Scattering element types. |
[in] | pnds | Particle number density vectors (multiple locations). |
Definition at line 780 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR, max(), and TotalNumberOfElements().
Referenced by get_parZ(), MCRadar(), and Sample_los().
void pha_matTransform | ( | MatrixView | pha_mat_lab, |
ConstTensor5View | pha_mat_data, | ||
ConstVectorView | za_datagrid, | ||
ConstVectorView | aa_datagrid, | ||
const PType & | ptype, | ||
const Index & | za_sca_idx, | ||
const Index & | aa_sca_idx, | ||
const Index & | za_inc_idx, | ||
const Index & | aa_inc_idx, | ||
ConstVectorView | za_grid, | ||
ConstVectorView | aa_grid, | ||
const Verbosity & | verbosity | ||
) |
Transformation of phase matrix.
In the single scattering database the data of the phase matrix is stored in different coordinate systems, depending on the type (ptype) of the scattering particle (scattering element).
See AUG for information about the different classifications of the scattering elements.
[in,out] | pha_mat_lab | Phase matrix in Laboratory frame. |
[in] | pha_mat_data | Phase matrix in database. |
[in] | za_datagrid | Zenith angle grid in the database. |
[in] | aa_datagrid | Zenith angle grid in the database. |
[in] | ptype | Type of scattering element. |
[in] | za_sca_idx | Index of zenith angle of scattered direction within za_grid. |
[in] | aa_sca_idx | Index of azimuth angle of scattered direction within aa_grid. |
[in] | za_inc_idx | Index of zenith angle of incoming direction within za_grid. |
[in] | aa_inc_idx | Index of azimuth angle of incoming direction within aa_grid. |
[in] | za_grid | Grid of zenith angles to extract pha_mat for. |
[in] | aa_grid | Grid of azimuth angles to extract pha_mat for. |
Definition at line 1494 of file optproperties.cc.
References ARTS_ASSERT, ARTS_USER_ERROR_IF, CREATE_OUT0, gridpos(), interp(), interpolate_scat_angle(), interpweights(), pha_mat_labCalc(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, RAD2DEG, and scat_angle().
Referenced by DoitScatteringDataPrepare(), pha_mat_sptFromData(), pha_mat_sptFromMonoData(), and pha_mat_sptFromScat_data().
Convert ptype name to enum value.
Returns the PType enum value for the given String.
This is the conversion for SingleScatteringData version 2.
[in] | ptype_string | Particle type name |
Definition at line 2164 of file optproperties.cc.
References ARTS_USER_ERROR, PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by xml_read_from_stream().
Convert ptype name to enum value.
Returns the PType enum value for the given String.
This is the conversion for SingleScatteringData version 2.
[in] | ptype_string | Particle type name |
Definition at line 2135 of file optproperties.cc.
References ARTS_USER_ERROR, PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by scat_data_singleTmatrix(), and xml_read_from_stream().
String PTypeToString | ( | const ParticleSSDMethod & | particle_ssdmethod | ) |
Convert particle type enum value to String.
Returns the PType enum value for the given String.
[in] | ptype | Particle type |
Definition at line 2354 of file optproperties.cc.
References ARTS_USER_ERROR, and PARTICLE_SSDMETHOD_TMATRIX.
Convert particle type enum value to String.
Returns the PType enum value for the given String.
[in] | ptype | Particle type |
Definition at line 2191 of file optproperties.cc.
References ARTS_USER_ERROR, PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by check_disort_input(), check_disort_irradiance_input(), and xml_write_to_stream().
Numeric scat_angle | ( | const Numeric & | za_sca, |
const Numeric & | aa_sca, | ||
const Numeric & | za_inc, | ||
const Numeric & | aa_inc | ||
) |
Calculates the scattering angle.
The scattering angle is calculated from the angles defining the directions of the incoming and scattered radiation.
[in] | za_sca | Zenith angle of scattered direction [deg]. |
[in] | aa_sca | Azimuth angle of scattered direction [deg]. |
[in] | za_inc | Zenith angle of incoming direction [deg]. |
[in] | aa_inc | Azimuth angle of incoming direction [deg]. |
Definition at line 1804 of file optproperties.cc.
References Conversion::cosd(), Conversion::deg2rad(), PI, and Conversion::sind().
Referenced by gas_scattering_matRayleigh(), pha_mat_1ScatElem(), and pha_matTransform().
ArrayOfLagrangeInterpolation ssd_tinterp_parameters | ( | VectorView | t_ok, |
Index & | this_T_interp_order, | ||
ConstVectorView | T_grid, | ||
const Vector & | T_array, | ||
const Index & | t_interp_order | ||
) |
Determine T-interpol parameters for a specific scattering element.
Determine T-interpol order as well as interpol positions and weights (they are the same for all directions (and freqs), ie it is sufficient to calculate them once).
[out] | t_ok | Flag whether T-interpol valid (length of T_array). |
[out] | this_T_interp_order | Temperature interpolation order adjusted according to data availability. |
[out] | T_lag | GridPos data for temperature interpolation. |
[out] | T_itw | Interpolation weights for temperature interpolation. |
[in] | T_grid | Single scattering data temperature grid. |
[in] | T_array | Temperatures to extract single scattering data for. |
[in] | t_interp_order | Requested temperature interpolation order. |
Definition at line 314 of file optproperties.cc.
References chk_interpolation_grids(), and min().
Referenced by opt_prop_1ScatElem(), and pha_mat_1ScatElem().
|
inlineconstexpr |
Definition at line 36 of file optproperties.cc.
|
inlineconstexpr |
Definition at line 39 of file optproperties.cc.
Referenced by scat_angle().
|
inlineconstexpr |
Definition at line 37 of file optproperties.cc.
Referenced by pha_mat_1ScatElem(), and pha_matTransform().