ARTS  2.3.1285(git:92a29ea9-dirty)
m_optproperties.cc File Reference

This filecontains workspace methods for calculating the optical properties for the radiative transfer. More...

#include <cfloat>
#include <cmath>
#include "array.h"
#include "arts.h"
#include "auto_md.h"
#include "check_input.h"
#include "exceptions.h"
#include "interpolation.h"
#include "logic.h"
#include "math_funcs.h"
#include "matpackIII.h"
#include "matpackVII.h"
#include "messages.h"
#include "montecarlo.h"
#include "optproperties.h"
#include "sorting.h"
#include "xml_io.h"

Go to the source code of this file.

Macros

#define PART_TYPE   scat_data[i_ss][i_se].ptype
 
#define F_DATAGRID   scat_data[i_ss][i_se].f_grid
 
#define T_DATAGRID   scat_data[i_ss][i_se].T_grid
 
#define ZA_DATAGRID   scat_data[i_ss][i_se].za_grid
 
#define AA_DATAGRID   scat_data[i_ss][i_se].aa_grid
 
#define PHA_MAT_DATA   scat_data[i_ss][i_se].pha_mat_data
 
#define EXT_MAT_DATA   scat_data[i_ss][i_se].ext_mat_data
 
#define ABS_VEC_DATA   scat_data[i_ss][i_se].abs_vec_data
 
#define PND_LIMIT   1e-12
 

Functions

void pha_mat_sptFromData (Tensor5 &pha_mat_spt, const ArrayOfArrayOfSingleScatteringData &scat_data, const Vector &za_grid, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Index &f_index, const Vector &f_grid, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: pha_mat_sptFromData. More...
 
void pha_mat_sptFromDataDOITOpt (Tensor5 &pha_mat_spt, const ArrayOfTensor7 &pha_mat_sptDOITOpt, const ArrayOfArrayOfSingleScatteringData &scat_data_mono, const Index &doit_za_grid_size, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &)
 WORKSPACE METHOD: pha_mat_sptFromDataDOITOpt. More...
 
void opt_prop_sptFromData (ArrayOfPropagationMatrix &ext_mat_spt, ArrayOfStokesVector &abs_vec_spt, const ArrayOfArrayOfSingleScatteringData &scat_data, const Vector &za_grid, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Index &f_index, const Vector &f_grid, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: opt_prop_sptFromData. More...
 
void opt_prop_sptFromScat_data (ArrayOfPropagationMatrix &ext_mat_spt, ArrayOfStokesVector &abs_vec_spt, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const Vector &za_grid, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Index &f_index, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: opt_prop_sptFromScat_data. More...
 
void opt_prop_bulkCalc (PropagationMatrix &ext_mat, StokesVector &abs_vec, const ArrayOfPropagationMatrix &ext_mat_spt, const ArrayOfStokesVector &abs_vec_spt, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &)
 WORKSPACE METHOD: opt_prop_bulkCalc. More...
 
void ext_matAddGas (PropagationMatrix &ext_mat, const ArrayOfPropagationMatrix &propmat_clearsky, const Verbosity &)
 WORKSPACE METHOD: ext_matAddGas. More...
 
void abs_vecAddGas (StokesVector &abs_vec, const ArrayOfPropagationMatrix &propmat_clearsky, const Verbosity &)
 WORKSPACE METHOD: abs_vecAddGas. More...
 
void pha_matCalc (Tensor4 &pha_mat, const Tensor5 &pha_mat_spt, const Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &)
 WORKSPACE METHOD: pha_matCalc. More...
 
void scat_dataCheck (const ArrayOfArrayOfSingleScatteringData &scat_data, const String &check_type, const Numeric &threshold, const Verbosity &verbosity)
 WORKSPACE METHOD: scat_dataCheck. More...
 
void DoitScatteringDataPrepare (Workspace &ws, ArrayOfTensor7 &pha_mat_sptDOITOpt, ArrayOfArrayOfSingleScatteringData &scat_data_mono, Tensor7 &pha_mat_doit, Vector &aa_grid, const Index &doit_za_grid_size, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const Index &f_index, const Index &atmosphere_dim, const Index &stokes_dim, const Tensor3 &t_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Agenda &pha_mat_spt_agenda, const Verbosity &verbosity)
 WORKSPACE METHOD: DoitScatteringDataPrepare. More...
 
void scat_dataCalc (ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfArrayOfSingleScatteringData &scat_data_raw, const Vector &f_grid, const Index &interp_order, const Verbosity &)
 WORKSPACE METHOD: scat_dataCalc. More...
 
void scat_dataReduceT (ArrayOfArrayOfSingleScatteringData &scat_data, const Index &i_ss, const Numeric &T, const Index &interp_order, const Index &phamat_only, const Numeric &threshold, const Verbosity &)
 WORKSPACE METHOD: scat_dataReduceT. More...
 
void scat_data_monoCalc (ArrayOfArrayOfSingleScatteringData &scat_data_mono, const ArrayOfArrayOfSingleScatteringData &scat_data, const Vector &f_grid, const Index &f_index, const Verbosity &)
 WORKSPACE METHOD: scat_data_monoCalc. More...
 
void scat_data_monoExtract (ArrayOfArrayOfSingleScatteringData &scat_data_mono, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &f_index, const Verbosity &)
 WORKSPACE METHOD: scat_data_monoExtract. More...
 
void opt_prop_sptFromMonoData (ArrayOfPropagationMatrix &ext_mat_spt, ArrayOfStokesVector &abs_vec_spt, const ArrayOfArrayOfSingleScatteringData &scat_data_mono, const Vector &za_grid, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: opt_prop_sptFromMonoData. More...
 
void pha_mat_sptFromMonoData (Tensor5 &pha_mat_spt, const ArrayOfArrayOfSingleScatteringData &scat_data_mono, const Index &doit_za_grid_size, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: pha_mat_sptFromMonoData. More...
 
void pha_mat_sptFromScat_data (Tensor5 &pha_mat_spt, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const Vector &za_grid, const Vector &aa_grid, const Index &za_index, const Index &aa_index, const Index &f_index, const Numeric &rtp_temperature, const Tensor4 &pnd_field, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &verbosity)
 WORKSPACE METHOD: pha_mat_sptFromScat_data. More...
 
void ScatSpeciesMerge (Tensor4 &pnd_field, ArrayOfArrayOfSingleScatteringData &scat_data, ArrayOfArrayOfScatteringMetaData &scat_meta, ArrayOfString &scat_species, Index &cloudbox_checked, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor3 &t_field, const Tensor3 &z_field, const Matrix &z_surface, const Verbosity &)
 WORKSPACE METHOD: ScatSpeciesMerge. More...
 
void ExtractFromMetaSingleScatSpecies (Vector &meta_param, const ArrayOfArrayOfScatteringMetaData &scat_meta, const String &meta_name, const Index &scat_species_index, const Verbosity &)
 WORKSPACE METHOD: ExtractFromMetaSingleScatSpecies. More...
 

Variables

const Numeric PI
 
const Numeric DEG2RAD
 
const Numeric RAD2DEG
 

Detailed Description

This filecontains workspace methods for calculating the optical properties for the radiative transfer.

Author
Sreerekha T.R. rekha.nosp@m.@uni.nosp@m.-brem.nosp@m.en.d.nosp@m.e, Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e Cory Davies cory@.nosp@m.met..nosp@m.ed.ac.nosp@m..uk
Date
Mon Jun 10 11:19:11 2002 Optical properties are the extinction matrix, absorption vector and scattering vector. The optical properties for the gases can be calculated with or without Zeeman effect.

Definition in file m_optproperties.cc.

Macro Definition Documentation

◆ AA_DATAGRID

◆ ABS_VEC_DATA

#define ABS_VEC_DATA   scat_data[i_ss][i_se].abs_vec_data

◆ EXT_MAT_DATA

#define EXT_MAT_DATA   scat_data[i_ss][i_se].ext_mat_data

◆ F_DATAGRID

#define F_DATAGRID   scat_data[i_ss][i_se].f_grid

◆ PART_TYPE

◆ PHA_MAT_DATA

#define PHA_MAT_DATA   scat_data[i_ss][i_se].pha_mat_data

◆ PND_LIMIT

◆ T_DATAGRID

◆ ZA_DATAGRID

Function Documentation

◆ abs_vecAddGas()

void abs_vecAddGas ( StokesVector abs_vec,
const ArrayOfPropagationMatrix propmat_clearsky,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_vecAddGas.

Add gas absorption to first element of absorption vector.

The task of this method is to sum up the gas absorption of the different gas species and add the result to the first element of the absorption vector.

Author
Stefan Buehler
Parameters
[in,out]abs_vecWS Input/Output
[in]propmat_clearskyWS Input

Definition at line 944 of file m_optproperties.cc.

References PropagationMatrix::NumberOfFrequencies(), pm, and PropagationMatrix::StokesDimensions().

Referenced by abs_vecAddGas_g().

◆ DoitScatteringDataPrepare()

void DoitScatteringDataPrepare ( Workspace ws,
ArrayOfTensor7 pha_mat_sptDOITOpt,
ArrayOfArrayOfSingleScatteringData scat_data_mono,
Tensor7 pha_mat_doit,
Vector aa_grid,
const Index doit_za_grid_size,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const Index f_index,
const Index atmosphere_dim,
const Index stokes_dim,
const Tensor3 t_field,
const ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const Agenda pha_mat_spt_agenda,
const Verbosity verbosity 
)

WORKSPACE METHOD: DoitScatteringDataPrepare.

Prepares single scattering data for a DOIT scattering calculation.

First the scattering data is interpolated in frequency using scat_data_monoCalc*. Then the phase matrix data is transformed or interpolated from the raw data to the laboratory frame for all possible combinations of the angles contained in the angular grids which are set in DOAngularGridsSet. The resulting phase matrices are stored in pha_mat_sptDOITOpt.

Author
Claudia Emde
Parameters
[in,out]wsWorkspace
[out]pha_mat_sptDOITOptWS Output
[out]scat_data_monoWS Output
[out]pha_mat_doitWS Output
[in,out]aa_gridWS Input/Output
[in]doit_za_grid_sizeWS Input
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]f_indexWS Input
[in]atmosphere_dimWS Input
[in]stokes_dimWS Input
[in]t_fieldWS Input
[in]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]pha_mat_spt_agendaWS Input

Definition at line 1345 of file m_optproperties.cc.

References joker, ConstTensor4View::nbooks(), Array< base >::nelem(), ConstVectorView::nelem(), nlinspace(), pha_mat_spt_agendaExecute(), pha_matCalc(), pha_matTransform(), Vector::resize(), Tensor7::resize(), scat_data_monoExtract(), and TotalNumberOfElements().

Referenced by DoitScatteringDataPrepare_g().

◆ ext_matAddGas()

void ext_matAddGas ( PropagationMatrix ext_mat,
const ArrayOfPropagationMatrix propmat_clearsky,
const Verbosity verbosity 
)

WORKSPACE METHOD: ext_matAddGas.

Add gas absorption to all diagonal elements of extinction matrix.

The task of this method is to sum up the gas absorption of the different gas species and add the result to the extinction matrix.

Author
Stefan Buehler
Parameters
[in,out]ext_matWS Input/Output
[in]propmat_clearskyWS Input

Definition at line 917 of file m_optproperties.cc.

References PropagationMatrix::NumberOfFrequencies(), pm, and PropagationMatrix::StokesDimensions().

Referenced by ext_matAddGas_g().

◆ ExtractFromMetaSingleScatSpecies()

void ExtractFromMetaSingleScatSpecies ( Vector meta_param,
const ArrayOfArrayOfScatteringMetaData scat_meta,
const String meta_name,
const Index scat_species_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: ExtractFromMetaSingleScatSpecies.

Extract (numeric) parameters from scat_meta of a single scattering species.

...

Author
Jana Mendrok
Parameters
[out]meta_paramGeneric output
[in]scat_metaWS Input
[in]meta_nameGeneric Input
[in]scat_species_indexGeneric Input

Definition at line 3090 of file m_optproperties.cc.

References i, Array< base >::nelem(), Vector::resize(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by ExtractFromMetaSingleScatSpecies_g().

◆ opt_prop_bulkCalc()

void opt_prop_bulkCalc ( PropagationMatrix ext_mat,
StokesVector abs_vec,
const ArrayOfPropagationMatrix ext_mat_spt,
const ArrayOfStokesVector abs_vec_spt,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: opt_prop_bulkCalc.

Calculates bulk absorption extinction at one atmospheric grid point.

This WSM sums up the monochromatic absorption vectors and extinction matrices of all scattering elements (abs_vec_spt and ext_mat_spt*, respectively) weighted by their respective particle number density given by pnd_field, for a single location within the cloudbox, given by scat_p_index, scat_lat_index, and scat_lon_index*. The resulting extinction matrix is added to the workspace variable ext_mat*.

Author
Jana Mendrok, Sreerekha T.R.
Parameters
[in,out]ext_matWS Input/Output
[in,out]abs_vecWS Input/Output
[in]ext_mat_sptWS Input
[in]abs_vec_sptWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 857 of file m_optproperties.cc.

References PropagationMatrix::MultiplyAndAdd(), StokesVector::MultiplyAndAdd(), Array< base >::nelem(), PropagationMatrix::SetZero(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by cloud_fieldsCalc(), and opt_prop_bulkCalc_g().

◆ opt_prop_sptFromData()

void opt_prop_sptFromData ( ArrayOfPropagationMatrix ext_mat_spt,
ArrayOfStokesVector abs_vec_spt,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Vector za_grid,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Index f_index,
const Vector f_grid,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: opt_prop_sptFromData.

Calculates monochromatic optical properties for all scattering elements.

In this function the extinction matrix and the absorption vector are calculated in the laboratory frame. An interpolation of the data on the actual frequency is the first step in this function. The next step is a transformation from the database coordinate system to the laboratory coordinate system.

Output of the function are ext_mat_spt and abs_vec_spt, which hold the optical properties for a specified propagation direction for each scattering element.

Author
Claudia Emde
Parameters
[in,out]ext_mat_sptWS Input/Output
[in,out]abs_vec_sptWS Input/Output
[in]scat_dataWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]f_indexWS Input
[in]f_gridWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 457 of file m_optproperties.cc.

References AA_DATAGRID, ABS_VEC_DATA, abs_vecTransform(), chk_interpolation_grids(), DEBUG_ONLY, EXT_MAT_DATA, ext_matTransform(), F_DATAGRID, gridpos(), i, interp(), interpweights(), joker, Array< base >::nelem(), ConstVectorView::nelem(), PART_TYPE, PND_LIMIT, Tensor3::resize(), Vector::resize(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, TotalNumberOfElements(), and ZA_DATAGRID.

Referenced by opt_prop_sptFromData_g().

◆ opt_prop_sptFromMonoData()

void opt_prop_sptFromMonoData ( ArrayOfPropagationMatrix ext_mat_spt,
ArrayOfStokesVector abs_vec_spt,
const ArrayOfArrayOfSingleScatteringData scat_data_mono,
const Vector za_grid,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: opt_prop_sptFromMonoData.

Calculates optical properties for the scattering elements.

As opt_prop_sptFromData but no frequency interpolation is performed. The single scattering data is here obtained from scat_data_mono*, instead of scat_data.

Author
Cory Davis
Parameters
[in,out]ext_mat_sptWS Input/Output
[in,out]abs_vec_sptWS Input/Output
[in]scat_data_monoWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 2262 of file m_optproperties.cc.

References abs_vecTransform(), chk_interpolation_grids(), DEBUG_ONLY, ext_matTransform(), gridpos(), interp(), interpweights(), joker, Array< base >::nelem(), ConstVectorView::nelem(), pm, PND_LIMIT, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and TotalNumberOfElements().

Referenced by opt_prop_sptFromMonoData_g().

◆ opt_prop_sptFromScat_data()

void opt_prop_sptFromScat_data ( ArrayOfPropagationMatrix ext_mat_spt,
ArrayOfStokesVector abs_vec_spt,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const Vector za_grid,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Index f_index,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: opt_prop_sptFromScat_data.

Derives monochromatic optical properties for all scattering elements.

As opt_prop_sptFromData, but using frequency pre-interpolated data (as produced by scat_dataCalc), i.e. in here no frequency interpolation is done anymore.

Author
Jana Mendrok, Claudia Emde
Parameters
[in,out]ext_mat_sptWS Input/Output
[in,out]abs_vec_sptWS Input/Output
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]f_indexWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 661 of file m_optproperties.cc.

References AA_DATAGRID, ABS_VEC_DATA, abs_vecTransform(), chk_interpolation_grids(), DEBUG_ONLY, EXT_MAT_DATA, ext_matTransform(), gridpos(), i, interp(), interpweights(), joker, Array< base >::nelem(), PART_TYPE, pm, PND_LIMIT, Tensor3::resize(), Vector::resize(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, TotalNumberOfElements(), and ZA_DATAGRID.

Referenced by opt_prop_sptFromScat_data_g().

◆ pha_mat_sptFromData()

void pha_mat_sptFromData ( Tensor5 pha_mat_spt,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Vector za_grid,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Index f_index,
const Vector f_grid,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: pha_mat_sptFromData.

Calculation of the phase matrix of the individual scattering elements.

This function can be used in pha_mat_spt_agenda as part of the calculation of the scattering integral.

First, data at the requested frequency (given by f_grid and f_index*) and temperature (given by rtp_temperature) is extracted. This is followed by a transformation from the database coordinate system to the laboratory coordinate system.

Frequency extraction is always done by (linear) interpolation. Temperature is (linearly) interpolated when at least two temperature grid points are present in the scat_data and rtp_temperature* is positive. If only a single temperature point is available, data for this point is used without modification. In order to speed up calculations, temperature interpolation can be avoided by passing a rtp_temperature<0. In this case, a specific temperature grid from the scat_data grid is used without modification. The selection is as follows: <br> -10 < rtp_temperature * < 0 T_grid[0] lowest temperature <br> -20 < *rtp_temperature * < -10 T_grid[nT-1] highest temperature <br> *rtp_temperature < -20 T_grid[nT/2] median grid point

Author
Claudia Emde
Parameters
[in,out]pha_mat_sptWS Input/Output
[in]scat_dataWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]f_indexWS Input
[in]f_gridWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 75 of file m_optproperties.cc.

References AA_DATAGRID, chk_interpolation_grids(), F_DATAGRID, gridpos(), i, interp(), interpweights(), joker, ConstTensor4View::nbooks(), ConstTensor5View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor5View::nshelves(), PART_TYPE, PHA_MAT_DATA, pha_matTransform(), PND_LIMIT, Tensor5::resize(), Vector::resize(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, TotalNumberOfElements(), and ZA_DATAGRID.

Referenced by pha_mat_sptFromData_g().

◆ pha_mat_sptFromDataDOITOpt()

void pha_mat_sptFromDataDOITOpt ( Tensor5 pha_mat_spt,
const ArrayOfTensor7 pha_mat_sptDOITOpt,
const ArrayOfArrayOfSingleScatteringData scat_data_mono,
const Index doit_za_grid_size,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: pha_mat_sptFromDataDOITOpt.

Calculation of the phase matrix of the individual scattering elements.

In this function the phase matrix is extracted from pha_mat_sptDOITOpt*. It can be used in the agenda pha_mat_spt_agenda*. This method must be used in combination with DoitScatteringDataPrepare*.

Temperature is considered as described for pha_mat_sptFromData

Author
Claudia Emde
Parameters
[in,out]pha_mat_sptWS Input/Output
[in]pha_mat_sptDOITOptWS Input
[in]scat_data_monoWS Input
[in]doit_za_grid_sizeWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 275 of file m_optproperties.cc.

References chk_interpolation_grids(), gridpos(), i, interp(), interpweights(), joker, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor5View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), nlinspace(), ConstTensor5View::nshelves(), PND_LIMIT, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and TotalNumberOfElements().

Referenced by pha_mat_sptFromDataDOITOpt_g().

◆ pha_mat_sptFromMonoData()

void pha_mat_sptFromMonoData ( Tensor5 pha_mat_spt,
const ArrayOfArrayOfSingleScatteringData scat_data_mono,
const Index doit_za_grid_size,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: pha_mat_sptFromMonoData.

Calculation of the phase matrix of the individual scattering elements.

This function is the monochromatic version of pha_mat_sptFromData.

Author
Claudia Emde
Parameters
[in,out]pha_mat_sptWS Input/Output
[in]scat_data_monoWS Input
[in]doit_za_grid_sizeWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 2432 of file m_optproperties.cc.

References chk_interpolation_grids(), gridpos(), gridpos_copy(), i, interp(), interpweights(), joker, ConstTensor4View::nbooks(), ConstTensor5View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), nlinspace(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), pha_matTransform(), PND_LIMIT, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and TotalNumberOfElements().

Referenced by pha_mat_sptFromMonoData_g().

◆ pha_mat_sptFromScat_data()

void pha_mat_sptFromScat_data ( Tensor5 pha_mat_spt,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const Vector za_grid,
const Vector aa_grid,
const Index za_index,
const Index aa_index,
const Index f_index,
const Numeric rtp_temperature,
const Tensor4 pnd_field,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: pha_mat_sptFromScat_data.

Calculation of the phase matrix of the individual scattering elements.

As pha_mat_sptFromData, but using frequency pre-interpolated data (as produced by scat_dataCalc), i.e. in here no frequency interpolation is done anymore.

Author
Jana Mendrok, Claudia Emde
Parameters
[in,out]pha_mat_sptWS Input/Output
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_indexWS Input
[in]aa_indexWS Input
[in]f_indexWS Input
[in]rtp_temperatureWS Input
[in]pnd_fieldWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 2596 of file m_optproperties.cc.

References AA_DATAGRID, abs, chk_interpolation_grids(), gridpos(), i, interp(), interpweights(), joker, ConstTensor4View::nbooks(), ConstTensor5View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor5View::nshelves(), PART_TYPE, PHA_MAT_DATA, pha_matTransform(), PND_LIMIT, Tensor5::resize(), Vector::resize(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, TotalNumberOfElements(), and ZA_DATAGRID.

Referenced by pha_mat_sptFromScat_data_g().

◆ pha_matCalc()

void pha_matCalc ( Tensor4 pha_mat,
const Tensor5 pha_mat_spt,
const Tensor4 pnd_field,
const Index atmosphere_dim,
const Index scat_p_index,
const Index scat_lat_index,
const Index scat_lon_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: pha_matCalc.

Calculates the total phase matrix of all scattering elements.

This function sums up the monochromatic phase matrices of all scattering elements pha_mat_spt weighted with their respective particle number density, given by pnd_field, for a single location within the cloudbox, given by scat_p_index, scat_lat_index, and scat_lon_index*.

Author
Sreerekha T.R.
Parameters
[out]pha_matWS Output
[in]pha_mat_sptWS Input
[in]pnd_fieldWS Input
[in]atmosphere_dimWS Input
[in]scat_p_indexWS Input
[in]scat_lat_indexWS Input
[in]scat_lon_indexWS Input

Definition at line 1015 of file m_optproperties.cc.

References DEG2RAD, ConstTensor5View::nbooks(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), and Tensor4::resize().

Referenced by doit_scat_fieldCalc(), doit_scat_fieldCalcLimb(), DoitScatteringDataPrepare(), and pha_matCalc_g().

◆ scat_data_monoCalc()

void scat_data_monoCalc ( ArrayOfArrayOfSingleScatteringData scat_data_mono,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Vector f_grid,
const Index f_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_data_monoCalc.

Interpolates scat_data by frequency to give scat_data_mono.

Author
Cory Davis
Parameters
[out]scat_data_monoWS Output
[in]scat_dataWS Input
[in]f_gridWS Input
[in]f_indexWS Input

Definition at line 2065 of file m_optproperties.cc.

Referenced by scat_data_monoCalc_g().

◆ scat_data_monoExtract()

void scat_data_monoExtract ( ArrayOfArrayOfSingleScatteringData scat_data_mono,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index f_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_data_monoExtract.

Extracts data at f_index from scat_data to give scat_data_mono.

Author
Jana Mendrok
Parameters
[out]scat_data_monoWS Output
[in]scat_dataWS Input
[in]f_indexWS Input

Definition at line 2196 of file m_optproperties.cc.

References AA_DATAGRID, ABS_VEC_DATA, EXT_MAT_DATA, F_DATAGRID, joker, Array< base >::nelem(), PART_TYPE, PHA_MAT_DATA, T_DATAGRID, and ZA_DATAGRID.

Referenced by DoitScatteringDataPrepare(), and scat_data_monoExtract_g().

◆ scat_dataCalc()

void scat_dataCalc ( ArrayOfArrayOfSingleScatteringData scat_data,
const ArrayOfArrayOfSingleScatteringData scat_data_raw,
const Vector f_grid,
const Index interp_order,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_dataCalc.

Prepares scat_data for the scattering solver.

Derives single scattering data for the frequencies given by f_grid* by interpolation from scat_data_raw. f_grid should be the actual WSV f_grid or a single-element Vector.

Author
Jana Mendrok
Parameters
[out]scat_dataWS Output
[in]scat_data_rawWS Input
[in]f_gridWS Input
[in]interp_orderGeneric Input (Default: "1")

Definition at line 1529 of file m_optproperties.cc.

References AA_DATAGRID, ABS_VEC_DATA, chk_interpolation_grids(), EXT_MAT_DATA, F_DATAGRID, gridpos_poly(), i, interp(), interpweights(), is_same_within_epsilon(), joker, Array< base >::nelem(), ConstVectorView::nelem(), PART_TYPE, PHA_MAT_DATA, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, and ZA_DATAGRID.

Referenced by scat_dataCalc_g().

◆ scat_dataCheck()

void scat_dataCheck ( const ArrayOfArrayOfSingleScatteringData scat_data,
const String check_type,
const Numeric sca_mat_threshold,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_dataCheck.

Method for checking the validity and consistency of the single scattering properties in scat_data.

It checks that scat_data does not contain any invalid values, that is any NaN elements in K, Z, or a or any negative values in the 'scalar' properties K11, Z11, and a1.

When check_type is 'all', it is furthermore checked that the scattering matrix is properly normalized, that is that the solid sphere integrated scattering matrix (int_Z11), which is supposed to be normalized to the scattering cross section, is sufficiently consistent with the scattering cross section (C_sca) derived from the difference of extinction (K11) and absorption (a1): int_z11 ~ C_sca = K11-a1. Sufficient consistency is defined by the maximum allowed deviation in single scattering albedo, sca_mat_threshold, testing for <br> ( <int_Z11>/<C_sca>-1. ) * ( <C_sca>/<K11> ) <= sca_mat_threshold. The check is skipped if check_type is 'sane'.

Author
Claudia Emde
Jana Mendrok
Parameters
[in]scat_dataWS Input
[in]check_typeGeneric Input (Default: "all")
[in]sca_mat_thresholdGeneric Input (Default: "5e-2")

Definition at line 1094 of file m_optproperties.cc.

References AA_DATAGRID, abs, ABS_VEC_DATA, AngIntegrate_trapezoid(), CREATE_OUT0, CREATE_OUT1, CREATE_OUT2, EXT_MAT_DATA, F_DATAGRID, joker, Array< base >::nelem(), PART_TYPE, PHA_MAT_DATA, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, my_basic_string< charT >::toupper(), and ZA_DATAGRID.

Referenced by scat_dataCheck_g(), and ScatElementsToabs_speciesAdd().

◆ scat_dataReduceT()

void scat_dataReduceT ( ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_index,
const Numeric temperature,
const Index interp_order,
const Index phamat_only,
const Numeric sca_mat_threshold,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_dataReduceT.

Reduces temperature dimension of single scattering to a single entry.

FIXME... Derives single scattering data for the frequencies given by f_grid* by interpolation from scat_data. f_grid should be the actual WSV f_grid or a single-element Vector.

Author
Jana Mendrok
Parameters
[in,out]scat_dataWS Input/Output
[in]scat_indexGeneric Input
[in]temperatureGeneric Input
[in]interp_orderGeneric Input (Default: "1")
[in]phamat_onlyGeneric Input (Default: "1")
[in]sca_mat_thresholdGeneric Input (Default: "5e-2")

Definition at line 1728 of file m_optproperties.cc.

References AA_DATAGRID, abs, ABS_VEC_DATA, AngIntegrate_trapezoid(), chk_interpolation_grids(), EXT_MAT_DATA, F_DATAGRID, gridpos_poly(), interp(), interpweights(), joker, Array< base >::nelem(), PART_TYPE, PHA_MAT_DATA, PTYPE_AZIMUTH_RND, PTYPE_TOTAL_RND, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), T_DATAGRID, and ZA_DATAGRID.

Referenced by scat_dataReduceT_g().

◆ ScatSpeciesMerge()

void ScatSpeciesMerge ( Tensor4 pnd_field,
ArrayOfArrayOfSingleScatteringData scat_data,
ArrayOfArrayOfScatteringMetaData scat_meta,
ArrayOfString scat_species,
Index cloudbox_checked,
const Index atmosphere_dim,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Tensor3 t_field,
const Tensor3 z_field,
const Matrix z_surface,
const Verbosity verbosity 
)

WORKSPACE METHOD: ScatSpeciesMerge.

Merges single scattering data of all scattering elements into one element of bulk properties.

Before entering the scattering solver, this method prepares the effective bulk single scattering properties of all scattering elements. Done by calculating the particle number density weighted sum of the single scattering properties of all scattering elements per pressure level. Accordingly, pnd_field is resized to [np, np, 1, 1], where np is the number of pressure levels inside the cloudbox. The diagonal elements of the new pnd_field are set to 1, all others to 0. scat_data is resized to np. Each new scattering element represents the weighted sum of all particles at one presssure level.

The method also adapts scat_species and scat_meta such that they remain consistent with pnd_field and can pass cloudbox_checkedCalc*.

The method is suggested to be called directly after pnd_fieldCalcFromParticleBulkProps* (but also after cloudbox_checkedCalc*). Its purpose is to speed up the scattering calculations.

This is an experimental method currently only working for limited cases. All scattering elements must be of the same ptype and must share the same f_grid, za_grid, and aa_grid. That is, the scattering matrix, extinction matrix, and absorption vector of all scattering elements must have the same dimensions. No interpolation (apart from temperature) is performed.

This method can only be used with a 1D atmosphere.

Author
Oliver Lemke
Parameters
[in,out]pnd_fieldWS Input/Output
[in,out]scat_dataWS Input/Output
[in,out]scat_metaWS Input/Output
[in,out]scat_speciesWS Input/Output
[in,out]cloudbox_checkedWS Input/Output
[in]atmosphere_dimWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]z_surfaceWS Input

Definition at line 2781 of file m_optproperties.cc.

References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, chk_interpolation_grids(), SingleScatteringData::description, ScatteringMetaData::description, ScatteringMetaData::diameter_area_equ_aerodynamical, ScatteringMetaData::diameter_max, ScatteringMetaData::diameter_volume_equ, SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, FlattenedIndex(), gridpos(), i, interp(), interpweights(), is_size(), joker, ScatteringMetaData::mass, ConstTensor4View::nbooks(), ConstTensor7View::nbooks(), ConstTensor5View::ncols(), ConstTensor7View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor5View::npages(), ConstTensor7View::npages(), ConstTensor5View::nrows(), ConstTensor7View::nrows(), ConstTensor5View::nshelves(), ConstTensor7View::nshelves(), SingleScatteringData::pha_mat_data, PND_LIMIT, SingleScatteringData::ptype, ScatteringMetaData::refr_index, Tensor4::resize(), Tensor5::resize(), Vector::resize(), Tensor7::resize(), ScatteringMetaData::source, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.

Referenced by ScatSpeciesMerge_g().

Variable Documentation

◆ DEG2RAD

const Numeric DEG2RAD

Referenced by pha_matCalc().

◆ PI

const Numeric PI

◆ RAD2DEG

const Numeric RAD2DEG