ARTS 2.5.9 (git: 825fa5f2)
m_abs.cc File Reference

Stuff related to the calculation of absorption coefficients. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <memory>
#include <utility>
#include "absorption.h"
#include "absorptionlines.h"
#include "agenda_class.h"
#include "agenda_set.h"
#include "array.h"
#include "arts.h"
#include "arts_constants.h"
#include "arts_omp.h"
#include "artstime.h"
#include "auto_md.h"
#include "check_input.h"
#include "debug.h"
#include "depr.h"
#include "file.h"
#include "global_data.h"
#include "hitran_species.h"
#include "jacobian.h"
#include "lineshape.h"
#include "m_xml.h"
#include "math_funcs.h"
#include "matpackI.h"
#include "messages.h"
#include "methods.h"
#include "montecarlo.h"
#include "optproperties.h"
#include "parameters.h"
#include "physics_funcs.h"
#include "rte.h"
#include "species_tags.h"
#include "xml_io.h"
#include <netcdf.h>
#include "nc_io.h"

Go to the source code of this file.

Functions

void AbsInputFromRteScalars (Vector &abs_p, Vector &abs_t, Matrix &abs_vmrs, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const Verbosity &)
 
void abs_lines_per_speciesCreateFromLines (ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
 WORKSPACE METHOD: abs_lines_per_speciesCreateFromLines. More...
 
void abs_speciesDefineAllInScenario (ArrayOfArrayOfSpeciesTag &tgs, Index &propmat_clearsky_agenda_checked, const String &basename, const Verbosity &verbosity)
 WORKSPACE METHOD: abs_speciesDefineAllInScenario. More...
 
void abs_speciesDefineAll (ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, const Verbosity &verbosity)
 WORKSPACE METHOD: abs_speciesDefineAll. More...
 
void AbsInputFromAtmFields (Vector &abs_p, Vector &abs_t, Matrix &abs_vmrs, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const Verbosity &)
 WORKSPACE METHOD: AbsInputFromAtmFields. More...
 
void nlte_sourceFromTemperatureAndSrcCoefPerSpecies (StokesVector &nlte_source, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfMatrix &src_coef_per_species, const ArrayOfMatrix &dsrc_coef_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Numeric &rtp_temperature, const Verbosity &)
 
void propmat_clearskyInit (PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Index &stokes_dim, const Index &propmat_clearsky_agenda_checked, const Verbosity &)
 WORKSPACE METHOD: propmat_clearskyInit. More...
 
void propmat_clearskyAddFaraday (PropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &rtp_vmr, const Vector &rtp_los, const Vector &rtp_mag, const Verbosity &)
 WORKSPACE METHOD: propmat_clearskyAddFaraday. More...
 
void propmat_clearskyAddParticles (PropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &rtp_vmr, const Vector &rtp_los, const Numeric &rtp_temperature, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const Index &use_abs_as_ext, const Verbosity &verbosity)
 WORKSPACE METHOD: propmat_clearskyAddParticles. More...
 
void sparse_f_gridFromFrequencyGrid (Vector &sparse_f_grid, const Vector &f_grid, const Numeric &sparse_df, const String &speedup_option, const Verbosity &)
 WORKSPACE METHOD: sparse_f_gridFromFrequencyGrid. More...
 
Vector create_sparse_f_grid_internal (const Vector &f_grid, const Numeric &sparse_df, const String &speedup_option, const Verbosity &verbosity)
 
void propmat_clearskyAddLines (PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const SpeciesIsotopologueRatios &isotopologue_ratios, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const EnergyLevelMap &rtp_nlte, const Vector &rtp_vmr, const Index &nlte_do, const Index &lbl_checked, const Numeric &sparse_df, const Numeric &sparse_lim, const String &speedup_option, const Index &robust, const Verbosity &verbosity)
 WORKSPACE METHOD: propmat_clearskyAddLines. More...
 
void propmat_clearskyZero (PropagationMatrix &propmat_clearsky, const Vector &f_grid, const Index &stokes_dim, const Verbosity &)
 WORKSPACE METHOD: propmat_clearskyZero. More...
 
void propmat_clearskyForceNegativeToZero (PropagationMatrix &propmat_clearsky, const Verbosity &)
 WORKSPACE METHOD: propmat_clearskyForceNegativeToZero. More...
 
void isotopologue_ratiosInitFromBuiltin (SpeciesIsotopologueRatios &isotopologue_ratios, const Verbosity &)
 WORKSPACE METHOD: isotopologue_ratiosInitFromBuiltin. More...
 
void isotopologue_ratiosInitFromHitran (SpeciesIsotopologueRatios &isotopologue_ratios, const Verbosity &)
 WORKSPACE METHOD: isotopologue_ratiosInitFromHitran. More...
 
void WriteMolTau (const Vector &f_grid, const Tensor3 &z_field, const Tensor7 &propmat_clearsky_field, const Index &atmosphere_dim, const String &filename, const Verbosity &)
 WORKSPACE METHOD: WriteMolTau. More...
 
void propmat_clearsky_agendaAuto (Workspace &ws, Agenda &propmat_clearsky_agenda, Index &propmat_clearsky_agenda_checked, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &H, const Numeric &T_extrapolfac, const Numeric &eta, const Numeric &extpolfac, const Numeric &force_p, const Numeric &force_t, const Index &ignore_errors, const Numeric &lines_sparse_df, const Numeric &lines_sparse_lim, const String &lines_speedup_option, const Index &manual_mag_field, const Index &no_negatives, const Numeric &theta, const Index &use_abs_as_ext, const Index &use_abs_lookup_ind, const Verbosity &verbosity)
 WORKSPACE METHOD: propmat_clearsky_agendaAuto. More...
 

Variables

constexpr Numeric ELECTRON_CHARGE =-Constant::elementary_charge
 
constexpr Numeric ELECTRON_MASS =Constant::electron_mass
 
constexpr Numeric PI =Constant::pi
 
constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
 
constexpr Numeric VACUUM_PERMITTIVITY =Constant::vacuum_permittivity
 

Detailed Description

Stuff related to the calculation of absorption coefficients.

Author
Stefan Buehler
Date
2001-03-12

Definition in file m_abs.cc.

Function Documentation

◆ abs_lines_per_speciesCreateFromLines()

void abs_lines_per_speciesCreateFromLines ( ArrayOfArrayOfAbsorptionLines abs_lines_per_species,
const ArrayOfAbsorptionLines abs_lines,
const ArrayOfArrayOfSpeciesTag abs_species,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_lines_per_speciesCreateFromLines.

Split lines up into the different species.

The order of the splitting will match the outer layer of abs_species There will be no respect for the internal layer of abs_species

Author
Stefan Buehler
Parameters
[out]abs_lines_per_speciesWS Output
[in]abs_linesWS Input
[in]abs_speciesWS Input

Definition at line 106 of file m_abs.cc.

References a, Absorption::Lines::AppendSingleLine(), b, Absorption::Lines::Isotopologue(), Absorption::Lines::lines, Array< base >::nelem(), Absorption::Lines::NumLines(), Absorption::Lines::PopLine(), and Absorption::Lines::ReverseLines().

Referenced by abs_lines_per_speciesCreateFromLines_g(), abs_lines_per_speciesReadSpeciesSplitCatalog(), and abs_linesWriteSpeciesSplitCatalog().

◆ abs_speciesDefineAll()

void abs_speciesDefineAll ( ArrayOfArrayOfSpeciesTag abs_species,
Index propmat_clearsky_agenda_checked,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_speciesDefineAll.

Sets abs_species[i][0] to all species in ARTS

Author
Richard Larsson
Parameters
[out]abs_speciesWS Output
[out]propmat_clearsky_agenda_checkedWS Output

Definition at line 225 of file m_abs.cc.

References abs_speciesSet().

Referenced by abs_speciesDefineAll_g().

◆ abs_speciesDefineAllInScenario()

void abs_speciesDefineAllInScenario ( ArrayOfArrayOfSpeciesTag abs_species,
Index propmat_clearsky_agenda_checked,
const String basename,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_speciesDefineAllInScenario.

Define one tag group for each species known to ARTS and included in an atmospheric scenario.

You can use this as an alternative to abs_speciesSet if you want to make an absorption calculation that is as complete as possible. The method goes through all defined species and tries to open the VMR file. If this works the tag is included, otherwise it is skipped.

Author
Stefan Buehler
Parameters
[out]abs_speciesWS Output
[out]propmat_clearsky_agenda_checkedWS Output
[in]basenameGeneric Input

Definition at line 177 of file m_abs.cc.

References CREATE_OUT2, find_xml_file(), and Array< base >::nelem().

Referenced by abs_speciesDefineAllInScenario_g().

◆ AbsInputFromAtmFields()

void AbsInputFromAtmFields ( Vector abs_p,
Vector abs_t,
Matrix abs_vmrs,
const Index atmosphere_dim,
const Vector p_grid,
const Tensor3 t_field,
const Tensor4 vmr_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: AbsInputFromAtmFields.

Initialises the WSVs abs_p, abs_t and abs_vmrs from p_grid, t_field and vmr_field.

This only works for a 1D atmosphere!

Author
Stefan Buehler
Parameters
[out]abs_pWS Output
[out]abs_tWS Output
[out]abs_vmrsWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input

Definition at line 248 of file m_abs.cc.

References ARTS_USER_ERROR_IF, and joker.

Referenced by AbsInputFromAtmFields_g().

◆ AbsInputFromRteScalars()

void AbsInputFromRteScalars ( Vector abs_p,
Vector abs_t,
Matrix abs_vmrs,
const Numeric rtp_pressure,
const Numeric rtp_temperature,
const Vector rtp_vmr,
const Verbosity  
)

Definition at line 83 of file m_abs.cc.

References ConstVectorView::nelem(), Vector::resize(), and Matrix::resize().

◆ create_sparse_f_grid_internal()

Vector create_sparse_f_grid_internal ( const Vector f_grid,
const Numeric sparse_df,
const String speedup_option,
const Verbosity verbosity 
)

Definition at line 831 of file m_abs.cc.

References sparse_f_gridFromFrequencyGrid().

Referenced by propmat_clearskyAddLines().

◆ isotopologue_ratiosInitFromBuiltin()

void isotopologue_ratiosInitFromBuiltin ( SpeciesIsotopologueRatios isotopologue_ratios,
const Verbosity verbosity 
)

WORKSPACE METHOD: isotopologue_ratiosInitFromBuiltin.

Initialize isotopologue ratios with default values from built-in species data. This should be OK for Earth-like atmospheres

Author
Oliver Lemke
Parameters
[out]isotopologue_ratiosWS Output

Definition at line 1064 of file m_abs.cc.

References Species::isotopologue_ratiosInitFromBuiltin().

Referenced by isotopologue_ratiosInitFromBuiltin_g().

◆ isotopologue_ratiosInitFromHitran()

void isotopologue_ratiosInitFromHitran ( SpeciesIsotopologueRatios isotopologue_ratios,
const Verbosity verbosity 
)

WORKSPACE METHOD: isotopologue_ratiosInitFromHitran.

Initialize isotopologue ratios with default values from built-in Hitran species data.

Author
Richard Larsson
Parameters
[out]isotopologue_ratiosWS Output

Definition at line 1070 of file m_abs.cc.

References Hitran::isotopologue_ratios().

Referenced by isotopologue_ratiosInitFromHitran_g().

◆ nlte_sourceFromTemperatureAndSrcCoefPerSpecies()

void nlte_sourceFromTemperatureAndSrcCoefPerSpecies ( StokesVector nlte_source,
ArrayOfStokesVector dnlte_source_dx,
const ArrayOfMatrix src_coef_per_species,
const ArrayOfMatrix dsrc_coef_dx,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Vector f_grid,
const Numeric rtp_temperature,
const Verbosity  
)

◆ propmat_clearsky_agendaAuto()

void propmat_clearsky_agendaAuto ( Workspace ws,
Agenda propmat_clearsky_agenda,
Index propmat_clearsky_agenda_checked,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfArrayOfAbsorptionLines abs_lines_per_species,
const Numeric H,
const Numeric T_extrapolfac,
const Numeric eta,
const Numeric extpolfac,
const Numeric force_p,
const Numeric force_t,
const Index ignore_errors,
const Numeric lines_sparse_df,
const Numeric lines_sparse_lim,
const String lines_speedup_option,
const Index manual_mag_field,
const Index no_negatives,
const Numeric theta,
const Index use_abs_as_ext,
const Index use_abs_lookup,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearsky_agendaAuto.

Sets the propmat_clearsky_agenda automatically

This method introspects the input and uses it for generating the propmat_clearsky_agenda* automatically. If use_abs_lookup, all methods that can be used to generate the absorption lookup table are ignored and instead the calculations from the absorption lookup are used.

The following methods are considered for addition: <br> 1) propmat_clearskyInit <br> 2) propmat_clearskyAddCIA <br> 3) propmat_clearskyAddLines <br> 4) propmat_clearskyAddZeeman <br> 5) propmat_clearskyAddFaraday <br> 6) propmat_clearskyAddXsecFit <br> 7) propmat_clearskyAddParticles <br> 8) propmat_clearskyAddFromLookup <br> 9) propmat_clearskyAddPredefined <br> 10) propmat_clearskyAddOnTheFlyLineMixing <br> 11) propmat_clearskyAddHitranLineMixingLines <br> 12) propmat_clearskyAddOnTheFlyLineMixingWithZeeman

