#include <algorithm>
#include <map>
#include <limits>
#include "auto_md.h"
#include "arts.h"
#include "messages.h"
#include "gas_abs_lookup.h"
#include "agenda_class.h"
#include "check_input.h"
#include "matpackV.h"
#include "physics_funcs.h"
#include "math_funcs.h"
#include "make_vector.h"
#include "arts_omp.h"
#include "interpolation_poly.h"
Go to the source code of this file.
Functions | |
void | abs_lookupInit (GasAbsLookup &) |
WORKSPACE METHOD: abs_lookupInit. | |
void | abs_lookupCreate (GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, 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 Vector &abs_n2, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters) |
WORKSPACE METHOD: abs_lookupCreate. | |
void | find_nonlinear_continua (ArrayOfIndex &cont, const ArrayOfArrayOfSpeciesTag &abs_species) |
Find continuum species in abs_species. | |
void | choose_abs_nls (ArrayOfArrayOfSpeciesTag &abs_nls, const ArrayOfArrayOfSpeciesTag &abs_species) |
Choose species for abs_nls. | |
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) |
Chose the temperature perturbations abs_t_pert. | |
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) |
Chose the H2O perturbations abs_nls_pert. | |
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 Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, 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) |
WORKSPACE METHOD: abs_lookupSetup. | |
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 ArrayOfGField4 &batch_fields, 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 Vector &extremes) |
WORKSPACE METHOD: abs_lookupSetupBatch. | |
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) |
WORKSPACE METHOD: abs_lookupSetupWide. | |
void | abs_speciesAdd (ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfString &names) |
WORKSPACE METHOD: abs_speciesAdd. | |
void | abs_speciesAdd2 (Workspace &ws, ArrayOfArrayOfSpeciesTag &abs_species, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Matrix &jac, 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 &method, const String &mode, const Numeric &dx) |
WORKSPACE METHOD: abs_speciesAdd2. | |
void | abs_speciesInit (ArrayOfArrayOfSpeciesTag &abs_species) |
WORKSPACE METHOD: abs_speciesInit. | |
void | SpeciesSet (ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfString &names) |
WORKSPACE METHOD: SpeciesSet. | |
void | abs_lookupAdapt (GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const Vector &f_grid) |
WORKSPACE METHOD: abs_lookupAdapt. | |
void | abs_scalar_gasExtractFromLookup (Matrix &abs_scalar_gas, 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 &f_index, const Numeric &a_pressure, const Numeric &a_temperature, const Vector &a_vmr_list) |
WORKSPACE METHOD: abs_scalar_gasExtractFromLookup. | |
void | abs_fieldCalc (Workspace &ws, Tensor5 &asg_field, const Agenda &sga_agenda, const Index &f_index, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const Tensor4 &vmr_field) |
WORKSPACE METHOD: abs_fieldCalc. | |
void | f_gridFromGasAbsLookup (Vector &f_grid, const GasAbsLookup &abs_lookup) |
WORKSPACE METHOD: f_gridFromGasAbsLookup. | |
void | p_gridFromGasAbsLookup (Vector &p_grid, const GasAbsLookup &abs_lookup) |
WORKSPACE METHOD: p_gridFromGasAbsLookup. | |
Numeric | calc_lookup_error (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 Vector &abs_n2, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters, const Numeric &local_p, const Numeric &local_t, const Vector &local_vmrs) |
Compare lookup and LBL calculation. | |
void | abs_lookupTestAccuracy (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 Vector &abs_n2, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters) |
WORKSPACE METHOD: abs_lookupTestAccuracy. | |
Variables | |
const Index | GFIELD4_FIELD_NAMES |
const Index | GFIELD4_P_GRID |
Definition in file m_abs_lookup.cc.
void abs_fieldCalc | ( | Workspace & | ws, | |
Tensor5 & | abs_field, | |||
const Agenda & | abs_scalar_gas_agenda, | |||
const Index & | f_index, | |||
const Vector & | f_grid, | |||
const Index & | atmosphere_dim, | |||
const Vector & | p_grid, | |||
const Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const Tensor3 & | t_field, | |||
const Tensor4 & | vmr_field | |||
) |
WORKSPACE METHOD: abs_fieldCalc.
Calculate scalar gas absorption for all points in the atmosphere.
This is useful in two different contexts:
1. For testing and plotting gas absorption. (For RT calculations, gas absorption is calculated or extracted locally, therefore there is no need to calculate a global field. But this method is handy for easy plotting of absorption vs. pressure, for example.)
2. Inside the scattering region, monochromatic absorption is pre-calculated for the entire atmospheric field.
Because of the different contexts, the method can calculate absorption either for all frequencies in the frequency grid (f_index<0), or just for the frequency indicated by f_index (f_index>=0).
The calculation itself is performed by the abs_scalar_gas_agenda*.
[in,out] | ws | Workspace |
[out] | abs_field | WS Output |
[in] | abs_scalar_gas_agenda | WS Input |
[in] | f_index | WS Input |
[in] | f_grid | WS Input |
[in] | atmosphere_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 |
Definition at line 1823 of file m_abs_lookup.cc.
References abs_scalar_gas_agendaExecute(), chk_atm_field(), chk_atm_grids(), exit_or_rethrow(), joker, max, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), out2, out3, Tensor5::resize(), and transpose().
Referenced by abs_fieldCalc_g().
void abs_lookupAdapt | ( | GasAbsLookup & | abs_lookup, | |
Index & | abs_lookup_is_adapted, | |||
const ArrayOfArrayOfSpeciesTag & | abs_species, | |||
const Vector & | f_grid | |||
) |
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.
[out] | abs_lookup | WS Output |
[out] | abs_lookup_is_adapted | WS Output |
[in] | abs_species | WS Input |
[in] | f_grid | WS Input |
Definition at line 1781 of file m_abs_lookup.cc.
References GasAbsLookup::Adapt().
Referenced by abs_lookupAdapt_g().
void abs_lookupCreate | ( | GasAbsLookup & | abs_lookup, | |
Index & | abs_lookup_is_adapted, | |||
const ArrayOfArrayOfSpeciesTag & | abs_species, | |||
const ArrayOfArrayOfLineRecord & | abs_lines_per_species, | |||
const ArrayOfLineshapeSpec & | abs_lineshape, | |||
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 Vector & | abs_n2, | |||
const ArrayOfString & | abs_cont_names, | |||
const ArrayOfString & | abs_cont_models, | |||
const ArrayOfVector & | abs_cont_parameters | |||
) |
WORKSPACE METHOD: abs_lookupCreate.
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 contrast to other absorption functions, this method does not use the input variable *abs_h2o*. This is because *abs_h2o* has to be set interally to allow perturbations. If there are more than one H2O species, the first is assumed to be the main one.
[out] | abs_lookup | WS Output |
[out] | abs_lookup_is_adapted | WS Output |
[in] | abs_species | WS Input |
[in] | abs_lines_per_species | WS Input |
[in] | abs_lineshape | 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_n2 | WS Input |
[in] | abs_cont_names | WS Input |
[in] | abs_cont_models | WS Input |
[in] | abs_cont_parameters | WS Input |
Definition at line 58 of file m_abs_lookup.cc.
References abs_xsec_per_speciesAddConts(), abs_xsec_per_speciesAddLines(), abs_xsec_per_speciesInit(), arts_omp_get_nested(), arts_omp_set_nested(), chk_size(), exit_or_rethrow(), GasAbsLookup::f_grid, find_first_species_tg(), get_tag_group_name(), is_unique(), joker, GasAbsLookup::log_p_grid, ConstVectorView::nelem(), Array< base >::nelem(), GasAbsLookup::nls_pert, GasAbsLookup::nonlinear_species, out2, out3, GasAbsLookup::p_grid, Tensor4::resize(), Vector::resize(), spec(), GasAbsLookup::species, species_index_from_species_name(), GasAbsLookup::t_pert, GasAbsLookup::t_ref, transform(), GasAbsLookup::vmrs_ref, and GasAbsLookup::xsec.
Referenced by abs_lookupCreate_g().
void abs_lookupInit | ( | GasAbsLookup & | abs_lookup | ) |
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 48 of file m_abs_lookup.cc.
References out2.
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 Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const Tensor3 & | t_field, | |||
const Tensor4 & | vmr_field, | |||
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 | |||
) |
WORKSPACE METHOD: abs_lookupSetup.
Set up input parameters for abs_lookupCreate.
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.
Keywords: <br> p_step : Maximum step in log10(p[Pa]) (base 10 logarithm). If <br> the pressure grid is coarser than this, additional points <br> are added until each log step is smaller than this. <br> Has a default value. <br> t_step : The temperature variation grid step in Kelvin, for a 2D <br> or 3D atmosphere. For a 1D atmosphere this parameter is <br> not used. Has a default value. <br> h2o_step : The H2O variation grid step [fractional], if H2O variations are done <br> (which is determined automatically, based on abs_species <br> and the atmospheric dimension). For a 1D atmosphere this parameter is <br> not used. Has a default value.
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] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | 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 812 of file m_abs_lookup.cc.
References chk_atm_field(), chk_atm_grids(), 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(), Matrix::resize(), Vector::resize(), species_index_from_species_name(), and transform().
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 ArrayOfGField4 & | batch_atm_fields_compact, | |||
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 Vector & | extremes | |||
) |
WORKSPACE METHOD: abs_lookupSetupBatch.
Set up input parameters for abs_lookupCreate 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 depend on h2o_abs*, and hence 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.
Keywords: <br> p_step : Maximum step in log10(p[Pa]) (base 10 logarithm). If <br> the pressure grid is coarser than this, additional points <br> are added until each log step is smaller than this. <br> Has a default value. <br> t_step : The temperature variation grid step in Kelvin, for a 2D <br> or 3D atmosphere. For a 1D atmosphere this parameter is <br> not used. Has a default value. <br> h2o_step : The H2O variation grid step [fractional], if H2O variations are done <br> (which is determined automatically, based on abs_species <br> and the atmospheric dimension). For a 1D atmosphere this parameter is <br> not used. Has a default value. <br> extremes : You can give here explicit extreme values to add to <br> abs_t_pert and abs_nls_pert. The order is [t_pert_min, <br> t_pert_max, nls_pert_min, nls_pert_max]. Has a default value of empty. 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] | p_step | Generic Input (Default: "0.05") |
[in] | t_step | Generic Input (Default: "100") |
[in] | h2o_step | Generic Input (Default: "100") |
[in] | extremes | Generic Input (Default: "[]") |
Definition at line 1099 of file m_abs_lookup.cc.
References choose_abs_nls(), choose_abs_nls_pert(), choose_abs_t_pert(), GFIELD4_FIELD_NAMES, GFIELD4_P_GRID, gridpos(), gridpos_poly(), GridPosPoly::idx, interp(), interpweights(), joker, max, min, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), ConstTensor4View::ncols(), ConstVectorView::nelem(), Array< base >::nelem(), ConstTensor4View::npages(), ConstMatrixView::nrows(), ConstTensor4View::nrows(), out2, out3, Matrix::resize(), Vector::resize(), and transform().
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 | |||
) |
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 all Chevallier data set cases, and a bit more. The statistics of the Chevallier 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
p_step is in log10(p[hPa])
FIXME: Explicitly document keywords.
[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.1") |
Definition at line 1508 of file m_abs_lookup.cc.
References choose_abs_nls(), choose_abs_nls_pert(), choose_abs_t_pert(), find_first_species_tg(), joker, Array< base >::nelem(), out1, out2, Matrix::resize(), Vector::resize(), species_index_from_species_name(), and transform().
Referenced by abs_lookupSetupWide_g().
void abs_lookupTestAccuracy | ( | 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 Vector & | abs_n2, | |||
const ArrayOfArrayOfLineRecord & | abs_lines_per_species, | |||
const ArrayOfLineshapeSpec & | abs_lineshape, | |||
const ArrayOfString & | abs_cont_names, | |||
const ArrayOfString & | abs_cont_models, | |||
const ArrayOfVector & | abs_cont_parameters | |||
) |
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).
Produces no workspace output, only output to the output streams.
[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_n2 | WS Input |
[in] | abs_lines_per_species | WS Input |
[in] | abs_lineshape | WS Input |
[in] | abs_cont_names | WS Input |
[in] | abs_cont_models | WS Input |
[in] | abs_cont_parameters | WS Input |
Definition at line 2153 of file m_abs_lookup.cc.
References calc_lookup_error(), find_first_species_tg(), joker, GasAbsLookup::log_p_grid, ConstVectorView::nelem(), Array< base >::nelem(), GasAbsLookup::nls_pert, GasAbsLookup::nonlinear_species, out2, GasAbsLookup::p_grid, GasAbsLookup::species, species_index_from_species_name(), GasAbsLookup::t_pert, GasAbsLookup::t_ref, and GasAbsLookup::vmrs_ref.
Referenced by abs_lookupTestAccuracy_g().
void abs_scalar_gasExtractFromLookup | ( | Matrix & | abs_scalar_gas, | |
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 & | f_index, | |||
const Numeric & | rte_pressure, | |||
const Numeric & | rte_temperature, | |||
const Vector & | rte_vmr_list | |||
) |
WORKSPACE METHOD: abs_scalar_gasExtractFromLookup.
Extract scalar gas absorption coefficients from lookup table.
This extracts the absorption coefficient for all species in the current calculation from the lookup table. Extraction is for one specific atmospheric condition, i.e., a set of pressure, temperature, and VMR values.
Extraction can be either for a single frequency (f_index>=0), or for all frequencies (f_index<0). The dimension of the output abs_scalar_gas is adjusted accordingly.
The interpolation order in T and H2O is given by *abs_t_interp_order* and *abs_nls_interp_order*, respectively.
See also: *abs_scalar_gasCalcLBL*.
[out] | abs_scalar_gas | WS 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] | f_index | WS Input |
[in] | rte_pressure | WS Input |
[in] | rte_temperature | WS Input |
[in] | rte_vmr_list | WS Input |
Definition at line 1792 of file m_abs_lookup.cc.
References GasAbsLookup::Extract().
Referenced by abs_scalar_gasExtractFromLookup_g().
void abs_speciesAdd | ( | ArrayOfArrayOfSpeciesTag & | abs_species, | |
const ArrayOfString & | species | |||
) |
WORKSPACE METHOD: abs_speciesAdd.
Adds species tag groups to the list of absorption species.
This WSM is similar to *SpeciesSet*, the only difference is that this method appends species to an existing list of absorption species instead of creating the whole list.
See *SpeciesSet* for details on how tags are defined and examples of how to input them in the control file.
Keywords: <br> species : Specify one String for each tag group that you want to <br> add. Inside the String, separate the tags by commas <br> (plus optional blanks).
[out] | abs_species | WS Output |
[in] | species | Generic Input |
Definition at line 1664 of file m_abs_lookup.cc.
References array_species_tag_from_string(), Array< base >::nelem(), out3, and temp.
Referenced by abs_speciesAdd_g().
void abs_speciesAdd2 | ( | Workspace & | ws, | |
ArrayOfArrayOfSpeciesTag & | abs_species, | |||
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
Agenda & | jacobian_agenda, | |||
const Matrix & | jacobian, | |||
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 & | method, | |||
const String & | unit, | |||
const Numeric & | dx | |||
) |
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 |
[out] | abs_species | WS Output |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[in] | jacobian | WS Input |
[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] | method | Generic Input |
[in] | unit | Generic Input |
[in] | dx | Generic Input |
Definition at line 1698 of file m_abs_lookup.cc.
References array_species_tag_from_string(), jacobianAddAbsSpecies(), Array< base >::nelem(), and out3.
Referenced by abs_speciesAdd2_g().
void abs_speciesInit | ( | ArrayOfArrayOfSpeciesTag & | abs_species | ) |
WORKSPACE METHOD: abs_speciesInit.
Sets *abs_speciesSet* to be empty.
[out] | abs_species | WS Output |
Definition at line 1741 of file m_abs_lookup.cc.
Referenced by abs_speciesInit_g().
Numeric calc_lookup_error | ( | 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 Vector & | abs_n2, | |||
const ArrayOfArrayOfLineRecord & | abs_lines_per_species, | |||
const ArrayOfLineshapeSpec & | abs_lineshape, | |||
const ArrayOfString & | abs_cont_names, | |||
const ArrayOfString & | abs_cont_models, | |||
const ArrayOfVector & | abs_cont_parameters, | |||
const Numeric & | local_p, | |||
const Numeric & | local_t, | |||
const Vector & | local_vmrs | |||
) |
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 2044 of file m_abs_lookup.cc.
References abs_scalar_gasCalcLBL(), GasAbsLookup::Extract(), GasAbsLookup::f_grid, joker, max, ConstVectorView::nelem(), ConstMatrixView::nrows(), and GasAbsLookup::species.
Referenced by abs_lookupTestAccuracy().
void choose_abs_nls | ( | ArrayOfArrayOfSpeciesTag & | abs_nls, | |
const ArrayOfArrayOfSpeciesTag & | abs_species | |||
) |
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 580 of file m_abs_lookup.cc.
References find_next_species_tg(), find_nonlinear_continua(), Array< base >::nelem(), out2, and species_index_from_species_name().
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 | |||
) |
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 711 of file m_abs_lookup.cc.
References gridpos_poly(), GridPosPoly::idx, Array< base >::nelem(), ConstVectorView::nelem(), out2, out3, and VectorInsertGridPoints().
Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), and abs_lookupSetupWide().
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 | |||
) |
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 635 of file m_abs_lookup.cc.
References gridpos_poly(), GridPosPoly::idx, Array< base >::nelem(), ConstVectorView::nelem(), out2, and out3.
Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), and abs_lookupSetupWide().
void f_gridFromGasAbsLookup | ( | Vector & | f_grid, | |
const GasAbsLookup & | abs_lookup | |||
) |
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 2004 of file m_abs_lookup.cc.
References GasAbsLookup::GetFgrid().
Referenced by f_gridFromGasAbsLookup_g().
void find_nonlinear_continua | ( | ArrayOfIndex & | cont, | |
const ArrayOfArrayOfSpeciesTag & | abs_species | |||
) |
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 495 of file m_abs_lookup.cc.
References Array< base >::nelem(), out3, species_data, and species_index_from_species_name().
Referenced by choose_abs_nls().
void p_gridFromGasAbsLookup | ( | Vector & | p_grid, | |
const GasAbsLookup & | abs_lookup | |||
) |
WORKSPACE METHOD: p_gridFromGasAbsLookup.
Sets *p_grid* to the frequency grid of *abs_lookup*.
[out] | p_grid | WS Output |
[in] | abs_lookup | WS Input |
Definition at line 2013 of file m_abs_lookup.cc.
References GasAbsLookup::GetPgrid().
Referenced by p_gridFromGasAbsLookup_g().
void SpeciesSet | ( | ArrayOfArrayOfSpeciesTag & | gout1, | |
const ArrayOfString & | species | |||
) |
WORKSPACE METHOD: 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, isotope, and a range of frequencies. Species are named after the standard chemical names, e.g., "O3". Isotopes 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".
The symbol "*" acts as a wild card. Furthermore, frequency range or frequency range and isotope may be omitted.
Finally, instead of the isotope 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.)
This method used to be a specific method for *abs_species*. Now it is generic, so that it can also be used to set *abs_nls* and *abs_pts*.
Generic Output: <br> ArrayOfArrayOfSpeciesTag : Output tag groups.
Keywords: <br> species : Specify one String for each tag group that you want to <br> create. Inside the String, separate the tags by commas <br> (plus optional blanks).
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.
[out] | gout1 | Generic output |
[in] | species | Generic Input |
Definition at line 1748 of file m_abs_lookup.cc.
References array_species_tag_from_string(), Array< base >::nelem(), and out3.
Referenced by get_tagindex_for_Strings(), and SpeciesSet_g().
const Index GFIELD4_FIELD_NAMES |
const Index GFIELD4_P_GRID |