ARTS  2.4.0(git:4fb77825)
optproperties.h File Reference

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< SingleScatteringDataArrayOfSingleScatteringData
 
typedef Array< Array< SingleScatteringData > > ArrayOfArrayOfSingleScatteringData
 
typedef Array< ScatteringMetaDataArrayOfScatteringMetaData
 
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)
 

Detailed Description

Scattering database structure and functions.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e
Date
2003-03-06

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.

Typedef Documentation

◆ ArrayOfArrayOfScatteringMetaData

◆ ArrayOfArrayOfSingleScatteringData

◆ ArrayOfScatteringMetaData

◆ ArrayOfSingleScatteringData

Enumeration Type Documentation

◆ 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.

◆ PType

enum PType : Index

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.

Function Documentation

◆ abs_vec_SSD2Stokes()

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.

Parameters
[out]abs_vec_stokesabsvec in stokes notation (stokes_dim).
[in]abs_vec_ssdabsvec at 1f, 1T, 1dir in scat_data compact (vector) format.
[in]stokes_dimas the WSM.
[in]ptypeType of scattering element.
Author
Jana Mendrok
Date
2018-01-15

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().

◆ abs_vecTransform()

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:

Parameters
abs_vec_labAbsorption vector in Laboratory frame. Input:
abs_vec_dataAbsorption vector in database.
za_datagridZenith angle grid in the database.
aa_datagridZenith angle grid in the database.
ptypeType of scattering element.
za_scaZenith angle of scattered direction.
aa_scaAzimuth angle of scattered direction.
Author
Claudia Emde
Date
2003-05-24

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().

◆ ConvertAzimuthallyRandomSingleScatteringData()

◆ ext_mat_SSD2Stokes()

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.

Parameters
[out]ext_mat_stokesextmat in stokes notation (stokes_dim,stokes_dim).
[in]ext_mat_ssdextmat at 1f, 1T, 1dir in scat_data compact (vector) format.
[in]stokes_dimas the WSM.
[in]ptypetype of scattering element.
Author
Jana Mendrok
Date
2018-01-15

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().

◆ ext_matFromabs_vec()

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:

Parameters
ext_matExtinction matrix. Input:
abs_vecAbsorption vector.
stokes_dimas the WSV.
Author
Jana Mendrok
Date
2013-04-30

Definition at line 1969 of file optproperties.cc.

References ARTS::Var::abs_vec(), ARTS::Var::ext_mat(), and ARTS::Var::stokes_dim().

◆ ext_matTransform()

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:

Parameters
ext_mat_labExtinction matrix in Laboratory frame. Input:
ext_mat_dataExtinction matrix in database.
za_datagridZenith angle grid in the database.
aa_datagridZenith angle grid in the database.
ptypeType of scattering element.
za_scaZenith angle of scattered direction.
aa_scaAzimuth angle of scattered direction.
Author
Claudia Emde
Date
2003-05-24

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().

◆ FouComp_1ScatElem()

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.

Parameters
[out]pha_mat_fou1-scattering element phase matrix Fourier components (over freq, temp, propagation dir, incident dir).
[out]ptypeType of scattering element.
[out]t_okFlag whether T-interpol valid (length of T_array).
[in]ssdSingle scattering data of one scattering element.
[in]T_arrayTemperatures to extract pha for.
[in]pdir_arrayPropagation directions (polar only) to extract Fourier components for.
[in]idir_arrayIncident directions (polar only) to extract Fourier components for.
[in]f_startStart index of frequency/ies to extract.
[in]t_interp_orderTemperature interpolation order.
[in]naa_totranNumber of (equidistant) azimuth directions to consider in calculation of Fourier series for totally random orientation elements.
Author
Jana Mendrok
Date
2018-05-01

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.

◆ interpolate_scat_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.

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.

Parameters
[out]pha_mat_intInterpolated phase matrix.
[out]theta_radScattering angle [rad].
[in]pha_mat_dataPhase matrix in database.
[in]za_datagridZenith angle grid in the database.
[in]za_scaZenith angle of scattered direction [rad].
[in]aa_scaAzimuth angle of scattered direction [rad].
[in]za_incZenith angle of incoming direction [rad].
[in]aa_incAzimuth angle of incoming direction [rad].
Author
Claudia Emde
Date
2003-08-19

Definition at line 2154 of file optproperties.cc.

References gridpos(), interp(), interpweights(), joker, and ConstTensor5View::ncols().

Referenced by pha_matTransform().

◆ operator<<() [1/4]

ostream& operator<< ( ostream &  os,
const ArrayOfScatteringMetaData assd 
)

Definition at line 2393 of file optproperties.cc.

◆ operator<<() [2/4]

ostream& operator<< ( ostream &  os,
const ArrayOfSingleScatteringData assd 
)

Definition at line 2383 of file optproperties.cc.

◆ operator<<() [3/4]

ostream& operator<< ( ostream &  os,
const ScatteringMetaData ssd 
)

Definition at line 2388 of file optproperties.cc.

