ARTS 2.5.11 (git: 6827797f)
optproperties.cc File Reference

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
 

Detailed Description

This file contains definitions and functions related to the optical properties of particles.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e
Date
Thu Mar 6 11:29:59 2003

Definition in file optproperties.cc.

Macro Definition Documentation

◆ F11

#define F11   pha_mat_int[0]

Definition at line 41 of file optproperties.cc.

◆ F12

#define F12   pha_mat_int[1]

Definition at line 42 of file optproperties.cc.

◆ F22

#define F22   pha_mat_int[2]

Definition at line 43 of file optproperties.cc.

◆ F33

#define F33   pha_mat_int[3]

Definition at line 44 of file optproperties.cc.

◆ F34

#define F34   pha_mat_int[4]

Definition at line 45 of file optproperties.cc.

◆ F44

#define F44   pha_mat_int[5]

Definition at line 46 of file optproperties.cc.

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 705 of file optproperties.cc.

References ARTS_ASSERT, PTYPE_AZIMUTH_RND, and PTYPE_TOTAL_RND.

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

◆ ConvertAzimuthallyRandomSingleScatteringData()

void ConvertAzimuthallyRandomSingleScatteringData ( SingleScatteringData ssd)

◆ ext_abs_pfun_from_tro()

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.

Parameters
[in,out]ext_dataExtinction [frequency, temperature]
[in,out]abs_dataAbsorption [frequency, temperature]
[in,out]pfun_dataPhase function [frequency, temperature, scattering angle]
[in]scat_dataScattering data for one scattering species
[in]issIndex for scattering species, only used for error
[in]pndParticle number density [scattering element, cloudbox level]
[in]T_gridTemperatures
[in]sa_gridScattering angles
[in]cloudbox_limitsLimits in pressure dimension
Author
Patrick Eriksspn

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

◆ 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 657 of file optproperties.cc.

References ARTS_ASSERT, PTYPE_AZIMUTH_RND, and PTYPE_TOTAL_RND.

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 1769 of file optproperties.cc.

References ARTS_ASSERT.

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

◆ 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 1858 of file optproperties.cc.

References ARTS_ASSERT, gridpos(), interp(), and interpweights().

Referenced by pha_matTransform().

◆ operator<<() [1/2]

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

Definition at line 2083 of file optproperties.cc.

◆ operator<<() [2/2]

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

Definition at line 2078 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 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().

◆ 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 88 of file optproperties.cc.

References ARTS_ASSERT, and max().

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

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

◆ opt_prop_sum_propmat_clearsky()

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:

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

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

◆ 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 2330 of file optproperties.cc.

References ARTS_USER_ERROR, and PARTICLE_SSDMETHOD_TMATRIX.

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

◆ 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 742 of file optproperties.cc.

References max().

Referenced by get_parZ(), MCRadar(), 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 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().

◆ 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 867 of file optproperties.cc.

References ARTS_ASSERT, Array< base >::nelem(), pha_mat_1ScatElem(), and TotalNumberOfElements().

Referenced by get_parZ(), MCRadar(), 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 780 of file optproperties.cc.

References ARTS_ASSERT, ARTS_USER_ERROR, max(), and TotalNumberOfElements().

Referenced by get_parZ(), MCRadar(), 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 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().

◆ 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 2164 of file optproperties.cc.

References ARTS_USER_ERROR, 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 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().

◆ PTypeToString() [1/2]

String PTypeToString ( const ParticleSSDMethod particle_ssdmethod)

Convert particle type enum value to String.

Returns the PType enum value for the given String.

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

Definition at line 2354 of file optproperties.cc.

References ARTS_USER_ERROR, and PARTICLE_SSDMETHOD_TMATRIX.

◆ PTypeToString() [2/2]

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

◆ 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
[in]za_scaZenith angle of scattered direction [deg].
[in]aa_scaAzimuth angle of scattered direction [deg].
[in]za_incZenith angle of incoming direction [deg].
[in]aa_incAzimuth angle of incoming direction [deg].
Returns
Scattering angle [rad].
Author
Jana Mendrok (moved out from interpolate_scat_angle by C.Emde)
Date
2018-03-23

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

◆ ssd_tinterp_parameters()

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

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_lagGridPos 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 314 of file optproperties.cc.

References chk_interpolation_grids(), and min().

Referenced by opt_prop_1ScatElem(), and pha_mat_1ScatElem().

Variable Documentation

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 36 of file optproperties.cc.

◆ PI

constexpr Numeric PI =pi
inlineconstexpr

Definition at line 39 of file optproperties.cc.

Referenced by scat_angle().

◆ RAD2DEG

constexpr Numeric RAD2DEG =Conversion::rad2deg(1)
inlineconstexpr

Definition at line 37 of file optproperties.cc.

Referenced by pha_mat_1ScatElem(), and pha_matTransform().