ARTS
2.4.0(git:4fb77825)
|
Scattering database structure and functions. More...
#include "gridded_fields.h"
#include "interpolation_poly.h"
#include "matpackVII.h"
#include "messages.h"
#include "mystring.h"
#include "propagationmatrix.h"
Go to the source code of this file.
Classes | |
struct | SingleScatteringData |
struct | ScatteringMetaData |
Typedefs | |
typedef Array< SingleScatteringData > | ArrayOfSingleScatteringData |
typedef Array< Array< SingleScatteringData > > | ArrayOfArrayOfSingleScatteringData |
typedef Array< ScatteringMetaData > | ArrayOfScatteringMetaData |
typedef Array< Array< ScatteringMetaData > > | ArrayOfArrayOfScatteringMetaData |
Enumerations | |
enum | PType : Index { PTYPE_GENERAL = 300, PTYPE_AZIMUTH_RND = 200, PTYPE_TOTAL_RND = 100 } |
An attribute to classify the particle type (ptype) of a SingleScatteringData. More... | |
enum | ParticleSSDMethod { PARTICLE_SSDMETHOD_NONE = 0, PARTICLE_SSDMETHOD_TMATRIX = 1 } |
An attribute to classify the method to be used for SingleScatteringData. More... | |
Functions | |
ostream & | operator<< (ostream &os, const SingleScatteringData &ssd) |
ostream & | operator<< (ostream &os, const ArrayOfSingleScatteringData &assd) |
ostream & | operator<< (ostream &os, const ScatteringMetaData &ssd) |
ostream & | operator<< (ostream &os, const ArrayOfScatteringMetaData &assd) |
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 More... | |
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. More... | |
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=1) |
Extinction and absorption from all scattering elements. More... | |
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_index, const Index &t_interp_order=1) |
Preparing extinction and absorption from one scattering element. More... | |
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. More... | |
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. More... | |
void | pha_mat_Bulk (Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss) |
Scattering species bulk phase matrix. More... | |
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. More... | |
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=1) |
Phase matrices from all scattering elements. More... | |
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=1) |
Preparing phase matrix from one scattering element. More... | |
void | FouComp_1ScatElem (Tensor7View pha_mat_fou, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Vector &pdir_array, const Vector &idir_array, const Index &f_start, const Index &t_interp_order, const Index &naa_totran) |
Preparing phase matrix fourier series components for one scattering element. More... | |
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. More... | |
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. More... | |
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. More... | |
void | ext_matFromabs_vec (MatrixView ext_mat, ConstVectorView abs_vec, const Index &stokes_dim) |
Derive extinction matrix from absorption vector. More... | |
void | ssd_tinterp_parameters (VectorView t_ok, Index &this_T_interp_order, ArrayOfGridPosPoly &T_gp, Matrix &T_itw, ConstVectorView T_grid, const Vector &T_array, const Index &t_interp_order) |
Determine T-interpol parameters for a specific scattering element. More... | |
Numeric | scat_angle (const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc) |
Calculates the scattering angle. More... | |
void | interpolate_scat_angle (VectorView pha_mat_int, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, const Numeric theta) |
Interpolate data on the scattering angle. More... | |
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. More... | |
void | opt_prop_sum_propmat_clearsky (PropagationMatrix &ext_mat, StokesVector &abs_vec, const ArrayOfPropagationMatrix &propmat_clearsky) |
Get optical properties from propmat_clearsky. More... | |
PType | PTypeFromString (const String &ptype_string) |
Convert ptype name to enum value. More... | |
PType | PType2FromString (const String &ptype_string) |
Convert ptype name to enum value. More... | |
String | PTypeToString (const PType &ptype) |
Convert particle type enum value to String. More... | |
void | ConvertAzimuthallyRandomSingleScatteringData (SingleScatteringData &ssd) |
Convert azimuthally-random oriented SingleScatteringData to latest version. More... | |
ParticleSSDMethod | ParticleSSDMethodFromString (const String &particle_ssdmethod_string) |
Convert particle ssd method name to enum value. More... | |
String | ParticleSSDMethodToString (const ParticleSSDMethod &particle_ssdmethod_type) |
Scattering database structure and functions.
This file contains the definition of the SingleScatteringData structure and the functions in optproperties.cc that are of interest elsewhere.
Definition in file optproperties.h.
Definition at line 120 of file optproperties.h.
Definition at line 93 of file optproperties.h.
Definition at line 119 of file optproperties.h.
Definition at line 92 of file optproperties.h.
enum ParticleSSDMethod |
An attribute to classify the method to be used for SingleScatteringData.
NONE Dummy value TMATRIX T-Matrix method
Enumerator | |
---|---|
PARTICLE_SSDMETHOD_NONE | |
PARTICLE_SSDMETHOD_TMATRIX |
Definition at line 64 of file optproperties.h.
An attribute to classify the particle type (ptype) of a SingleScatteringData.
PTYPE_GENERAL General case PTYPE_TOTAL_RND Totally randomly oriented particles PTYPE_AZIMUTH_RND Azimuthally randomly oriented particles
A detailed description of the different cases can be found in AUG.
Enumerator | |
---|---|
PTYPE_GENERAL | |
PTYPE_AZIMUTH_RND | |
PTYPE_TOTAL_RND |
Definition at line 53 of file optproperties.h.
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 633 of file optproperties.cc.
References PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, and ARTS::Var::stokes_dim().
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 1474 of file optproperties.cc.
References CREATE_OUT0, gridpos(), interp(), interpweights(), joker, PropagationMatrix::K12(), PropagationMatrix::Kjj(), ConstTensor3View::ncols(), PropagationMatrix::NumberOfFrequencies(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, PropagationMatrix::SetZero(), ARTS::Var::stokes_dim(), and PropagationMatrix::StokesDimensions().
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 2544 of file optproperties.cc.
References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, chk_size(), SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, is_same_within_epsilon(), joker, ConstTensor5View::nbooks(), ConstTensor7View::nbooks(), ConstTensor5View::ncols(), ConstTensor7View::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor5View::nrows(), ConstTensor7View::nrows(), ConstTensor5View::nshelves(), ConstTensor7View::nshelves(), ConstTensor7View::nvitrines(), SingleScatteringData::pha_mat_data, Tensor7::resize(), Tensor5::resize(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by xml_read_from_stream().
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 585 of file optproperties.cc.
References PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, and ARTS::Var::stokes_dim().
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 1969 of file optproperties.cc.
References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), and ARTS::Var::stokes_dim().
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 1572 of file optproperties.cc.
References CREATE_OUT0, gridpos(), interp(), interpweights(), joker, PropagationMatrix::K12(), PropagationMatrix::K34(), PropagationMatrix::Kjj(), ConstTensor3View::ncols(), PropagationMatrix::NumberOfFrequencies(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, PropagationMatrix::SetZero(), ARTS::Var::stokes_dim(), and PropagationMatrix::StokesDimensions().
Referenced by opt_prop_sptFromData(), opt_prop_sptFromMonoData(), and opt_prop_sptFromScat_data().
void FouComp_1ScatElem | ( | Tensor7View | pha_mat_fou, |
Index & | ptype, | ||
VectorView | t_ok, | ||
const SingleScatteringData & | ssd, | ||
const Vector & | T_array, | ||
const Vector & | pdir_array, | ||
const Vector & | idir_array, | ||
const Index & | f_start, | ||
const Index & | t_interp_order, | ||
const Index & | naa_totran | ||
) |
Preparing phase matrix fourier series components for one scattering element.
Calculates phase matrix fourier series components (currently only mode 0) for one scattering element for one or all frequencies from the single scattering data. Includes interpolation in temperature as well as in incident and scattered stream directions. Handles multiple output temperatures, propagation and incident directions at a time. Temperature interpolation order can be chosen.
[out] | pha_mat_fou | 1-scattering element phase matrix Fourier components (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 (polar only) to extract Fourier components for. |
[in] | idir_array | Incident directions (polar only) to extract Fourier components for. |
[in] | f_start | Start index of frequency/ies to extract. |
[in] | t_interp_order | Temperature interpolation order. |
[in] | naa_totran | Number of (equidistant) azimuth directions to consider in calculation of Fourier series for totally random orientation elements. |
Definition at line 1218 of file optproperties.cc.
References ARTS::Var::aa_grid(), SingleScatteringData::aa_grid, SingleScatteringData::f_grid, gridpos(), interp(), interpweights(), joker, ConstTensor7View::nbooks(), ConstTensor7View::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), nlinspace(), ConstTensor7View::npages(), ConstTensor7View::nrows(), ConstTensor7View::nshelves(), ConstTensor7View::nvitrines(), ARTS::Var::pha_mat(), SingleScatteringData::pha_mat_data, pha_mat_labCalc(), SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, RAD2DEG, scat_angle(), ssd_tinterp_parameters(), ARTS::Var::stokes_dim(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
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 2154 of file optproperties.cc.
References gridpos(), interp(), interpweights(), joker, and ConstTensor5View::ncols().
Referenced by pha_matTransform().
ostream& operator<< | ( | ostream & | os, |
const ArrayOfScatteringMetaData & | assd | ||
) |
Definition at line 2393 of file optproperties.cc.
ostream& operator<< | ( | ostream & | os, |
const ArrayOfSingleScatteringData & | assd | ||
) |
Definition at line 2383 of file optproperties.cc.
ostream& operator<< | ( | ostream & | os, |
const ScatteringMetaData & | ssd | ||
) |
Definition at line 2388 of file optproperties.cc.
ostream& operator<< | ( | ostream & | os, |
const SingleScatteringData & | ssd | ||
) |
Definition at line 2378 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 335 of file optproperties.cc.
References ARTS::Var::abs_vec(), SingleScatteringData::abs_vec_data, abs_vec_SSD2Stokes(), ARTS::Var::ext_mat(), SingleScatteringData::ext_mat_data, ext_mat_SSD2Stokes(), SingleScatteringData::f_grid, gridpos(), interp(), interpweights(), joker, ConstMatrixView::ncols(), ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, ssd_tinterp_parameters(), ARTS::Var::stokes_dim(), 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 102 of file optproperties.cc.
References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), max, and Array< base >::nelem().
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 248 of file optproperties.cc.
References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), ARTS::Var::f_index(), joker, ConstVectorView::nelem(), ConstMatrixView::nrows(), opt_prop_1ScatElem(), Matrix::resize(), ARTS::Var::scat_data(), ARTS::Var::stokes_dim(), 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 148 of file optproperties.cc.
References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), joker, max, ARTS::Var::nbooks(), ConstMatrixView::ncols(), Array< base >::nelem(), Absorption::nelem(), ARTS::Var::npages(), ConstMatrixView::nrows(), ARTS::Var::stokes_dim(), 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 ArrayOfPropagationMatrix & | 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 2414 of file optproperties.cc.
References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), ARTS::Var::propmat_clearsky(), and ARTS::Var::stokes_dim().
Referenced by clear_rt_vars_at_gp(), 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 2658 of file optproperties.cc.
References PARTICLE_SSDMETHOD_TMATRIX.
String ParticleSSDMethodToString | ( | const ParticleSSDMethod & | particle_ssdmethod_type | ) |
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 881 of file optproperties.cc.
References SingleScatteringData::aa_grid, abs, SingleScatteringData::f_grid, gridpos(), interp(), interpweights(), joker, ConstVectorView::nelem(), ConstMatrixView::nrows(), ARTS::Var::pha_mat(), SingleScatteringData::pha_mat_data, pha_mat_labCalc(), SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, RAD2DEG, scat_angle(), ssd_tinterp_parameters(), ARTS::Var::stokes_dim(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by get_stepwise_scattersky_source(), 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 670 of file optproperties.cc.
References max, Array< base >::nelem(), and ARTS::Var::pha_mat().
Referenced by get_parZ(), 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 2198 of file optproperties.cc.
References DEG2RAD, F11, ConstMatrixView::ncols(), and ARTS::Var::stokes_dim().
Referenced by FouComp_1ScatElem(), 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 796 of file optproperties.cc.
References ARTS::Var::f_index(), joker, ConstVectorView::nelem(), ConstMatrixView::nrows(), ARTS::Var::pha_mat(), pha_mat_1ScatElem(), Matrix::resize(), ARTS::Var::scat_data(), ARTS::Var::stokes_dim(), and TotalNumberOfElements().
Referenced by get_parZ(), 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 708 of file optproperties.cc.
References joker, max, ConstMatrixView::ncols(), Array< base >::nelem(), ConstMatrixView::nrows(), ARTS::Var::nshelves(), ARTS::Var::pha_mat(), ARTS::Var::stokes_dim(), and TotalNumberOfElements().
Referenced by get_parZ(), 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 1692 of file optproperties.cc.
References ARTS::Var::aa_grid(), abs, CREATE_OUT0, gridpos(), interp(), interpolate_scat_angle(), interpweights(), joker, ConstMatrixView::ncols(), ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstTensor5View::npages(), pha_mat_labCalc(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, RAD2DEG, scat_angle(), ARTS::Var::stokes_dim(), and ARTS::Var::za_grid().
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 2484 of file optproperties.cc.
References 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 2454 of file optproperties.cc.
References PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by scat_data_singleTmatrix(), and xml_read_from_stream().
Convert particle type enum value to String.
Returns the PType enum value for the given String.
[in] | ptype | Particle type |
Definition at line 2512 of file optproperties.cc.
References PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.
Referenced by check_disort_input(), Compare(), 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.
[out] | theta_rad | Scattering angle [rad]. |
[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 2095 of file optproperties.cc.
Referenced by FouComp_1ScatElem(), pha_mat_1ScatElem(), and pha_matTransform().
void ssd_tinterp_parameters | ( | VectorView | t_ok, |
Index & | this_T_interp_order, | ||
ArrayOfGridPosPoly & | T_gp, | ||
Matrix & | T_itw, | ||
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_gp | 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 2008 of file optproperties.cc.
References chk_interpolation_grids(), gridpos_poly(), GridPosPoly::idx, interpweights(), min, ConstVectorView::nelem(), Vector::resize(), Matrix::resize(), and GridPosPoly::w.
Referenced by FouComp_1ScatElem(), opt_prop_1ScatElem(), and pha_mat_1ScatElem().