ARTS 2.5.11 (git: 725533f0)
CIARecord Class Reference

CIA data for a single pair of molecules. More...

#include <cia.h>

Public Member Functions

String MoleculeName (const Index i) const
 Return each molecule name (as a string) that is associated with this CIARecord.
 
void SetMoleculeName (const Index i, const String &name)
 Set each molecule name (from a string) that is associated with this CIARecord.
 
Species::Species Species (const Index i) const
 Return CIA species index.
 
Index DatasetCount () const
 Return number of datasets in this record.
 
ConstVectorView FrequencyGrid (Index dataset) const
 Return frequency grid for given dataset.
 
ConstVectorView TemperatureGrid (Index dataset) const
 Return temperatur grid for given dataset.
 
const GriddedField2Dataset (Index dataset) const
 Return CIA dataset.
 
const ArrayOfGriddedField2Data () const
 Return CIA data.
 
ArrayOfGriddedField2Data ()
 Return CIA data.
 
void SetSpecies (const Species::Species first, const Species::Species second)
 Set CIA species.
 
void Extract (VectorView result, const ConstVectorView &f_grid, const Numeric &temperature, const Numeric &T_extrapolfac, const Index &robust, const Verbosity &verbosity) const
 Vector version of extract.
 
Numeric Extract (const Numeric &frequency, const Numeric &temperature, const Numeric &T_extrapolfac, const Index &robust, const Verbosity &verbosity) const
 Scalar version of extract.
 
void ReadFromCIA (const String &filename, const Verbosity &verbosity)
 Read CIA catalog file.
 
void AppendDataset (const CIARecord &c2)
 Append other CIARecord to this.
 
std::array< Species::Species, 2 > TwoSpecies () const
 
std::array< Species::Species, 2 > & TwoSpecies ()
 
 CIARecord ()=default
 
 CIARecord (ArrayOfGriddedField2 data, Species::Species spec1, Species::Species spec2)
 

Private Member Functions

void AppendDataset (const Vector &freq, const Vector &temp, const ArrayOfVector &cia)
 Append dataset to mdata.
 

Private Attributes

ArrayOfGriddedField2 mdata
 The data itself, directly from the HITRAN file.
 
std::array< Species::Species, 2 > mspecies
 The pair of molecules associated with these CIA data.
 

Friends

void xml_read_from_stream (istream &is_xml, CIARecord &cr, bifstream *pbifs, const Verbosity &verbosity)
 Reads CIARecord from XML input stream.
 
ostream & operator<< (ostream &os, const CIARecord &cr)
 Output operator for CIARecord.
 

Detailed Description

CIA data for a single pair of molecules.

A variable of this class can hold the complete information from one HITRAN CIA file. A HITRAN CIA data file can hold several datasets (data for different temperatures but fixed frequency range). But all datasets are for the same pair of molecules.

Author
Stefan Buehler
Date
2000-08-21

Definition at line 57 of file cia.h.

Constructor & Destructor Documentation

◆ CIARecord() [1/2]

CIARecord::CIARecord ( )
default

◆ CIARecord() [2/2]

CIARecord::CIARecord ( ArrayOfGriddedField2  data,
Species::Species  spec1,
Species::Species  spec2 
)
inline

Definition at line 209 of file cia.h.

Member Function Documentation

◆ AppendDataset() [1/2]

void CIARecord::AppendDataset ( const CIARecord c2)

Append other CIARecord to this.

Definition at line 477 of file cia.cc.

References Dataset(), DatasetCount(), and mdata.

Referenced by ReadFromCIA().

◆ AppendDataset() [2/2]

void CIARecord::AppendDataset ( const Vector &  freq,
const Vector &  temp,
const ArrayOfVector &  cia 
)
private

Append dataset to mdata.

Append data dataset to mdata.

Definition at line 459 of file cia.cc.

References GriddedField2::data, mdata, GriddedField2::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().