To perform absorption lookupo table calculation, call: <br> 1) propmat_clearsky_agendaAuto <br> 2) abs_lookupCalc <br> 3) propmat_clearsky_agendaAuto(use_abs_lookup=1) <br> 4) Perform other calculations

Author
Richard Larsson
Parameters
[in,out]wsWorkspace
[out]propmat_clearsky_agendaWS Output
[out]propmat_clearsky_agenda_checkedWS Output
[in]abs_speciesWS Input
[in]abs_lines_per_speciesWS Input
[in]HGeneric Input (Default: "1.0")
[in]T_extrapolfacGeneric Input (Default: "0.5")
[in]etaGeneric Input (Default: "0.0")
[in]extpolfacGeneric Input (Default: "0.5")
[in]force_pGeneric Input (Default: "-1")
[in]force_tGeneric Input (Default: "-1")
[in]ignore_errorsGeneric Input (Default: "0")
[in]lines_sparse_dfGeneric Input (Default: "0")
[in]lines_sparse_limGeneric Input (Default: "0")
[in]lines_speedup_optionGeneric Input (Default: "None")
[in]manual_mag_fieldGeneric Input (Default: "0")
[in]no_negativesGeneric Input (Default: "1")
[in]thetaGeneric Input (Default: "0.0")
[in]use_abs_as_extGeneric Input (Default: "1")
[in]use_abs_lookupGeneric Input (Default: "0")

