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

Workspace methods for HITRAN CIA data. More...

#include <algorithm>
#include <filesystem>
#include "absorption.h"
#include "arts.h"
#include "arts_constants.h"
#include "auto_md.h"
#include "cia.h"
#include "debug.h"
#include "file.h"
#include "messages.h"
#include "physics_funcs.h"
#include "species.h"
#include "species_tags.h"
#include "xml_io.h"

Go to the source code of this file.

Functions

void abs_xsec_per_speciesAddCIA (ArrayOfMatrix &abs_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const Matrix &abs_vmrs, const ArrayOfCIARecord &abs_cia_data, const Numeric &T_extrapolfac, const Index &robust, const Verbosity &verbosity)
 
void propmat_clearskyAddCIA (PropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const ArrayOfCIARecord &abs_cia_data, const Numeric &T_extrapolfac, const Index &ignore_errors, const Verbosity &verbosity)
 WORKSPACE METHOD: propmat_clearskyAddCIA. More...
 
void CIARecordReadFromFile (CIARecord &cia_record, const String &species_tag, const String &filename, const Verbosity &verbosity)
 WORKSPACE METHOD: CIARecordReadFromFile. More...
 
void abs_cia_dataAddCIARecord (ArrayOfCIARecord &abs_cia_data, const CIARecord &cia_record, const Index &clobber, const Verbosity &)
 WORKSPACE METHOD: abs_cia_dataAddCIARecord. More...
 
void abs_cia_dataReadFromCIA (ArrayOfCIARecord &abs_cia_data, const ArrayOfArrayOfSpeciesTag &abs_species, const String &catalogpath, const Verbosity &verbosity)
 WORKSPACE METHOD: abs_cia_dataReadFromCIA. More...
 
void abs_cia_dataReadFromXML (ArrayOfCIARecord &abs_cia_data, const ArrayOfArrayOfSpeciesTag &abs_species, const String &filename, const Verbosity &verbosity)
 WORKSPACE METHOD: abs_cia_dataReadFromXML. More...
 
void CIAInfo (const String &catalogpath, const ArrayOfString &cia_tags, const Verbosity &verbosity)
 WORKSPACE METHOD: CIAInfo. More...
 
void abs_cia_dataReadSpeciesSplitCatalog (ArrayOfCIARecord &abs_cia_data, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Index &robust, const Verbosity &verbosity)
 WORKSPACE METHOD: abs_cia_dataReadSpeciesSplitCatalog. More...
 

Variables

constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
 

Detailed Description

Workspace methods for HITRAN CIA data.

Author
Oliver Lemke olemk.nosp@m.e@co.nosp@m.re-du.nosp@m.mp.i.nosp@m.nfo
Stefan Buehler
Date
2012-12-04

Definition in file m_cia.cc.

Function Documentation

◆ abs_cia_dataAddCIARecord()