◆ Data() [1/2]

ArrayOfGriddedField2 & CIARecord::Data ( )
inline

Return CIA data.

Definition at line 131 of file cia.h.

References mdata.

◆ Data() [2/2]

const ArrayOfGriddedField2 & CIARecord::Data ( ) const
inline

Return CIA data.

Definition at line 127 of file cia.h.

References mdata.

Referenced by xml_write_to_stream().

◆ Dataset()

const GriddedField2 & CIARecord::Dataset ( Index  dataset) const
inline

Return CIA dataset.

Definition at line 118 of file cia.h.

References ARTS_ASSERT, mdata, and Array< base >::nelem().

Referenced by AppendDataset().

◆ DatasetCount()

Index CIARecord::DatasetCount ( ) const
inline

Return number of datasets in this record.

Definition at line 96 of file cia.h.

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

Referenced by AppendDataset().

◆ Extract() [1/2]

Numeric CIARecord::Extract ( const Numeric &  frequency,
const Numeric &  temperature,
const Numeric &  T_extrapolfac,
const Index &  robust,
const Verbosity verbosity 
) const
inline

Scalar version of extract.

Use the vector version, if you can, it is more efficient. This is just a convenience wrapper for it.

Returns
Scalar CIA value at given frequency and temperature.
Parameters
[in]frequencyScalar frequency
[in]temperatureScalar temparature
[in]datasetIndex of dataset to use
[in]robustSet to 1 to suppress runtime errors (and return NAN values instead).
[in]verbosityStandard verbosity object.

Definition at line 173 of file cia.h.

References Extract().

◆ Extract() [2/2]

void CIARecord::Extract ( VectorView  result,
const ConstVectorView &  f_grid,
const Numeric &  temperature,
const Numeric &  T_extrapolfac,
const Index &  robust,
const Verbosity verbosity 
) const

Vector version of extract.

Check whether there is a suitable dataset in the CIARecord and do the interpolation.

Parameters
[out]resultCIA value for given frequency grid and temperature.
[in]f_gridFrequency grid.
[in]temperatureScalar temparature.
[in]datasetIndex of dataset to use.
[in]robustSet to 1 to suppress runtime errors (and return NAN values instead).
[in]verbosityStandard verbosity object.

Definition at line 245 of file cia.cc.

References cia_interpolation(), and mdata.

Referenced by abs_xsec_per_speciesAddCIA(), Extract(), and propmat_clearskyAddCIA().

◆ FrequencyGrid()

ConstVectorView CIARecord::FrequencyGrid ( Index  dataset) const
inline

Return frequency grid for given dataset.

Definition at line 100 of file cia.h.

References ARTS_ASSERT, mdata, and Array< base >::nelem().

◆ MoleculeName()

String CIARecord::MoleculeName ( const Index  i) const

Return each molecule name (as a string) that is associated with this CIARecord.

The CIARecord is defined for a pair of molecules!

Parameters
[in]iMust be either 0 or 1. Then the first or second name of the pair is returned.

Definition at line 260 of file cia.cc.

References ARTS_ASSERT, and mspecies.

Referenced by abs_xsec_per_speciesAddCIA(), propmat_clearskyAddCIA(), and xml_write_to_stream().

◆ ReadFromCIA()

void CIARecord::ReadFromCIA ( const String filename,
const Verbosity verbosity 
)

Read CIA catalog file.

Reads the given CIA catalog file into this CIARecord.

Parameters
[in]filenamePath of catalog file to read.
[in]verbosity.
Returns
os

Definition at line 296 of file cia.cc.

References AppendDataset(), c, CREATE_OUT2, mdata, my_basic_string< charT >::nelem(), open_input_file(), SPEED_OF_LIGHT, and w.

Referenced by abs_cia_dataReadFromCIA(), and CIARecordReadFromFile().

◆ SetMoleculeName()

void CIARecord::SetMoleculeName ( const Index  i,
const String name 
)