Definition at line 1246 of file m_abs.cc.

References AgendaManip::AgendaCreator::add(), AbsorptionPopulationTagTypeStatus::ByHITRANFullRelmat, AbsorptionPopulationTagTypeStatus::ByHITRANRosenkranzRelmat, AbsorptionPopulationTagTypeStatus::ByMakarovFullRelmat, AbsorptionPopulationTagTypeStatus::ByRovibLinearDipoleLineMixing, SpeciesTagTypeStatus::Cia, CREATE_OUT3, AgendaManip::AgendaCreator::finalize(), SpeciesTagTypeStatus::FreeElectrons, AbsorptionPopulationTagTypeStatus::LTE, AbsorptionPopulationTagTypeStatus::NLTE, SpeciesTagTypeStatus::Particles, SpeciesTagTypeStatus::Plain, AbsorptionTagTypesStatus::population, SpeciesTagTypeStatus::Predefined, AbsorptionPopulationTagTypeStatus::VibTemps, SpeciesTagTypeStatus::XsecFit, and SpeciesTagTypeStatus::Zeeman.

Referenced by propmat_clearsky_agendaAuto_g().

◆ propmat_clearskyAddFaraday()

void propmat_clearskyAddFaraday ( PropagationMatrix propmat_clearsky,
ArrayOfPropagationMatrix dpropmat_clearsky_dx,
const Index stokes_dim,
const Index atmosphere_dim,
const Vector f_grid,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfSpeciesTag select_abs_species,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Vector rtp_vmr,
const Vector rtp_los,
const Vector rtp_mag,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyAddFaraday.

Calculates absorption matrix describing Faraday rotation.

Faraday rotation is a change of polarization state of an electromagnetic wave propagating through charged matter by interaction with a magnetic field. Hence, this method requires abs_species* to contain 'free_electrons' and electron content field (as part of vmr_field) as well as magnetic field (mag_u_field, mag_v_field*, mag_w_field) to be specified.

Faraday rotation affects Stokes parameters 2 and 3 (but not intensity!). Therefore, this method requires stokes_dim>2.

Like all 'propmat_clearskyAdd*' methods, the method is additive, i.e., does not overwrite the propagation matrix propmat_clearsky, but adds further contributions.

Author
Patrick Eriksson
Parameters
[in,out]propmat_clearskyWS Input/Output
[in,out]dpropmat_clearsky_dxWS Input/Output
[in]stokes_dimWS Input
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]abs_speciesWS Input
[in]select_abs_speciesWS Input
[in]jacobian_quantitiesWS Input
[in]rtp_vmrWS Input
[in]rtp_losWS Input
[in]rtp_magWS Input

