Go to the documentation of this file.
68 if (n_tgs != n_xsec || n_tgs != nr_vmrs)
72 os <<
"The following variables must all have the same dimension:\n"
73 <<
"abs_species: " << n_tgs <<
"\n"
74 <<
"abs_xsec_per_species: " << n_xsec <<
"\n"
75 <<
"abs_vmrs.nrows: " << nr_vmrs <<
"\n";
77 throw runtime_error(os.str());
115 if (n_p != n_t || n_p != nc_vmrs) {
117 os <<
"The following variables must all have the same dimension:\n"
118 <<
"abs_p: " << n_p <<
"\n"
119 <<
"abs_t: " << n_t <<
"\n"
120 <<
"abs_vmrs.ncols: " << nc_vmrs;
121 throw runtime_error(os.str());
154 assert(this_cia_index != -1);
159 if (out2.sufficient_priority()) {
161 out2 <<
" CIA Species found: " + this_species.
Name() +
"\n";
168 os <<
"Wrong dimension of abs_xsec_per_species.nrows for species " << i
170 <<
"should match f_grid (" <<
f_grid.nelem() <<
") but is "
171 << this_xsec.
nrows() <<
".";
172 throw runtime_error(os.str());
176 os <<
"Wrong dimension of abs_xsec_per_species.ncols for species " << i
178 <<
"should match abs_p (" <<
abs_p.nelem() <<
") but is "
179 << this_xsec.
ncols() <<
".";
180 throw runtime_error(os.str());
190 os <<
"VMR profile for second species in CIA species pair does not exist.\n"
191 <<
"Tag " << this_species.
Name() <<
" needs a VMR profile of "
193 throw runtime_error(os.str());
197 for (
Index ip = 0; ip <
abs_p.nelem(); ip++) {
208 this_cia.
Extract(dxsec_temp_dF,
216 this_cia.
Extract(dxsec_temp_dT,
223 }
catch (
const std::runtime_error& e) {
225 os <<
"Problem with CIA species " << this_species.
Name() <<
":\n"
227 throw runtime_error(os.str());
242 this_xsec(
joker, ip) += xsec_temp;
247 for (
Index iv = 0; iv < xsec_temp.
nelem(); iv++) {
248 this_xsec(iv, ip) += n * xsec_temp[iv];
249 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem();
254 n * (dxsec_temp_dF[iv] - xsec_temp[iv]) / df;
256 JacPropMatType::Temperature)
258 n * (dxsec_temp_dT[iv] - xsec_temp[iv]) / dt +
259 xsec_temp[iv] * dn_dT;
261 [jacobian_quantities_position[iq]],
277 const String& species_tag,
285 os <<
"Invalid species tag " << species_tag <<
".\n"
286 <<
"This is not recognized as a CIA type.\n";
287 throw std::runtime_error(os.str());
299 const Index& clobber,
317 const String& catalogpath,
320 subfolders.push_back(
"Main-Folder/");
321 subfolders.push_back(
"Alternate-Folder/");
339 if (cia_index != -1)
continue;
354 for (
Index fname = 0; !found && fname < cia_names.
nelem(); fname++) {
355 String cia_name = cia_names[fname];
357 for (
Index dir = 0; !found && dir < subfolders.
nelem(); dir++) {
359 checked_dirs.push_back(catalogpath +
"/" + subfolders[dir] +
363 }
catch (
const std::runtime_error& e) {
367 for (
Index i = files.
nelem() - 1; i >= 0; i--) {
368 if (files[i].find(cia_name) != 0 ||
369 files[i].rfind(
".cia") != files[i].length() - 4) {
370 files.erase(files.begin() + i);
377 String catfile = *(checked_dirs.end() - 1) + files[0];
390 os <<
"Error: No data file found for CIA species " << cia_names[0]
392 <<
"Looked in directories: " << checked_dirs;
394 throw runtime_error(os.str());
412 vector<String> missing_tags;
426 if (cia_index == -1) {
427 missing_tags.push_back(
435 if (missing_tags.size()) {
439 os <<
"Error: The following CIA tag(s) are missing in input file: ";
440 for (
size_t i = 0; i < missing_tags.size(); i++) {
445 os << missing_tags[i];
447 throw runtime_error(os.str());
453 const String& catalogpath,
460 for (
Index i = 0; i < cia_tags.
nelem(); i++) {
465 cia_tags[i].split(species_names,
"-");
467 if (species_names.
nelem() != 2) {
469 os <<
"ERROR: Cannot parse CIA tag: " << cia_tags[i];
470 throw runtime_error(os.str());
473 this_species_tag.push_back(
474 SpeciesTag(species_names[0] +
"-CIA-" + species_names[1] +
"-0"));
476 species_tags.push_back(this_species_tag);
Index CIADataset() const
CIA dataset index inside this CIA file.
Index Species(const Index i) const
Return CIA species index.
QuantumIdentifier::QType Index LowerQuantumNumbers Index Numeric CIASecond
void Print(Workspace &ws, const Agenda &x, const Index &level, const Verbosity &verbosity)
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Declarations required for the calculation of absorption coefficients.
void CIARecordReadFromFile(CIARecord &cia_record, const String &species_tag, const String &filename, const Verbosity &verbosity)
WORKSPACE METHOD: CIARecordReadFromFile.
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
Verbosity verbosity(Workspace &ws) noexcept
String Name() const
Return the full name of the tag.
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
Index BathSpecies() const
Molecular species index.
const Numeric SPEED_OF_LIGHT
void resize(Index n)
Resize function.
void CIAInfo(const String &catalogpath, const ArrayOfString &cia_tags, const Verbosity &verbosity)
WORKSPACE METHOD: CIAInfo.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
Index nrows() const
Returns the number of rows.
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
ArrayOfMatrix abs_xsec_per_species(Workspace &ws) noexcept
void ReadFromCIA(const String &filename, const Verbosity &verbosity)
Read CIA catalog file.
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
Matrix abs_vmrs(Workspace &ws) noexcept
This can be used to make arrays out of anything.
A tag group can consist of the sum of several of these.
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
String species_name_from_species_index(const Index spec_ind)
Return species name for given species index.
Declarations having to do with the four output streams.
Index ncols() const
Returns the number of columns.
ArrayOfCIARecord abs_cia_data(Workspace &ws) noexcept
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Index nelem() const
Returns the number of elements.
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
void abs_cia_dataAddCIARecord(ArrayOfCIARecord &abs_cia_data, const CIARecord &cia_record, const Index &clobber, const Verbosity &)
WORKSPACE METHOD: abs_cia_dataAddCIARecord.
Index CIASecond() const
Species index of the 2nd CIA species.
NUMERIC Numeric
The type to use for all floating point numbers.
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
Vector f_grid(Workspace &ws) noexcept
void abs_cia_dataReadFromCIA(ArrayOfCIARecord &abs_cia_data, const ArrayOfArrayOfSpeciesTag &abs_species, const String &catalogpath, const Verbosity &verbosity)
WORKSPACE METHOD: abs_cia_dataReadFromCIA.
Type
Type of line shape to compute.
void list_directory(ArrayOfString &files, String dirname)
Return list of files in directory.
Vector abs_t(Workspace &ws) noexcept
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)
WORKSPACE METHOD: abs_xsec_per_speciesAddCIA.
ArrayOfIndex abs_species_active(Workspace &ws) noexcept
Numeric dnumber_density_dt(const Numeric &p, const Numeric &t)
dnumber_density_dT
CIA data for a single pair of molecules.
bool supports_CIA(const ArrayOfRetrievalQuantity &js)
Returns if the array supports CIA derivatives.
void SetSpecies(const Index first, const Index second)
Set CIA species.
This file contains basic functions to handle ASCII files.
INDEX Index
The type to use for all integer numbers and indices.
Vector abs_p(Workspace &ws) noexcept
ArrayOfArrayOfMatrix dabs_xsec_per_species_dx(Workspace &ws) noexcept
String MoleculeName(const Index i) const
Return each molecule name (as a string) that is associated with this CIARecord.
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
void Extract(VectorView result, ConstVectorView f_grid, const Numeric &temperature, const Index &dataset, const Numeric &T_extrapolfac, const Index &robust, const Verbosity &verbosity) const
Vector version of extract.
Index Type() const
Return the type of this tag.
Index cia_get_index(const ArrayOfCIARecord &cia_data, const Index sp1, const Index sp2)
Get the index in cia_data for the two given species.
Index Species() const
Molecular species index.
bool species_match(const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
Index nelem() const
Number of elements.
Header file for work with HITRAN collision induced absorption (CIA).
The global header file for ARTS.
This file contains basic functions to handle XML data files.
void abs_cia_dataReadFromXML(ArrayOfCIARecord &abs_cia_data, const ArrayOfArrayOfSpeciesTag &abs_species, const String &filename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_cia_dataReadFromXML.