ARTS
2.4.0(git:4fb77825)
|
Methods related to absorption, lookup table, etc. More...
#include <algorithm>
#include <limits>
#include <map>
#include "absorption.h"
#include "agenda_class.h"
#include "arts.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "check_input.h"
#include "cloudbox.h"
#include "gas_abs_lookup.h"
#include "global_data.h"
#include "interpolation_poly.h"
#include "math_funcs.h"
#include "matpackV.h"
#include "messages.h"
#include "physics_funcs.h"
#include "rng.h"
Go to the source code of this file.
Functions | |
void | abs_lookupInit (GasAbsLookup &x, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupInit. More... | |
void | abs_lookupCalc (Workspace &ws, GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfSpeciesTag &abs_nls, const Vector &f_grid, const Vector &abs_p, const Matrix &abs_vmrs, const Vector &abs_t, const Vector &abs_t_pert, const Vector &abs_nls_pert, const Agenda &abs_xsec_agenda, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupCalc. More... | |
void | find_nonlinear_continua (ArrayOfIndex &cont, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &verbosity) |
Find continuum species in abs_species. More... | |
void | choose_abs_nls (ArrayOfArrayOfSpeciesTag &abs_nls, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &verbosity) |
Choose species for abs_nls. More... | |
void | choose_abs_t_pert (Vector &abs_t_pert, ConstVectorView abs_t, ConstVectorView tmin, ConstVectorView tmax, const Numeric &step, const Index &p_interp_order, const Index &t_interp_order, const Verbosity &verbosity) |
Chose the temperature perturbations abs_t_pert. More... | |
void | choose_abs_nls_pert (Vector &abs_nls_pert, ConstVectorView refprof, ConstVectorView minprof, ConstVectorView maxprof, const Numeric &step, const Index &p_interp_order, const Index &nls_interp_order, const Verbosity &verbosity) |
Chose the H2O perturbations abs_nls_pert. More... | |
void | abs_lookupSetup (Vector &abs_p, Vector &abs_t, Vector &abs_t_pert, Matrix &abs_vmrs, ArrayOfArrayOfSpeciesTag &abs_nls, Vector &abs_nls_pert, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const Index &atmfields_checked, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Numeric &p_step10, const Numeric &t_step, const Numeric &h2o_step, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupSetup. More... | |
void | abs_lookupSetupBatch (Vector &abs_p, Vector &abs_t, Vector &abs_t_pert, Matrix &abs_vmrs, ArrayOfArrayOfSpeciesTag &abs_nls, Vector &abs_nls_pert, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfGriddedField4 &batch_fields, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Index &atmosphere_dim, const Numeric &p_step10, const Numeric &t_step, const Numeric &h2o_step, const Vector &extremes, const Index &robust, const Index &check_gridnames, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupSetupBatch. More... | |
void | abs_lookupSetupWide (Vector &abs_p, Vector &abs_t, Vector &abs_t_pert, Matrix &abs_vmrs, ArrayOfArrayOfSpeciesTag &abs_nls, Vector &abs_nls_pert, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Numeric &p_min, const Numeric &p_max, const Numeric &p_step10, const Numeric &t_min, const Numeric &t_max, const Numeric &h2o_min, const Numeric &h2o_max, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupSetupWide. More... | |
void | abs_speciesAdd (ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_speciesAdd. More... | |
void | abs_speciesAdd2 (Workspace &ws, ArrayOfArrayOfSpeciesTag &abs_species, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &species, const String &mode, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_speciesAdd2. More... | |
void | abs_speciesInit (ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &) |
WORKSPACE METHOD: abs_speciesInit. More... | |
void | abs_speciesSet (ArrayOfArrayOfSpeciesTag &abs_species, Index &abs_xsec_agenda_checked, Index &propmat_clearsky_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_speciesSet. More... | |
void | abs_lookupAdapt (GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const Vector &f_grid, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupAdapt. More... | |
void | propmat_clearskyAddFromLookup (ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const GasAbsLookup &abs_lookup, const Index &abs_lookup_is_adapted, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Index &abs_f_interp_order, const Vector &f_grid, const Numeric &a_pressure, const Numeric &a_temperature, const Vector &a_vmr_list, const ArrayOfRetrievalQuantity &jacobian_quantities, const Numeric &extpolfac, const Verbosity &verbosity) |
WORKSPACE METHOD: propmat_clearskyAddFromLookup. More... | |
void | propmat_clearsky_fieldCalc (Workspace &ws, Tensor7 &propmat_clearsky_field, Tensor6 &nlte_source_field, const Index &atmfields_checked, const Vector &f_grid, const Index &stokes_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const EnergyLevelMap &nlte_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Agenda &abs_agenda, const Vector &doppler, const Vector &los, const Verbosity &verbosity) |
WORKSPACE METHOD: propmat_clearsky_fieldCalc. More... | |
void | f_gridFromGasAbsLookup (Vector &f_grid, const GasAbsLookup &abs_lookup, const Verbosity &) |
WORKSPACE METHOD: f_gridFromGasAbsLookup. More... | |
void | p_gridFromGasAbsLookup (Vector &p_grid, const GasAbsLookup &abs_lookup, const Verbosity &) |
WORKSPACE METHOD: p_gridFromGasAbsLookup. More... | |
Numeric | calc_lookup_error (Workspace &ws, const GasAbsLookup &al, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const bool ignore_errors, const Agenda &abs_xsec_agenda, const Numeric &local_p, const Numeric &local_t, const Vector &local_vmrs, const Verbosity &verbosity) |
Compare lookup and LBL calculation. More... | |
void | abs_lookupTestAccuracy (Workspace &ws, const GasAbsLookup &abs_lookup, const Index &abs_lookup_is_adapted, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Agenda &abs_xsec_agenda, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupTestAccuracy. More... | |
void | abs_lookupTestAccMC (Workspace &ws, const GasAbsLookup &abs_lookup, const Index &abs_lookup_is_adapted, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Index &mc_seed, const Agenda &abs_xsec_agenda, const Verbosity &verbosity) |
WORKSPACE METHOD: abs_lookupTestAccMC. More... | |
Variables | |
const Index | GFIELD4_FIELD_NAMES |
const Index | GFIELD4_P_GRID |
Methods related to absorption, lookup table, etc.
Definition in file m_abs_lookup.cc.
void abs_lookupAdapt | ( | GasAbsLookup & | abs_lookup, |
Index & | abs_lookup_is_adapted, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Vector & | f_grid, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupAdapt.
Adapts a gas absorption lookup table to the current calculation.
The lookup table can contain more species and more frequencies than are needed for the current calculation. This method cuts down the table in memory, so that it contains just what is needed. Also, the species in the table are brought in the same order as the species in the current calculation.
Of course, the method also performs quite a lot of checks on the table. If something is not ok, a runtime error is thrown.
The method sets a flag abs_lookup_is_adapted to indicate that the table has been checked and that it is ok. Never set this by hand, always use this method to set it!
[in,out] | abs_lookup | WS Input/Output |
[out] | abs_lookup_is_adapted | WS Output |
[in] | abs_species | WS Input |
[in] | f_grid | WS Input |
Definition at line 2012 of file m_abs_lookup.cc.
References ARTS::Var::abs_lookup(), ARTS::Var::abs_lookup_is_adapted(), ARTS::Var::abs_species(), ARTS::Var::f_grid(), and ARTS::Var::verbosity().
Referenced by abs_lookupAdapt_g().
void abs_lookupCalc | ( | Workspace & | ws, |
GasAbsLookup & | abs_lookup, | ||
Index & | abs_lookup_is_adapted, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const ArrayOfArrayOfSpeciesTag & | abs_nls, | ||
const Vector & | f_grid, | ||
const Vector & | abs_p, | ||
const Matrix & | abs_vmrs, | ||
const Vector & | abs_t, | ||
const Vector & | abs_t_pert, | ||
const Vector & | abs_nls_pert, | ||
const Agenda & | abs_xsec_agenda, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupCalc.
Creates a gas absorption lookup table.
The lookup table stores absorption cross-sections as a function of pressure. Additionally, absorption can be stored as a function of temperature for temperature perturbations from a reference profile.
Additionally, absorption can be stored as a function of water vapor VMR perturbations from a reference profile. The variable abs_nls specifies, for which species water vapor perturbations should be generated.
Note, that the absorbing gas can be any gas, but the perturbing gas is always H2O.
[in,out] | ws | Workspace |
[out] | abs_lookup | WS Output |
[out] | abs_lookup_is_adapted | WS Output |
[in] | abs_species | WS Input |
[in] | abs_nls | WS Input |
[in] | f_grid | WS Input |
[in] | abs_p | WS Input |
[in] | abs_vmrs | WS Input |
[in] | abs_t | WS Input |
[in] | abs_t_pert | WS Input |
[in] | abs_nls_pert | WS Input |
[in] | abs_xsec_agenda | WS Input |
Definition at line 60 of file m_abs_lookup.cc.
References ARTS::Var::abs_vmrs(), CREATE_OUT2, and CREATE_OUT3.
Referenced by abs_lookupCalc_g().
void abs_lookupInit | ( | GasAbsLookup & | abs_lookup, |
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupInit.
Creates an empty gas absorption lookup table.
This is mainly there to help developers. For example, you can write the empty table to an XML file, to see the file format.
[out] | abs_lookup | WS Output |
Definition at line 50 of file m_abs_lookup.cc.
References ARTS::Var::verbosity(), and ARTS::Var::x().
Referenced by abs_lookupInit_g().
void abs_lookupSetup | ( | Vector & | abs_p, |
Vector & | abs_t, | ||
Vector & | abs_t_pert, | ||
Matrix & | abs_vmrs, | ||
ArrayOfArrayOfSpeciesTag & | abs_nls, | ||
Vector & | abs_nls_pert, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const Index & | atmfields_checked, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Numeric & | p_step, | ||
const Numeric & | t_step, | ||
const Numeric & | h2o_step, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupSetup.
Set up input parameters for abs_lookupCalc.
More information can be found in the documentation for method abs_lookupSetupBatch*
Max and min values of H2O and temperature are adjusted to allow for numerical perturbations in Jacobian calculation.
The input variables abs_nls_interp_order and abs_t_interp_order are used to make sure that there are enough points in abs_nls_pert and abs_t_pert for the chosen interpolation order.
Note: For homogeneous 1D cases, it can be advantageous to calculate abs_lookup* from the 1D atmosphere, and to expand the atmosphere to 3D only after that. This particularly if nonlinear species (i.e., H2O) are involved. See also: <br> abs_lookupSetupBatch
[out] | abs_p | WS Output |
[out] | abs_t | WS Output |
[out] | abs_t_pert | WS Output |
[out] | abs_vmrs | WS Output |
[out] | abs_nls | WS Output |
[out] | abs_nls_pert | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | atmfields_checked | WS Input |
[in] | abs_species | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | p_step | Generic Input (Default: "0.05") |
[in] | t_step | Generic Input (Default: "100") |
[in] | h2o_step | Generic Input (Default: "100") |
Definition at line 796 of file m_abs_lookup.cc.
References ARTS::Var::abs_nls(), ARTS::Var::abs_nls_interp_order(), ARTS::Var::abs_nls_pert(), ARTS::Var::abs_p(), ARTS::Var::abs_p_interp_order(), ARTS::Var::abs_species(), ARTS::Var::abs_t(), ARTS::Var::abs_t_interp_order(), ARTS::Var::abs_t_pert(), ARTS::Var::abs_vmrs(), ARTS::Var::atmfields_checked(), ARTS::Var::atmosphere_dim(), choose_abs_nls(), choose_abs_nls_pert(), choose_abs_t_pert(), find_first_species_tg(), gridpos(), interp(), interpweights(), joker, max, mean(), min, Array< base >::nelem(), ConstVectorView::nelem(), ARTS::Var::p_grid(), pow(), species_index_from_species_name(), ARTS::Var::t_field(), transform(), ARTS::Var::verbosity(), and ARTS::Var::vmr_field().
Referenced by abs_lookupSetup_g().
void abs_lookupSetupBatch | ( | Vector & | abs_p, |
Vector & | abs_t, | ||
Vector & | abs_t_pert, | ||
Matrix & | abs_vmrs, | ||
ArrayOfArrayOfSpeciesTag & | abs_nls, | ||
Vector & | abs_nls_pert, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const ArrayOfGriddedField4 & | batch_atm_fields_compact, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Index & | atmosphere_dim, | ||
const Numeric & | p_step, | ||
const Numeric & | t_step, | ||
const Numeric & | h2o_step, | ||
const Vector & | extremes, | ||
const Index & | robust, | ||
const Index & | check_gridnames, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupSetupBatch.
Set up input parameters for abs_lookupCalc for batch calculations.
This method performs a similar task as abs_lookupSetup, with the difference that the lookup table setup is not for a single atmospheric state, but for a whole batch of them, stored in batch_atm_fields_compact*.
The method checks abs_species to decide which species require nonlinear treatment in the lookup table.
The method also checks which range of pressures, temperatures, and VMRs occurs, and sets abs_p, abs_t, abs_t_pert, and abs_vmrs accordingly.
If nonlinear species are present, abs_nls and abs_nls_pert are also generated.
Max and min values of H2O and temperature are adjusted to allow for numerical perturbations in Jacobian calculation.
The input variables abs_nls_interp_order and abs_t_interp_order are used to make sure that there are enough points in abs_nls_pert and abs_t_pert for the chosen interpolation order.
The method checks each given field using atmfields_checkedCalc. If a field does not pass the check, a run-time error is thrown. To prevent this, the parameter robust can be set to one: Invalid atmospheres are skipped, but the run continues. This matches the robust behaviour of ybatchCalc.
See also: <br> abs_lookupSetup
[out] | abs_p | WS Output |
[out] | abs_t | WS Output |
[out] | abs_t_pert | WS Output |
[out] | abs_vmrs | WS Output |
[out] | abs_nls | WS Output |
[out] | abs_nls_pert | WS Output |
[in] | abs_species | WS Input |
[in] | batch_atm_fields_compact | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_step | Generic Input (Default: "0.05") |
[in] | t_step | Generic Input (Default: "20") |
[in] | h2o_step | Generic Input (Default: "100") |
[in] | extremes | Generic Input (Default: "[]") |
[in] | robust | Generic Input (Default: "0") |
[in] | check_gridnames | Generic Input (Default: "0") |
Definition at line 1064 of file m_abs_lookup.cc.
References ARTS::Var::abs_f_interp_order(), ARTS::Var::abs_nls(), ARTS::Var::abs_species(), ARTS::Var::atm_fields_compact(), ARTS::Var::atmfields_checked(), atmfields_checkedCalc(), AtmFieldsAndParticleBulkPropFieldFromCompact(), ARTS::Var::atmosphere_dim(), choose_abs_nls(), CREATE_OUT1, CREATE_OUT2, CREATE_OUT3, find_first_species_tg(), get_species_name(), GFIELD4_P_GRID, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), Array< base >::nelem(), ARTS::Var::p_grid(), parse_atmcompact_speciesname(), parse_atmcompact_speciestype(), ARTS::Var::particle_bulkprop_field(), ARTS::Var::particle_bulkprop_names(), ARTS::Var::partition_functions(), pow(), species_index_from_species_name(), ARTS::Var::t_field(), ARTS::Var::verbosity(), ARTS::Var::vmr_field(), and ARTS::Var::z_field().
Referenced by abs_lookupSetupBatch_g().
void abs_lookupSetupWide | ( | Vector & | abs_p, |
Vector & | abs_t, | ||
Vector & | abs_t_pert, | ||
Matrix & | abs_vmrs, | ||
ArrayOfArrayOfSpeciesTag & | abs_nls, | ||
Vector & | abs_nls_pert, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Numeric & | p_min, | ||
const Numeric & | p_max, | ||
const Numeric & | p_step, | ||
const Numeric & | t_min, | ||
const Numeric & | t_max, | ||
const Numeric & | h2o_min, | ||
const Numeric & | h2o_max, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupSetupWide.
Set up input parameters for abs_lookupCalc for a wide range of atmospheric conditions.
This method can be used to set up parameters for a lookup table that really covers all reasonable atmospheric conditions.
Reference profiles of T and H2O will be constant, so that the different dimensions in the lookup table are actually "orthogonal", unlike the traditional case where we have pressure dependent reference profiles. This makes the table numerically somewhat more robust then the traditional ones, and it makes it straightforward to calculate the accuracy for the different interpolations with abs_lookupTestAccuracy.
You can give min an max values for the atmospheric conditions. The default values are chosen such that they cover the value range over the complete Chevallier91L data set, and a bit more. The statistics of the Chevallier91L data are:
min(p) / max(p) [Pa]: 1 / 104960 min(T) / max(T) [K]: 158.21 / 320.39 min(H2O) / max(H2O) [VMR]: -5.52e-07 / 0.049
[out] | abs_p | WS Output |
[out] | abs_t | WS Output |
[out] | abs_t_pert | WS Output |
[out] | abs_vmrs | WS Output |
[out] | abs_nls | WS Output |
[out] | abs_nls_pert | WS Output |
[in] | abs_species | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | p_min | Generic Input (Default: "0.5") |
[in] | p_max | Generic Input (Default: "110000") |
[in] | p_step | Generic Input (Default: "0.05") |
[in] | t_min | Generic Input (Default: "100") |
[in] | t_max | Generic Input (Default: "400") |
[in] | h2o_min | Generic Input (Default: "0") |
[in] | h2o_max | Generic Input (Default: "0.05") |
Definition at line 1717 of file m_abs_lookup.cc.
References ARTS::Var::abs_nls(), ARTS::Var::abs_p(), ARTS::Var::abs_p_interp_order(), ARTS::Var::abs_species(), ARTS::Var::abs_t(), ARTS::Var::abs_t_interp_order(), ARTS::Var::abs_t_pert(), choose_abs_nls(), choose_abs_t_pert(), CREATE_OUT2, pow(), transform(), and ARTS::Var::verbosity().
Referenced by abs_lookupSetupWide_g().
void abs_lookupTestAccMC | ( | Workspace & | ws, |
const GasAbsLookup & | abs_lookup, | ||
const Index & | abs_lookup_is_adapted, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Index & | mc_seed, | ||
const Agenda & | abs_xsec_agenda, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupTestAccMC.
Test accuracy of absorption lookup table with Monte Carlo Algorithm.
Explicitly compare absorption from the lookup table with line-by-line calculations for random conditions.
The quantities returned are the mean value and standard deviation of the absolute value of the relative error in percent. The relative error itself is computed for a large number of cases (pressure, temperature, and H2O VMR combinations). In the frequency dimension the maximum value is taken for each case.
Produces no workspace output, only output to the output streams.
[in,out] | ws | Workspace |
[in] | abs_lookup | WS Input |
[in] | abs_lookup_is_adapted | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | mc_seed | WS Input |
[in] | abs_xsec_agenda | WS Input |
Definition at line 2880 of file m_abs_lookup.cc.
References abs, ARTS::Var::abs_lookup(), ARTS::Var::abs_lookup_is_adapted(), ARTS::Var::abs_nls_interp_order(), ARTS::Var::abs_p_interp_order(), ARTS::Var::abs_t_interp_order(), ARTS::Var::abs_xsec_agenda(), calc_lookup_error(), CREATE_OUT2, CREATE_OUT3, Rng::draw(), find_first_species_tg(), gridpos_poly(), interp(), interpweights(), joker, GasAbsLookup::log_p_grid, ARTS::Var::mc_seed(), mean(), N, Array< base >::nelem(), ConstVectorView::nelem(), GasAbsLookup::nls_pert, GasAbsLookup::nonlinear_species, Vector::resize(), Rng::seed(), GasAbsLookup::species, species_index_from_species_name(), sqrt(), GasAbsLookup::t_pert, GasAbsLookup::t_ref, ARTS::Var::verbosity(), GasAbsLookup::vmrs_ref, and ARTS::Var::x().
Referenced by abs_lookupTestAccMC_g().
void abs_lookupTestAccuracy | ( | Workspace & | ws, |
const GasAbsLookup & | abs_lookup, | ||
const Index & | abs_lookup_is_adapted, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Agenda & | abs_xsec_agenda, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_lookupTestAccuracy.
Test accuracy of absorption lookup table.
Explicitly compare absorption from the lookup table with line-by-line calculations for strategically selected conditions (in-between the lookup table grid points).
For error units see abs_lookupTestAccMC
Produces no workspace output, only output to the output streams.
[in,out] | ws | Workspace |
[in] | abs_lookup | WS Input |
[in] | abs_lookup_is_adapted | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | abs_xsec_agenda | WS Input |
Definition at line 2567 of file m_abs_lookup.cc.
References ARTS::Var::abs_lookup(), ARTS::Var::abs_lookup_is_adapted(), CREATE_OUT2, find_first_species_tg(), GasAbsLookup::log_p_grid, Array< base >::nelem(), ConstVectorView::nelem(), GasAbsLookup::nonlinear_species, GasAbsLookup::species, species_index_from_species_name(), and GasAbsLookup::t_pert.
Referenced by abs_lookupTestAccuracy_g().
void abs_speciesAdd | ( | ArrayOfArrayOfSpeciesTag & | abs_species, |
Index & | propmat_clearsky_agenda_checked, | ||
Index & | abs_xsec_agenda_checked, | ||
const ArrayOfString & | species, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_speciesAdd.
Adds species tag groups to the list of absorption species.
This WSM is similar to abs_speciesSet, the only difference is that this method appends species to an existing list of absorption species instead of creating the whole list.
See abs_speciesSet for details on how tags are defined and examples of how to input them in the control file.
[in,out] | abs_species | WS Input/Output |
[out] | propmat_clearsky_agenda_checked | WS Output |
[out] | abs_xsec_agenda_checked | WS Output |
[in] | species | Generic Input |
Definition at line 1870 of file m_abs_lookup.cc.
References ARTS::Var::abs_species(), ARTS::Var::abs_xsec_agenda_checked(), array_species_tag_from_string(), check_abs_species(), CREATE_OUT3, Array< base >::nelem(), ARTS::Var::propmat_clearsky_agenda_checked(), and temp.
Referenced by abs_speciesAdd_g(), and ScatElementsToabs_speciesAdd().
void abs_speciesAdd2 | ( | Workspace & | ws, |
ArrayOfArrayOfSpeciesTag & | abs_species, | ||
ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
Agenda & | jacobian_agenda, | ||
Index & | propmat_clearsky_agenda_checked, | ||
Index & | abs_xsec_agenda_checked, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Vector & | gin1, | ||
const Vector & | gin2, | ||
const Vector & | gin3, | ||
const String & | species, | ||
const String & | unit, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_speciesAdd2.
Adds a species tag group to the list of absorption species and jacobian quantities.
The method is basically a combined call of abs_speciesAdd and jacobianAddAbsSpecies*. In this way it is not needed to specify a tag group in two different places.
Arguments exactly as for jacobianAddAbsSpecies. Note that this method only handles a single tag group, in contrast to abs_speciesAdd*.
[in,out] | ws | Workspace |
[in,out] | abs_species | WS Input/Output |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[out] | propmat_clearsky_agenda_checked | WS Output |
[out] | abs_xsec_agenda_checked | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | gin1 | Generic Input |
[in] | gin2 | Generic Input |
[in] | gin3 | Generic Input |
[in] | species | Generic Input |
[in] | unit | Generic Input (Default: "vmr") |
Definition at line 1910 of file m_abs_lookup.cc.
References ARTS::Var::abs_species(), ARTS::Var::abs_xsec_agenda_checked(), array_species_tag_from_string(), ARTS::Var::atmosphere_dim(), check_abs_species(), CREATE_OUT3, ARTS::Var::jacobian_agenda(), jacobianAddAbsSpecies(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), Array< base >::nelem(), ARTS::Var::p_grid(), ARTS::Var::propmat_clearsky_agenda_checked(), and ARTS::Var::verbosity().
Referenced by abs_speciesAdd2_g().
void abs_speciesInit | ( | ArrayOfArrayOfSpeciesTag & | abs_species, |
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_speciesInit.
Sets abs_species to be empty.
[out] | abs_species | WS Output |
Definition at line 1969 of file m_abs_lookup.cc.
References ARTS::Var::abs_species().
Referenced by abs_speciesInit_g().
void abs_speciesSet | ( | ArrayOfArrayOfSpeciesTag & | abs_species, |
Index & | abs_xsec_agenda_checked, | ||
Index & | propmat_clearsky_agenda_checked, | ||
const ArrayOfString & | species, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: abs_speciesSet.
Set up a list of absorption species tag groups.
Workspace variables like abs_species contain several tag groups. Each tag group contains one or more tags. This method converts descriptions of tag groups given in the keyword to the ARTS internal representation (an ArrayOfArrayOfSpeciesTag). A tag group selects spectral features which belong to the same species.
A tag is defined in terms of the name of the species, isotopologue, and a range of frequencies. Species are named after the standard chemical names, e.g., "O3". Isotopologues are given by the last digit of the atomic weight, i.g., "O3-668" for the asymmetric ozone molecule including an oxygen 18 atom. Groups of transitions are specified by giving a lower and upper limit of a frequency range, e.g., "O3-666-500e9-501e9".
To turn on Zeeman calculation for a species, "-Z" may be appended to its name: "O2-Z" or "O2-Z-66"
To turn on line mixing calculation for a species, "-LM" may be appended to its name (or after the Zeeman tag): "O2-LM" or "O2-Z-LM-66"
The symbol "*" acts as a wild card. Furthermore, frequency range or frequency range and isotopologue may be omitted.
Finally, instead of the isotopologue the special letter "nl" may be given, e.g., "H2O-nl". This means that no absorption at all is associated with this tag. (It is not quite clear if this feature is useful for anything right now.)
Example:
<br> species = [ "O3-666-500e9-501e9, O3-686", <br> "O3", <br> "H2O-PWR98" ]
<br> The first tag group selects all O3-666 lines between 500 and <br> 501 GHz plus all O3-686 lines.
<br> The second tag group selects all remaining O3 transitions.
<br> The third tag group selects H2O, with one of the complete <br> absorption models (Rosenkranz 98). No spectrocopic line catalogue <br> data will be used for that third tag group.
<br> Note that order of tag groups in the species list matters. In our <br> example, changing the order of the first two tag group will give <br> different results: as "O3" already selects all O3 transitions, <br> no lines will remain to be selected by the <br> "O3-666-500e9-501e9, O3-686" tag.
For CIA species the tag consists of the two involved species and a dataset index. CIA species can be defined for multiple regions The dataset index determines which region to use from the corresponding CIARecord in abs_cia_data.
Example
species = [ "N2-CIA-N2-0, N2-CIA-N2-1" ]
For Hitran cross section species the tag consists of the species and the tagtype HXSEC, e.g. CFC11-HXSEC. The data for the species must be available in the hitran_xsec_data variable. abs_xsec_agenda_checked* and propmat_clearsky_agenda_checked are set to be false.
[out] | abs_species | WS Output |
[out] | abs_xsec_agenda_checked | WS Output |
[out] | propmat_clearsky_agenda_checked | WS Output |
[in] | species | Generic Input |
Definition at line 1974 of file m_abs_lookup.cc.
References ARTS::Var::abs_species(), ARTS::Var::abs_xsec_agenda_checked(), array_species_tag_from_string(), check_abs_species(), CREATE_OUT3, Array< base >::nelem(), and ARTS::Var::propmat_clearsky_agenda_checked().
Referenced by abs_lines_per_speciesChangeBaseParameterForSpecies(), abs_lines_per_speciesChangeLineShapeModelParameterForSpecies(), abs_lines_per_speciesSetBaseParameterForSpecies(), abs_lines_per_speciesSetCutoffForSpecies(), abs_lines_per_speciesSetLinemixingLimitForSpecies(), abs_lines_per_speciesSetLineShapeModelParameterForSpecies(), abs_lines_per_speciesSetLineShapeTypeForSpecies(), abs_lines_per_speciesSetMirroringForSpecies(), abs_lines_per_speciesSetNormalizationForSpecies(), abs_lines_per_speciesSetPopulationForSpecies(), abs_lines_per_speciesSetT0ForSpecies(), abs_linesWriteSpeciesSplitXML(), abs_speciesDefineAll(), and abs_speciesSet_g().
Numeric calc_lookup_error | ( | Workspace & | ws, |
const GasAbsLookup & | al, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const bool | ignore_errors, | ||
const Agenda & | abs_xsec_agenda, | ||
const Numeric & | local_p, | ||
const Numeric & | local_t, | ||
const Vector & | local_vmrs, | ||
const Verbosity & | verbosity | ||
) |
Compare lookup and LBL calculation.
This is a helper function used by abs_lookupTestAccuracy. It takes local p, T, and VMR conditions, performs lookup table extraction and line by line absorption calculation, and compares the difference.
al | Lookup table |
abs_p_interp_order | Pressure interpolation order. |
abs_t_interp_order | Temperature interpolation order. |
abs_nls_interp_order | H2O interpolation order. |
ignore_errors | If true, we ignore runtime errors in lookup table extraction. This is handy, because in some cases it is not easy to make sure that all local conditions are inside the valid range for the lookup table. |
local_p | |
local_t | |
local_vmrs |
Definition at line 2441 of file m_abs_lookup.cc.
References ARTS::Var::abs_nls_interp_order(), ARTS::Var::abs_p_interp_order(), ARTS::Var::abs_t_interp_order(), ARTS::Var::abs_xsec_agenda(), ARTS::Var::dnlte_dx_source(), ARTS::Var::dpropmat_clearsky_dx(), GasAbsLookup::Extract(), GasAbsLookup::f_grid, ARTS::Var::jacobian_quantities(), joker, max, ConstMatrixView::ncols(), ConstVectorView::nelem(), ARTS::Var::nlte_do(), ARTS::Var::nlte_dsource_dx(), ARTS::Var::nlte_source(), ARTS::Var::propmat_clearsky(), propmat_clearskyAddOnTheFly(), propmat_clearskyInit(), GasAbsLookup::species, ARTS::Var::verbosity(), and ARTS::Var::x().
Referenced by abs_lookupTestAccMC().
void choose_abs_nls | ( | ArrayOfArrayOfSpeciesTag & | abs_nls, |
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Verbosity & | verbosity | ||
) |
Choose species for abs_nls.
Make an intelligent choice for abs_nls, based on abs_species.
[out] | abs_nls | The list of nonlinear species. |
[in] | abs_species | Absorption species. |
Definition at line 561 of file m_abs_lookup.cc.
References ARTS::Var::abs_nls(), ARTS::Var::abs_species(), CREATE_OUT2, find_next_species_tg(), find_nonlinear_continua(), Array< base >::nelem(), species_index_from_species_name(), and ARTS::Var::verbosity().
Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), and abs_lookupSetupWide().
void choose_abs_nls_pert | ( | Vector & | abs_nls_pert, |
ConstVectorView | refprof, | ||
ConstVectorView | minprof, | ||
ConstVectorView | maxprof, | ||
const Numeric & | step, | ||
const Index & | p_interp_order, | ||
const Index & | nls_interp_order, | ||
const Verbosity & | verbosity | ||
) |
Chose the H2O perturbations abs_nls_pert.
This simple function creates a vector of fractional H2O VMR perturbations, relative to the reference H2O profile, that covers the minimum and maximum profile.
[out] | abs_nls_pert | H2O VMR perturbations |
[in] | refprof | Reference profile |
[in] | minprof | Minimum profile |
[in] | maxprof | Maximum profile |
[in] | step | Fractional perturbation step |
Definition at line 686 of file m_abs_lookup.cc.
References ARTS::Var::abs_nls_pert(), CREATE_OUT2, CREATE_OUT3, gridpos_poly(), GridPosPoly::idx, Array< base >::nelem(), ConstVectorView::nelem(), VectorInsertGridPoints(), and ARTS::Var::verbosity().
Referenced by abs_lookupSetup().
void choose_abs_t_pert | ( | Vector & | abs_t_pert, |
ConstVectorView | abs_t, | ||
ConstVectorView | tmin, | ||
ConstVectorView | tmax, | ||
const Numeric & | step, | ||
const Index & | p_interp_order, | ||
const Index & | t_interp_order, | ||
const Verbosity & | verbosity | ||
) |
Chose the temperature perturbations abs_t_pert.
This simple function creates a vector of temperature perturbations, relative to the reference temperature profile, that covers the minimum and maximum temperature profile.
[out] | abs_t_pert | Temperature perturbations |
[in] | abs_t | Reference temperature profile |
[in] | tmin | Minimum temperature profile |
[in] | tmax | Maximum temperature profile |
[in] | t_step | Temperature perturbation step |
Definition at line 612 of file m_abs_lookup.cc.
References ARTS::Var::abs_t(), ARTS::Var::abs_t_pert(), CREATE_OUT2, CREATE_OUT3, gridpos_poly(), GridPosPoly::idx, Array< base >::nelem(), and ConstVectorView::nelem().
Referenced by abs_lookupSetup(), and abs_lookupSetupWide().
void f_gridFromGasAbsLookup | ( | Vector & | f_grid, |
const GasAbsLookup & | abs_lookup, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: f_gridFromGasAbsLookup.
Sets f_grid to the frequency grid of abs_lookup.
Must be called between importing/creating raw absorption table and call of abs_lookupAdapt.
[out] | f_grid | WS Output |
[in] | abs_lookup | WS Input |
Definition at line 2401 of file m_abs_lookup.cc.
References ARTS::Var::abs_lookup(), ARTS::Var::f_grid(), and ConstVectorView::nelem().
Referenced by f_gridFromGasAbsLookup_g().
void find_nonlinear_continua | ( | ArrayOfIndex & | cont, |
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Verbosity & | verbosity | ||
) |
Find continuum species in abs_species.
Returns an index array with indexes of those species in abs_species that have continuum tags that require h2o_abs, and hence require nonlinear treatment in the absorption lookup table.
H2O itself is ignored here since that is treated separately.
We are a bit conservative here, it is possible that some of the continua do not really require H2O. Check yourself, if you want, and improve the guessing here.
cont | indices of those species with continua. |
abs_species | list of absorption species. |
Definition at line 471 of file m_abs_lookup.cc.
References ARTS::Var::abs_species(), CREATE_OUT3, Species, species_index_from_species_name(), SpeciesTag::TYPE_CIA, and SpeciesTag::TYPE_PREDEF.
Referenced by choose_abs_nls().
void p_gridFromGasAbsLookup | ( | Vector & | p_grid, |
const GasAbsLookup & | abs_lookup, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: p_gridFromGasAbsLookup.
Sets p_grid to the pressure grid of abs_lookup.
[out] | p_grid | WS Output |
[in] | abs_lookup | WS Input |
Definition at line 2410 of file m_abs_lookup.cc.
References ARTS::Var::abs_lookup(), ConstVectorView::nelem(), and ARTS::Var::p_grid().
Referenced by p_gridFromGasAbsLookup_g().
void propmat_clearsky_fieldCalc | ( | Workspace & | ws, |
Tensor7 & | propmat_clearsky_field, | ||
Tensor6 & | nlte_source_field, | ||
const Index & | atmfields_checked, | ||
const Vector & | f_grid, | ||
const Index & | stokes_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const EnergyLevelMap & | nlte_field, | ||
const Tensor3 & | mag_u_field, | ||
const Tensor3 & | mag_v_field, | ||
const Tensor3 & | mag_w_field, | ||
const Agenda & | propmat_clearsky_agenda, | ||
const Vector & | doppler, | ||
const Vector & | los, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: propmat_clearsky_fieldCalc.
Calculate (vector) gas absorption coefficients for all points in the atmosphere.
This is useful in two different contexts:
The calculation itself is performed by the propmat_clearsky_agenda*.
[in,out] | ws | Workspace |
[out] | propmat_clearsky_field | WS Output |
[out] | nlte_source_field | WS Output |
[in] | atmfields_checked | WS Input |
[in] | f_grid | WS Input |
[in] | stokes_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | nlte_field | WS Input |
[in] | mag_u_field | WS Input |
[in] | mag_v_field | WS Input |
[in] | mag_w_field | WS Input |
[in] | propmat_clearsky_agenda | WS Input |
[in] | doppler | Generic Input (Default: "[]") |
[in] | los | Generic Input (Default: "[]") |
Definition at line 2148 of file m_abs_lookup.cc.
References abs, ARTS::Var::atmfields_checked(), chk_if_in_range(), CREATE_OUT2, CREATE_OUT3, ARTS::Var::f_grid(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ARTS::Var::mag_u_field(), ARTS::Var::mag_v_field(), ARTS::Var::mag_w_field(), max, ConstVectorView::nelem(), ARTS::Var::nlte_field(), ARTS::Var::nlte_source_field(), ARTS::Var::p_grid(), propmat_clearsky_agendaExecute(), ARTS::Var::propmat_clearsky_field(), ARTS::Var::stokes_dim(), ARTS::Var::t_field(), and ARTS::Var::vmr_field().
Referenced by propmat_clearsky_fieldCalc_g().
void propmat_clearskyAddFromLookup | ( | ArrayOfPropagationMatrix & | propmat_clearsky, |
ArrayOfPropagationMatrix & | dpropmat_clearsky_dx, | ||
const GasAbsLookup & | abs_lookup, | ||
const Index & | abs_lookup_is_adapted, | ||
const Index & | abs_p_interp_order, | ||
const Index & | abs_t_interp_order, | ||
const Index & | abs_nls_interp_order, | ||
const Index & | abs_f_interp_order, | ||
const Vector & | f_grid, | ||
const Numeric & | rtp_pressure, | ||
const Numeric & | rtp_temperature, | ||
const Vector & | rtp_vmr, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Numeric & | extpolfac, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: propmat_clearskyAddFromLookup.
Extract gas absorption coefficients from lookup table.
This extracts the absorption coefficient for all species from the lookup table, and adds them to the propagation matrix. Extraction is for one specific atmospheric condition, i.e., a set of pressure, temperature, and VMR values.
Some special species are ignored, for example Zeeman species and free electrons, since their absorption properties are not simple scalars and cannot be handled by the lookup table.
The interpolation order in T and H2O is given by abs_t_interp_order and abs_nls_interp_order, respectively.
Extraction is done for the frequencies in f_grid. Frequency interpolation is controlled by abs_f_interp_order. If this is zero, then f_grid must either be the same as the internal frequency grid of the lookup table (for efficiency reasons, only the first and last element of f_grid are checked), or must have only a single element. If abs_f_interp_order is above zero, then frequency is interpolated along with the other interpolation dimensions. This is useful for calculations with Doppler shift.
For Doppler calculations, you should generate the table with a somewhat larger frequency grid than the calculation itself has, since the Doppler shift will push the frequency grid out of the table range on one side.
Some extrapolation is allowed. For pressure and frequency interpolation the standard extrapolation factor of 0.5 is applied. The factor is the default for temperature and VMR interpolation, but the extrapolation limit can here be adjusted by the extpolfac argument.
See also: propmat_clearskyAddOnTheFly.
[in,out] | propmat_clearsky | WS Input/Output |
[in,out] | dpropmat_clearsky_dx | WS Input/Output |
[in] | abs_lookup | WS Input |
[in] | abs_lookup_is_adapted | WS Input |
[in] | abs_p_interp_order | WS Input |
[in] | abs_t_interp_order | WS Input |
[in] | abs_nls_interp_order | WS Input |
[in] | abs_f_interp_order | WS Input |
[in] | f_grid | WS Input |
[in] | rtp_pressure | WS Input |
[in] | rtp_temperature | WS Input |
[in] | rtp_vmr | WS Input |
[in] | jacobian_quantities | WS Input |
[in] | extpolfac | Generic Input (Default: "0.5") |
Definition at line 2022 of file m_abs_lookup.cc.
References ARTS::Var::abs_f_interp_order(), ARTS::Var::abs_lookup(), ARTS::Var::abs_lookup_is_adapted(), ARTS::Var::abs_nls_interp_order(), ARTS::Var::abs_p_interp_order(), ARTS::Var::abs_t_interp_order(), CREATE_OUT3, do_frequency_jacobian(), do_temperature_jacobian(), ARTS::Var::dpropmat_clearsky_dx(), equivalent_propmattype_indexes(), ARTS::Var::f_grid(), frequency_perturbation(), is_frequency_parameter(), ARTS::Var::jacobian_quantities(), joker, Array< base >::nelem(), ARTS::Var::propmat_clearsky(), supports_lookup(), and temperature_perturbation().
Referenced by propmat_clearskyAddFromLookup_g().
|
extern |
|
extern |
Referenced by abs_lookupSetupBatch().