Definition at line 422 of file m_abs.cc.

References abs(), PropagationMatrix::AddFaraday(), ARTS_USER_ERROR_IF, do_magnetic_jacobian(), dotprod_with_los(), ELECTRON_CHARGE, ELECTRON_MASS, is_frequency_parameter(), magnetic_field_perturbation(), Array< base >::nelem(), ConstVectorView::nelem(), PI, SPEED_OF_LIGHT, and VACUUM_PERMITTIVITY.

Referenced by propmat_clearskyAddFaraday_g().

◆ propmat_clearskyAddLines()

void propmat_clearskyAddLines ( PropagationMatrix propmat_clearsky,
StokesVector nlte_source,
ArrayOfPropagationMatrix dpropmat_clearsky_dx,
ArrayOfStokesVector dnlte_source_dx,
const Vector f_grid,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfSpeciesTag select_abs_species,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfArrayOfAbsorptionLines abs_lines_per_species,
const SpeciesIsotopologueRatios isotopologue_ratios,
const Numeric rtp_pressure,
const Numeric rtp_temperature,
const EnergyLevelMap rtp_nlte,
const Vector rtp_vmr,
const Index nlte_do,
const Index lbl_checked,
const Numeric lines_sparse_df,
const Numeric lines_sparse_lim,
const String lines_speedup_option,
const Index no_negatives,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyAddLines.

Computes the line-by-line unpolarized absorption and adds it to the diagonal of propmat_clearsky and derivates to other variables. Does the same for NLTE variables if required.

If lines_speedup_option is not "None", then some speed-up logic is applied. Valid speed-up logic other than "None" includes: <br> LinearIndependent: <br> Using a sparse-grid, the points are separated as [f0, f0+df[0], f0+df[0], f0+df[1]...] <br> until the entire f_grid is covered. All sparse bins are on f_grid so df changes. <br> A linear interpolation scheme is used between the bins to fill up the dense <br> absorption. The maximum of df[n] is given by lines_sparse_df and the minimum <br> transition between dense-to-sparse grid calculations are given by lines_sparse_lim. <br> QuadraticIndependent: <br> Using a sparse-grid, the points are separated as [f0, f0+0.5*df[0], f0+df[0], f0+df[0], f0+0.5*df[1], f0+df[1]...] <br> until the entire f_grid is covered. All sparse bins are on f_grid so df changes. <br> A quadratic interpolation scheme is used between the bins to fill up the dense <br> absorption. The maximum of df[n] is given by lines_sparse_df and the minimum <br> transition between dense-to-sparse grid calculations are given by lines_sparse_lim.

Please use sparse_f_gridFromFrequencyGrid to see the sparse frequency grid

By default we discourage negative values, which are common when using one of the line mixing approximations. Change the value of no_negatives to 0 to allow these negative absorptions.

Author
Richard Larsson
Parameters
[in,out]propmat_clearskyWS Input/Output
[in,out]nlte_sourceWS Input/Output
[in,out]dpropmat_clearsky_dxWS Input/Output
[in,out]dnlte_source_dxWS Input/Output
[in]f_gridWS Input
[in]abs_speciesWS Input
[in]select_abs_speciesWS Input
[in]jacobian_quantitiesWS Input
[in]abs_lines_per_speciesWS Input
[in]isotopologue_ratiosWS Input
[in]rtp_pressureWS Input
[in]rtp_temperatureWS Input
[in]rtp_nlteWS Input
[in]rtp_vmrWS Input
[in]nlte_doWS Input
[in]lbl_checkedWS Input
[in]lines_sparse_dfGeneric Input (Default: "0")
[in]lines_sparse_limGeneric Input (Default: "0")
[in]lines_speedup_optionGeneric Input (Default: "None")
[in]no_negativesGeneric Input (Default: "1")

Definition at line 843 of file m_abs.cc.

References any_negative(), arts_omp_get_max_threads(), arts_omp_get_thread_num(), arts_omp_in_parallel(), ARTS_USER_ERROR_IF, bad_propmat(), check_abs_species(), LineShape::compute(), create_sparse_f_grid_internal(), LineShape::ComputeData::dF, LineShape::ComputeData::dN, LineShape::ComputeData::F, flat_index(), LineShape::ComputeData::interp_add_even(), LineShape::ComputeData::interp_add_triplequad(), is_increasing(), joker, PropagationMatrix::Kjj(), LineShape::ComputeData::N, Array< base >::nelem(), ConstVectorView::nelem(), Zeeman::None, PropagationMatrix::NumberOfFrequencies(), ComplexVectorView::real(), ComplexMatrixView::real(), and EnergyLevelMap::value.

Referenced by propmat_clearskyAddLines_g().

◆ propmat_clearskyAddParticles()

void propmat_clearskyAddParticles ( PropagationMatrix propmat_clearsky,
ArrayOfPropagationMatrix dpropmat_clearsky_dx,
const Index stokes_dim,
const Index atmosphere_dim,
const Vector f_grid,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfSpeciesTag select_abs_species,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Vector rtp_vmr,
const Vector rtp_los,
const Numeric rtp_temperature,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const Index use_abs_as_ext,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyAddParticles.

Calculates absorption coefficients of particles to be used in clearsky (non-cloudbox) calculations.

This is a method to include particles (neglecting possible scattering components) in a clearsky calculation, i.e. without applying the cloudbox and scattering solvers. Particles are handled as absorbing species with one instance of 'particles' per scattering element considered added to abs_species. Particle absorption cross- sections at current atmospheric conditions are extracted from the single scattering data stored in scat_data, i.e., one array element per 'particles' instance in abs_species is required. Number densities are stored in vmr_field_raw or vmr_field as for all abs_species*, but can be taken from (raw) pnd_field type data.

Note that the absorption coefficient is applied both in the extinction term (neglecting scattering out of the line of sight) and the emission term (neglecting the scattering source term, i.e. scattering into the line of sight).

Optionally, particle extinction (sum of absorption and scattering coefficient) can be used instead of absorption only. To choose this case, set the use_abs_as_ext flag to 0. However, be aware that this creates some unphysical emission term, hence is only suitable, where the source term is negligible anyways, e.g. for occultation simulations.

A line-of-sight direction rtp_los is required as particles can exhibit directional dependent absorption properties, which is taken into account by this method. ScatElementsToabs_speciesAdd* can be used to add all required settings/data for individual scattering elements at once, i.e. a <br> 'particles' tag to abs_species, a set of single scattering data to scat_data* and a number density field to vmr_field_raw (vmr_field is derived applying AtmFieldsCalc once VMRs for all abs_species* have been added) is appended for each scattering element.

Like all 'propmat_clearskyAdd*' methods, the method is additive, i.e., does not overwrite the propagation matrix propmat_clearsky, but adds further contributions.

Author
Jana Mendrok
Parameters
[in,out]propmat_clearskyWS Input/Output
[in,out]dpropmat_clearsky_dxWS Input/Output
[in]stokes_dimWS Input
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]abs_speciesWS Input
[in]select_abs_speciesWS Input
[in]jacobian_quantitiesWS Input
[in]rtp_vmrWS Input
[in]rtp_losWS Input
[in]rtp_temperatureWS Input
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]use_abs_as_extGeneric Input (Default: "1")