◆ operator<<() [4/4]

ostream& operator<< ( ostream &  os,
const SingleScatteringData ssd 
)

Definition at line 2378 of file optproperties.cc.

◆ opt_prop_1ScatElem()

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.

Parameters
[out]ext_mat1-scattering element extinction matrix (over freq, temp, propagation direction).
[out]abs_vec1-scattering element absorption vector (over freq, temp, propagation direction).
[out]ptypeType of scattering element.
[out]t_okFlag whether T-interpol valid (length of T_array).
[in]ssdSingle scattering data of one scattering element.
[in]T_arrayTemperatures to extract ext/abs for.
[in]dir_arrayPropagation directions to extract ext/abs for (as pairs of zenith and azimuth angle per direction).
[in]f_startStart index of frequency/ies to extract.
[in]t_interp_orderTemperature interpolation order.
Author
Jana Mendrok
Date
2018-01-15

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().

◆ opt_prop_Bulk()

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

Parameters
[out]namedesc.
[in]namedesc.
Author
Jana Mendrok
Date
2018-01-15 Scattering species bulk extinction and absorption.

Derives bulk properties from per-scat-species bulk properties.

Ptype is defined by the most complex ptype of the individual scattering elements.

Parameters
[out]ext_matBulk extinction matrix (over freq, temp/location, propagation direction).
[out]abs_vecBulk absorption vector (over freq, temp/location, propagation direction).
[out]ptypeBulk ptype.
[in]ext_mat_ssBulk extinction matrix per scattering species (over freq, temp/location, propagation direction).
[in]abs_vec_ssBulk absorption vector per scattering species (over freq, temp/location, propagation direction).
[in]ptypes_ssScattering species ptypes.
Author
Jana Mendrok
Date
2018-01-16

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().

◆ opt_prop_NScatElems()

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.

Parameters
[out]ext_matExtinction matrix (over scat elements, freq, temp, propagation direction).
[out]abs_vecAbsorption vector (over scat elements, freq, temp, propagation direction).
[out]ptypesScattering element types.
[out]t_okFlag whether T-interpol valid (over scat elements, temp).
[in]scat_dataas the WSV.
[in]stokes_dimas the WSV.
[in]T_arrayTemperatures to extract ext/abs for.
[in]dir_arrayPropagation directions to extract ext/abs for (as pairs of zenith and azimuth angle per direction).
[in]f_indexIndex of frequency to extract. -1 extracts data for all freqs available in ssd.
[in]t_interp_orderTemperature interpolation order.
Author
Jana Mendrok
Date
2018-01-16

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().

◆ opt_prop_ScatSpecBulk()

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.

Parameters
[out]ext_matBulk extinction matrix per scattering species (over freq, temp/location, propagation direction).
[out]abs_vecBulk absorption vector per scattering species (over freq, temp/location, propagation direction).
[out]ptypeScattering species ptypes.
[in]ext_mat_seExtinction matrix per scattering element.
[in]abs_vec_seAbsorption vector per scattering element.
[in]ptypes_seScattering element types.
[in]pndsParticle number density vectors (multiple locations).
Author
Jana Mendrok
Date
2018-01-16

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().

◆ opt_prop_sum_propmat_clearsky()

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:

Parameters
ext_matExtinction matrix.
abs_vecAbsorption vector. Input:
propmat_clearskyas the WSV.
Author
Richard Larsson
Date
2012-07-24

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().

◆ ParticleSSDMethodFromString()

ParticleSSDMethod ParticleSSDMethodFromString ( const String particle_ssdmethod_string)

Convert particle ssd method name to enum value.

Returns the ParticleSSDMethod enum value for the given String.

Parameters
[in]particle_ssdmethod_stringParticle SSD method name
Returns
ParticleSSDMethod enum value
Author
Oliver Lemke

Definition at line 2658 of file optproperties.cc.

References PARTICLE_SSDMETHOD_TMATRIX.

◆ ParticleSSDMethodToString()

String ParticleSSDMethodToString ( const ParticleSSDMethod particle_ssdmethod_type)

◆ pha_mat_1ScatElem()

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.

Parameters
[out]pha_mat1-scattering element phase matrix (over freq, temp, propagation dir, incident dir).
[out]ptypeType of scattering element.
[out]t_okFlag whether T-interpol valid (length of T_array).
[in]ssdSingle scattering data of one scattering element.
[in]T_arrayTemperatures to extract pha for.
[in]pdir_arrayPropagation directions to extract pha for (as pairs of zenith and azimuth angle per direction).
[in]idir_arrayInident directions to extract pha for (as pairs of zenith and azimuth angle per direction).
[in]f_startStart index of frequency/ies to extract.
[in]t_interp_orderTemperature interpolation order.
Author
Jana Mendrok
Date
2018-03-22

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().

◆ pha_mat_Bulk()

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.