void abs_cia_dataAddCIARecord ( ArrayOfCIARecord abs_cia_data,
const CIARecord cia_record,
const Index clobber,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_cia_dataAddCIARecord.

Takes CIARecord as input and appends the results in the appropriate place.

If CIARecord has same species as species in abs_cia_data, then the array position is used to append all of the CIARecord into the array. If clobber evaluates as true, cia_record overwrites the appropriate abs_cia_data. If species in cia_record are not in abs_cia_data, the CIARecord is pushed back.

Author
Richard Larsson
Parameters
[in,out]abs_cia_dataWS Input/Output
[in]cia_recordGeneric Input
[in]clobberGeneric Input (Default: "0")

Definition at line 500 of file m_cia.cc.

References cia_get_index(), and CIARecord::Species().

Referenced by abs_cia_dataAddCIARecord_g().

◆ abs_cia_dataReadFromCIA()

void abs_cia_dataReadFromCIA ( ArrayOfCIARecord abs_cia_data,
const ArrayOfArrayOfSpeciesTag abs_species,
const String catalogpath,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_cia_dataReadFromCIA.

Read data from a CIA data file for all CIA molecules defined in abs_species.

The units in the HITRAN file are: Frequency: cm^(-1) Binary absorption cross-section: cm^5 molec^(-2)

Upon reading we convert this to the ARTS internal SI units of Hz and m^5 molec^(-2).

Author
Oliver Lemke
Parameters
[out]abs_cia_dataWS Output
[in]abs_speciesWS Input
[in]catalogpathGeneric Input

Definition at line 518 of file m_cia.cc.

References ARTS_USER_ERROR_IF, cia_get_index(), list_directory(), Array< base >::nelem(), CIARecord::ReadFromCIA(), and CIARecord::SetSpecies().

Referenced by abs_cia_dataReadFromCIA_g(), and CIAInfo().

◆ abs_cia_dataReadFromXML()

void abs_cia_dataReadFromXML ( ArrayOfCIARecord abs_cia_data,
const ArrayOfArrayOfSpeciesTag abs_species,
const String filename,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_cia_dataReadFromXML.

Read data from a CIA XML file and check that all CIA tags defined in abs_species are present in the file.

The units of the data are described in abs_cia_dataReadFromCIA.

Author
Oliver Lemke
Parameters
[out]abs_cia_dataWS Output
[in]abs_speciesWS Input
[in]filenameGeneric Input (Default: "")

Definition at line 601 of file m_cia.cc.

References ARTS_USER_ERROR, cia_get_index(), Array< base >::nelem(), and xml_read_from_file().

Referenced by abs_cia_dataReadFromXML_g().

◆ abs_cia_dataReadSpeciesSplitCatalog()

void abs_cia_dataReadSpeciesSplitCatalog ( ArrayOfCIARecord abs_cia_data,
const ArrayOfArrayOfSpeciesTag abs_species,
const String basename,
const Index robust,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_cia_dataReadSpeciesSplitCatalog.

Reads a species split CIA dataset.

Author
Richard Larsson
Parameters
[out]abs_cia_dataWS Output
[in]abs_speciesWS Input
[in]basenameGeneric Input
[in]robustGeneric Input (Default: "0")

Definition at line 683 of file m_cia.cc.

References ARTS_USER_ERROR_IF, var_string(), and xml_read_from_file().

Referenced by abs_cia_dataReadSpeciesSplitCatalog_g().

◆ abs_xsec_per_speciesAddCIA()

void abs_xsec_per_speciesAddCIA ( ArrayOfMatrix abs_xsec_per_species,
ArrayOfArrayOfMatrix dabs_xsec_per_species_dx,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfIndex abs_species_active,
const Vector f_grid,
const Vector abs_p,
const Vector abs_t,
const Matrix abs_vmrs,
const ArrayOfCIARecord abs_cia_data,
const Numeric T_extrapolfac,
const Index robust,
const Verbosity verbosity 
)

◆ CIAInfo()

void CIAInfo ( const String catalogpath,
const ArrayOfString cia_tags,
const Verbosity verbosity 
)

WORKSPACE METHOD: CIAInfo.

Display information about the given CIA tags. The CIA tags shown are in the same format as needed by abs_speciesSet.

Author
Oliver Lemke
Parameters
[in]catalogpathGeneric Input
[in]cia_tagsGeneric Input

Definition at line 652 of file m_cia.cc.

References abs_cia_dataReadFromCIA(), ARTS_USER_ERROR_IF, CREATE_OUT1, Array< base >::nelem(), and Print().

Referenced by CIAInfo_g().

◆ CIARecordReadFromFile()

void CIARecordReadFromFile ( CIARecord cia_record,
const String species_tag,
const String filename,
const Verbosity verbosity 
)

WORKSPACE METHOD: CIARecordReadFromFile.

Reads CIARecord from Hitran-style file.

Author
Richard Larsson
Parameters
[out]cia_recordGeneric output
[in]species_tagGeneric Input
[in]filenameGeneric Input

Definition at line 482 of file m_cia.cc.

References ARTS_USER_ERROR_IF, CIARecord::ReadFromCIA(), and CIARecord::SetSpecies().

Referenced by CIARecordReadFromFile_g().

◆ propmat_clearskyAddCIA()

void propmat_clearskyAddCIA ( PropagationMatrix propmat_clearsky,
ArrayOfPropagationMatrix dpropmat_clearsky_dx,
const ArrayOfArrayOfSpeciesTag abs_species,
const ArrayOfSpeciesTag select_abs_species,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Vector f_grid,
const Numeric rtp_pressure,
const Numeric rtp_temperature,
const Vector rtp_vmr,
const ArrayOfCIARecord abs_cia_data,
const Numeric T_extrapolfac,
const Index ignore_errors,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearskyAddCIA.

Calculate absorption coefficients per tag group for HITRAN CIA continua.

This interpolates the cross sections from abs_cia_data.

The robust option is intended only for testing. Do not use for normal runs, since subsequent functions will not be able to deal with NAN values.

Author
Stefan Buehler, Oliver Lemke
Parameters
[in,out]propmat_clearskyWS Input/Output
[in,out]dpropmat_clearsky_dxWS Input/Output
[in]abs_speciesWS Input
[in]select_abs_speciesWS Input
[in]jacobian_quantitiesWS Input
[in]f_gridWS Input
[in]rtp_pressureWS Input
[in]rtp_temperatureWS Input
[in]rtp_vmrWS Input
[in]abs_cia_dataWS Input
[in]T_extrapolfacGeneric Input (Default: "0.5")
[in]ignore_errorsGeneric Input (Default: "0")

Definition at line 258 of file m_cia.cc.

References any_negative(), ARTS_ASSERT, ARTS_USER_ERROR, ARTS_USER_ERROR_IF, bad_propmat(), check_abs_species(), cia_get_index(), CREATE_OUTS, dnumber_density_dt(), do_temperature_jacobian(), do_wind_jacobian(), CIARecord::Extract(), find_first_species(), frequency_perturbation(), is_increasing(), is_wind_parameter(), PropagationMatrix::Kjj(), CIARecord::MoleculeName(), Array< base >::nelem(), ConstVectorView::nelem(), number_density(), PropagationMatrix::NumberOfFrequencies(), Vector::resize(), CIARecord::Species(), species_match(), supports_CIA(), and temperature_perturbation().

Referenced by propmat_clearskyAddCIA_g().

Variable Documentation

◆ SPEED_OF_LIGHT

constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
inlineconstexpr

Definition at line 44 of file m_cia.cc.