Definition at line 535 of file m_abs.cc.

References PropagationMatrix::AddAbsorptionVectorAtPosition(), ARTS_ASSERT, ARTS_USER_ERROR_IF, CREATE_OUT1, do_frequency_jacobian(), do_temperature_jacobian(), joker, mirror_los(), Array< base >::nelem(), ConstVectorView::nelem(), PropagationMatrix::NumberOfFrequencies(), opt_prop_NScatElems(), Vector::resize(), PropagationMatrix::SetAtPosition(), PropagationMatrix::SetZero(), PropagationMatrix::StokesDimensions(), temperature_perturbation(), and TotalNumberOfElements().

Referenced by propmat_clearskyAddParticles_g().

◆ propmat_clearskyForceNegativeToZero()

void propmat_clearskyForceNegativeToZero ( PropagationMatrix propmat_clearsky,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyForceNegativeToZero.

Sets propmat_clearsky to match zero attenuation if negative value. Useful for line mixing in some cases.

Use this method just if you know what you are doing!

Author
Richard Larsson
Parameters
[in,out]propmat_clearskyWS Input/Output

Definition at line 1057 of file m_abs.cc.

References PropagationMatrix::Kjj(), PropagationMatrix::NumberOfFrequencies(), and PropagationMatrix::SetAtPosition().

Referenced by propmat_clearskyForceNegativeToZero_g().

◆ propmat_clearskyInit()

void propmat_clearskyInit ( PropagationMatrix propmat_clearsky,
StokesVector nlte_source,
ArrayOfPropagationMatrix dpropmat_clearsky_dx,
ArrayOfStokesVector dnlte_source_dx,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Vector f_grid,
const Index stokes_dim,
const Index propmat_clearsky_agenda_checked,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyInit.

Initialize propmat_clearsky, nlte_source, and their derivatives to zeroes.

This method must be used inside propmat_clearsky_agenda and then be called first.

Author
Oliver Lemke
Richard Larsson
Parameters
[out]propmat_clearskyWS Output
[out]nlte_sourceWS Output
[out]dpropmat_clearsky_dxWS Output
[out]dnlte_source_dxWS Output
[in]jacobian_quantitiesWS Input
[in]f_gridWS Input
[in]stokes_dimWS Input
[in]propmat_clearsky_agenda_checkedWS Input

Definition at line 352 of file m_abs.cc.

References ARTS_USER_ERROR_IF, Array< base >::nelem(), ConstVectorView::nelem(), PropagationMatrix::NumberOfFrequencies(), PropagationMatrix::SetZero(), and PropagationMatrix::StokesDimensions().

Referenced by propmat_clearskyInit_g().

◆ propmat_clearskyZero()

void propmat_clearskyZero ( PropagationMatrix propmat_clearsky,
const Vector f_grid,
const Index stokes_dim,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyZero.

Sets propmat_clearsky to match zero attenuation.

Use this method just if you know what you are doing!

If you want to make a calculation with no clear-sky attenuation at all, fill propmat_clearsky_agenda with this method and required Ignore statements (don't include propmat_clearskyInit).

Author
Patrick Eriksson
Parameters
[out]propmat_clearskyWS Output
[in]f_gridWS Input
[in]stokes_dimWS Input

Definition at line 1049 of file m_abs.cc.

References ConstVectorView::nelem().

Referenced by propmat_clearskyZero_g().

◆ sparse_f_gridFromFrequencyGrid()

void sparse_f_gridFromFrequencyGrid ( Vector sparse_f_grid,
const Vector f_grid,
const Numeric sparse_df,
const String speedup_option,
const Verbosity verbosity 
)

WORKSPACE METHOD: sparse_f_gridFromFrequencyGrid.

Outputs the sparse frequency grid in propmat_clearskyAddLines

Author
Richard Larsson
Parameters
[out]sparse_f_gridGeneric output
[in]f_gridWS Input
[in]sparse_dfGeneric Input (Default: "0")
[in]speedup_optionGeneric Input (Default: "None")

Definition at line 803 of file m_abs.cc.

References ARTS_ASSERT, LineShape::good_linear_sparse_f_grid(), LineShape::linear_sparse_f_grid(), ConstVectorView::nelem(), Vector::resize(), and LineShape::triple_sparse_f_grid().

Referenced by create_sparse_f_grid_internal(), and sparse_f_gridFromFrequencyGrid_g().

◆ WriteMolTau()

void WriteMolTau ( const Vector f_grid,
const Tensor3 z_field,
const Tensor7 propmat_clearsky_field,
const Index atmosphere_dim,
const String filename,
const Verbosity verbosity 
)

WORKSPACE METHOD: WriteMolTau.

Writes a 'molecular_tau_file' as required for libRadtran.

The libRadtran (www.libradtran.org) radiative transfer package is a comprehensive package for various applications, it can be used to compute radiances, irradiances, actinic fluxes, ... for the solar and the thermal spectral ranges. Absorption is usually treated using k-distributions or other parameterizations. For calculations with high spectral resolution it requires absorption coefficients from an external line-by-line model. Using this method, arts generates a file that can be used by libRadtran (option molecular_tau_file).

Author
Claudia Emde
Parameters
[in]f_gridWS Input
[in]z_fieldWS Input
[in]propmat_clearsky_fieldWS Input
[in]atmosphere_dimWS Input
[in]filenameGeneric Input

Definition at line 1078 of file m_abs.cc.

References ARTS_USER_ERROR_IF, Tensor4View::get_c_array(), ConstTensor7View::nbooks(), nca_error(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor3View::npages(), and SPEED_OF_LIGHT.

Referenced by WriteMolTau_g().

Variable Documentation

◆ ELECTRON_CHARGE

constexpr Numeric ELECTRON_CHARGE =-Constant::elementary_charge
inlineconstexpr

Definition at line 76 of file m_abs.cc.

Referenced by propmat_clearskyAddFaraday().

◆ ELECTRON_MASS

constexpr Numeric ELECTRON_MASS =Constant::electron_mass
inlineconstexpr

Definition at line 77 of file m_abs.cc.

Referenced by propmat_clearskyAddFaraday().

◆ PI

constexpr Numeric PI =Constant::pi
inlineconstexpr

Definition at line 78 of file m_abs.cc.

Referenced by propmat_clearskyAddFaraday().

◆ SPEED_OF_LIGHT

constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
inlineconstexpr

Definition at line 79 of file m_abs.cc.

Referenced by propmat_clearskyAddFaraday(), and WriteMolTau().

◆ VACUUM_PERMITTIVITY

constexpr Numeric VACUUM_PERMITTIVITY =Constant::vacuum_permittivity
inlineconstexpr

Definition at line 80 of file m_abs.cc.

Referenced by propmat_clearskyAddFaraday().