Parameters
[out]pha_matBulk phase matrix (over freq, temp/location, propagation direction, incident direction).
[out]ptypeBulk ptype.
[in]pha_mat_ssBulk phase matrix per scattering species (over freq, temp/location, propagation direction, incident direction).
[in]ptypes_ssScattering species ptypes.
Author
Jana Mendrok
Date
2018-03-24

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().

◆ pha_mat_labCalc()

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:

Parameters
pha_mat_labPhase matrix in laboratory frame. Input:
pha_mat_intInterpolated phase matrix.
za_scaZenith angle of scattered direction.
aa_scaAzimuth angle of scattered direction.
za_incZenith angle of incoming direction.
aa_incAzimuth angle of incoming direction.
theta_radScattering angle [rad].
Author
Claudia Emde
Date
2003-05-13

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().

◆ pha_mat_NScatElems()

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.

Parameters
[out]pha_matPhase matrix (over scat elements, freq, temp, propagation direction, incident direction).
[out]ptypesScattering element types.
[out]t_okFlag whether T-interpol valid (over scat elements, temp).
[in]scat_dataas the WSV.
[in]stokes_dimas the WSV.
[in]T_arrayTemperatures to extract pha for.
[in]pdir_arrayPropagation directions to extract pha for (as pairs of zenith and azimuth angle per direction).
[in]idir_arrayIncident directions to extract pha for (as pairs of zenith and azimuth angle per direction).
[in]f_indexIndex of frequency to extract. -1 extracts data for all freqs available in ssd.
[in]t_interp_orderTemperature interpolation order.
Author
Jana Mendrok
Date
2018-03-24

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().

◆ pha_mat_ScatSpecBulk()

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.

Parameters
[out]pha_matBulk phase matrix per scattering species (over freq, temp/location, propagation direction, incident direction).
[out]ptypeScattering species ptypes.
[in]pha_mat_sePhase matrix per scattering element.
[in]ptypes_seScattering element types.
[in]pndsParticle number density vectors (multiple locations).
Author
Jana Mendrok
Date
2018-03-24

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().

◆ pha_matTransform()

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.

Parameters
[in,out]pha_mat_labPhase matrix in Laboratory frame.
[in]pha_mat_dataPhase matrix in database.
[in]za_datagridZenith angle grid in the database.
[in]aa_datagridZenith angle grid in the database.
[in]ptypeType of scattering element.
[in]za_sca_idxIndex of zenith angle of scattered direction within za_grid.
[in]aa_sca_idxIndex of azimuth angle of scattered direction within aa_grid.
[in]za_inc_idxIndex of zenith angle of incoming direction within za_grid.
[in]aa_inc_idxIndex of azimuth angle of incoming direction within aa_grid.
[in]za_gridGrid of zenith angles to extract pha_mat for.
[in]aa_gridGrid of azimuth angles to extract pha_mat for.
Author
Claudia Emde
Date
2003-08-19

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().

◆ PType2FromString()

PType PType2FromString ( const String ptype_string)

Convert ptype name to enum value.

Returns the PType enum value for the given String.

This is the conversion for SingleScatteringData version 2.

Parameters
[in]ptype_stringParticle type name
Returns
PType enum value
Author
Oliver Lemke

Definition at line 2484 of file optproperties.cc.

References PTYPE_AZIMUTH_RND, PTYPE_GENERAL, and PTYPE_TOTAL_RND.

Referenced by xml_read_from_stream().

◆ PTypeFromString()

PType PTypeFromString ( const String ptype_string)

Convert ptype name to enum value.

Returns the PType enum value for the given String.

This is the conversion for SingleScatteringData version 2.

Parameters
[in]ptype_stringParticle type name
Returns
PType enum value
Author
Oliver Lemke

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().

◆ PTypeToString()

String PTypeToString ( const PType ptype)

Convert particle type enum value to String.

Returns the PType enum value for the given String.

Parameters
[in]ptypeParticle type
Returns
String representation of PType
Author
Oliver Lemke

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().

◆ scat_angle()

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.

Parameters
[out]theta_radScattering angle [rad].
[in]za_scaZenith angle of scattered direction [rad].
[in]aa_scaAzimuth angle of scattered direction [rad].
[in]za_incZenith angle of incoming direction [rad].
[in]aa_incAzimuth angle of incoming direction [rad].
Author
Jana Mendrok (moved out from interpolate_scat_angle by C.Emde)
Date
2018-03-23

Definition at line 2095 of file optproperties.cc.

Referenced by FouComp_1ScatElem(), pha_mat_1ScatElem(), and pha_matTransform().

◆ ssd_tinterp_parameters()

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).

Parameters
[out]t_okFlag whether T-interpol valid (length of T_array).
[out]this_T_interp_orderTemperature interpolation order adjusted according to data availability.
[out]T_gpGridPos data for temperature interpolation.
[out]T_itwInterpolation weights for temperature interpolation.
[in]T_gridSingle scattering data temperature grid.
[in]T_arrayTemperatures to extract single scattering data for.
[in]t_interp_orderRequested temperature interpolation order.
Author
Jana Mendrok
Date
2018-05-01

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().