Set each molecule name (from a string) that is associated with this CIARecord.

The CIARecord is defined for a pair of molecules. The molecule names are internally stored as species indices.

Parameters
[in]iMust be either 0 or 1. Then the first or second name of the pair is returned.
[in]nameThe molecule name as a string, e.g., "H2O".

Definition at line 271 of file cia.cc.

References ARTS_ASSERT, ARTS_USER_ERROR_IF, good_enum(), and mspecies.

◆ SetSpecies()

void CIARecord::SetSpecies ( const Species::Species  first,
const Species::Species  second 
)
inline

Set CIA species.

Parameters
[in]firstCIA Species.
[in]secondCIA Species.

Definition at line 137 of file cia.h.

References mspecies.

Referenced by abs_cia_dataReadFromCIA(), and CIARecordReadFromFile().

◆ Species()

Species::Species CIARecord::Species ( const Index  i) const
inline

Return CIA species index.

Parameters
[in]iMust be either 0 or 1. Then the first or second species index is returned.

Definition at line 86 of file cia.h.

References ARTS_ASSERT, and mspecies.

Referenced by abs_cia_dataAddCIARecord(), abs_xsec_per_speciesAddCIA(), and propmat_clearskyAddCIA().

◆ TemperatureGrid()

ConstVectorView CIARecord::TemperatureGrid ( Index  dataset) const
inline

Return temperatur grid for given dataset.

Definition at line 109 of file cia.h.

References ARTS_ASSERT, mdata, and Array< base >::nelem().

◆ TwoSpecies() [1/2]

std::array< Species::Species, 2 > & CIARecord::TwoSpecies ( )
inline

Definition at line 205 of file cia.h.

References mspecies.

◆ TwoSpecies() [2/2]

std::array< Species::Species, 2 > CIARecord::TwoSpecies ( ) const
inline

Definition at line 202 of file cia.h.

References mspecies.

Friends And Related Symbol Documentation

◆ operator<<

ostream & operator<< ( ostream &  os,
const CIARecord cr 
)
friend

Output operator for CIARecord.

Outputs the grids for the given CIARecord.

Parameters
[in,out]osOutput stream.
[in]crCIARecord.
Returns
os

Definition at line 491 of file cia.cc.

◆ xml_read_from_stream

void xml_read_from_stream ( istream &  is_xml,
CIARecord cr,
bifstream pbifs,
const Verbosity verbosity 
)
friend

Reads CIARecord from XML input stream.

Parameters
is_xmlXML Input stream
irecordCIARecord return value
pbifsPointer to binary input stream. NULL in case of ASCII file.

Definition at line 33 of file xml_io_compound_types.cc.

Member Data Documentation

◆ mdata

ArrayOfGriddedField2 CIARecord::mdata
private

The data itself, directly from the HITRAN file.

Dimensions: Array dimension: Dataset. One file (one molecule pair) can have different datasets, typically for different temperature or frequency ranges. Gridded field dimension 1: Frequency [Hz]. Gridded field dimension 2: Temperature [K]. Data: Binary absorption cross-sections in m^5 molec^(-2)

Definition at line 233 of file cia.h.

Referenced by AppendDataset(), AppendDataset(), Data(), Data(), Dataset(), DatasetCount(), Extract(), FrequencyGrid(), ReadFromCIA(), and TemperatureGrid().

◆ mspecies

std::array<Species::Species, 2> CIARecord::mspecies
private

The pair of molecules associated with these CIA data.

Molecules are specified by their ARTS internal mspecies index! (This has to be determined upon reading from a file. Should it ever be written out, it has to be mapped to a string again.)

We use a plain C array here, since the length of this is always 2.

Definition at line 243 of file cia.h.

Referenced by MoleculeName(), SetMoleculeName(), SetSpecies(), Species(), TwoSpecies(), and TwoSpecies().


The documentation for this class was generated from the following files: