Go to the documentation of this file.
77 os <<
"Unknown species (1st molecule) in CIARecord: " << molecule1;
78 throw runtime_error(os.str());
82 os <<
"Unknown species (2nd molecule) in CIARecord: " << molecule2;
83 throw runtime_error(os.str());
135 Index n_blocks, row_start, row_extent, column_start, column_extent, row_index,
136 column_index, is_inverse;
143 for (
Index i = 0; i < n_blocks; i++) {
156 Range row_range(row_start, row_extent);
157 Range column_range(column_start, column_extent);
158 if (type ==
"Matrix") {
159 std::shared_ptr<Matrix>
M =
160 std::make_shared<Matrix>(row_extent, column_extent);
166 std::make_pair(row_index, column_index),
171 std::make_pair(row_index, column_index),
174 }
else if (type ==
"Sparse") {
175 std::shared_ptr<Sparse>
M =
176 std::make_shared<Sparse>(row_extent, column_extent);
182 std::make_pair(row_index, column_index),
187 std::make_pair(row_index, column_index),
216 covmat_tag.
set_name(
"CovarianceMatrix");
284 close_tag.
set_name(
"/CovarianceMatrix");
334 open_tag.
set_name(
"EnergyLevelMap");
343 close_tag.
set_name(
"/EnergyLevelMap");
406 os_xml, gal.
t_ref, pbofs,
"ReferenceTemperatureProfile",
verbosity);
412 "NonlinearSpeciesVmrPerturbations",
415 os_xml, gal.
xsec, pbofs,
"AbsorptionCrossSections",
verbosity);
417 close_tag.
set_name(
"/GasAbsLookup");
448 }
else if (tag.
get_name() ==
"Array") {
463 "Grids must be of type *Vector* or *ArrayOfString*\n"
469 os <<
"Grids must be of type *Vector* or *ArrayOfString*\n"
470 <<
"but tag <" + tag.
get_name() +
"> found.";
471 if (tag.
get_name() ==
"ArrayOfString")
472 os <<
"\nCorrect XML tag for *ArrayOfString* is <Array type=\"String\" ...>.";
555 if (!name.length() && (gfield.
get_name().length()))
557 else if (name.length())
566 close_tag.
set_name(
"/GriddedField1");
617 if (!name.length() && (gfield.
get_name().length()))
619 else if (name.length())
628 close_tag.
set_name(
"/GriddedField2");
679 if (!name.length() && (gfield.
get_name().length()))
681 else if (name.length())
690 close_tag.
set_name(
"/GriddedField3");
741 if (!name.length() && (gfield.
get_name().length()))
743 else if (name.length())
752 close_tag.
set_name(
"/GriddedField4");
803 if (!name.length() && (gfield.
get_name().length()))
805 else if (name.length())
814 close_tag.
set_name(
"/GriddedField5");
865 if (!name.length() && (gfield.
get_name().length()))
867 else if (name.length())
876 close_tag.
set_name(
"/GriddedField6");
928 "OriginalGridIndexBelowInterpolationPoint",
931 os_xml, gpos.
fd[0], pbofs,
"FractionalDistanceToNextPoint_1",
verbosity);
933 os_xml, gpos.
fd[1], pbofs,
"FractionalDistanceToNextPoint_2",
verbosity);
977 tag.
check_name(
"/HitranRelaxationMatrixData");
995 open_tag.
set_name(
"HitranRelaxationMatrixData");
1019 close_tag.
set_name(
"/HitranRelaxationMatrixData");
1076 open_tag.
set_name(
"IsotopologueRecord");
1091 close_tag.
set_name(
"/IsotopologueRecord");
1157 os_xml,
ppath.dim, pbofs,
"AtmosphericDimensionality",
verbosity);
1159 os_xml,
ppath.np, pbofs,
"NumberOfPositionInPropagationPath",
verbosity);
1161 os_xml,
ppath.constant, pbofs,
"PropagationPathConstant",
verbosity);
1163 os_xml,
ppath.background, pbofs,
"RadiativeBackground",
verbosity);
1167 "StartPositionOfPropagationPath",
1170 os_xml,
ppath.start_los, pbofs,
"StartLOSOfPropagationPath",
verbosity);
1174 "StartLstepOfPropagationPath",
1182 os_xml,
ppath.lstep, pbofs,
"PropagationPathPositionLength",
verbosity);
1184 os_xml,
ppath.end_pos, pbofs,
"EndPositionOfPropagationPath",
verbosity);
1186 os_xml,
ppath.end_los, pbofs,
"EndLOSOfPropagationPath",
verbosity);
1188 os_xml,
ppath.end_lstep, pbofs,
"EndLstepPropagationPath",
verbosity);
1190 os_xml,
ppath.nreal, pbofs,
"RefractiveIndexRealPart",
verbosity);
1194 os_xml,
ppath.gp_p, pbofs,
"PressureGridIndexPosition",
verbosity);
1196 os_xml,
ppath.gp_lat, pbofs,
"LatitudeGridIndexPosition",
verbosity);
1198 os_xml,
ppath.gp_lon, pbofs,
"LongitudeGridIndexPosition",
verbosity);
1226 }
catch (
const std::runtime_error& e) {
1228 os <<
"Error reading PropagationMatrix: "
1231 throw runtime_error(os.str());
1253 open_tag.
set_name(
"PropagationMatrix");
1261 close_tag.
set_name(
"/PropagationMatrix");
1288 }
catch (
const std::runtime_error& e) {
1290 os <<
"Error reading QuantumIdentifier: "
1293 throw runtime_error(os.str());
1315 open_tag.
set_name(
"QuantumIdentifier");
1321 close_tag.
set_name(
"/QuantumIdentifier");
1348 for (n = 0; n < nelem; n++) is_xml >> qn;
1349 }
catch (
const std::runtime_error& e) {
1351 os <<
"Error reading QuantumNumbers: "
1352 <<
"\n Element: " << n <<
"\n"
1354 throw runtime_error(os.str());
1376 open_tag.
set_name(
"QuantumNumbers");
1381 os_xml <<
" " << qn <<
" ";
1383 close_tag.
set_name(
"/QuantumNumbers");
1423 maintag, subtag, subsubtag, mode, analytical, perturbation, grids);
1441 open_tag.
set_name(
"RetrievalQuantity");
1454 close_tag.
set_name(
"/RetrievalQuantity");
1478 if (version ==
"3") {
1482 }
else if (version ==
"2") {
1492 os <<
"Ptype value (" << ptype <<
") is wrong."
1496 <<
" - azimuthally randomly oriented particles, or\n"
1498 throw runtime_error(os.str());
1507 if ((ssdata.
za_grid[0] > 1) ||
1510 os <<
"Missing data in xml-stream. Expected za_grid: [0, 180]. "
1511 <<
"Found za_grid: [" << ssdata.
za_grid[0] <<
", "
1513 throw runtime_error(os.str());
1519 throw runtime_error(
1520 "Number of frequencies in f_grid and pha_mat_data "
1552 open_tag.
set_name(
"SingleScatteringData");
1569 close_tag.
set_name(
"/SingleScatteringData");
1593 if (version !=
"3") {
1595 os <<
"Only ScatteringMetaData version 3 can be handled. "
1596 <<
"Versions 1 and 2 are obsolete.";
1597 throw runtime_error(os.str());
1628 open_tag.
set_name(
"ScatteringMetaData");
1642 close_tag.
set_name(
"/ScatteringMetaData");
1725 for (n = 0; n <
nelem; n++) {
1730 artstags.push_back(artstag);
1733 os <<
"SpeciesAuxData for " << artstag <<
" already defined.\n"
1734 <<
"Duplicates are not allowed in input file.";
1735 throw runtime_error(os.str());
1738 }
catch (
const std::runtime_error& e) {
1740 os <<
"Error reading SpeciesAuxData: "
1741 <<
"\n Element: " << n <<
"\n"
1743 throw runtime_error(os.str());
1745 }
else if (version == 2) {
1751 for (n = 0; n <
nelem; n++) {
1760 sad.
setParam(artstag, auxtype, auxdata);
1763 artstags.push_back(artstag);
1766 os <<
"SpeciesAuxData for " << artstag <<
" already defined.\n"
1767 <<
"Duplicates are not allowed in input file.";
1768 throw runtime_error(os.str());
1771 }
catch (
const std::runtime_error& e) {
1773 os <<
"Error reading SpeciesAuxData: "
1774 <<
"\n Element: " << n <<
"\n"
1776 throw runtime_error(os.str());
1780 os <<
"Unsupported SpeciesAuxData version number: " << version
1781 <<
", expected 1 or 2.";
1782 throw std::runtime_error(os.str());
1813 open_tag.
set_name(
"SpeciesAuxData");
1840 close_tag.
set_name(
"/SpeciesAuxData");
1891 open_tag.
set_name(
"SpeciesRecord");
1900 close_tag.
set_name(
"/SpeciesRecord");
1926 bool string_starts_with_quotes =
true;
1937 string_starts_with_quotes =
false;
1939 }
while (is_xml.good() && dummy !=
'"' && string_starts_with_quotes);
1942 if (!string_starts_with_quotes) {
1946 is_xml.get(strbuf,
'"');
1947 if (is_xml.fail()) {
1980 os_xml <<
'\"' << stag.
Name() <<
'\"';
2008 }
catch (
const std::runtime_error& e) {
2010 os <<
"Error reading StokesVector: "
2013 throw runtime_error(os.str());
2043 close_tag.
set_name(
"/StokesVector");
2113 close_tag.
set_name(
"/TelsemAtlas");
2141 if (species == -1) {
2143 os <<
" Unknown species in XsecRecord: " << species_name;
2144 throw std::runtime_error(os.str());
2160 std::ostringstream os;
2161 os <<
" Bugged input data for " << species_name <<
". "
2162 <<
"Number of bands mismatch.\n"
2163 <<
"Cross sections: " << xd.
mxsecs.
nelem() <<
"\n"
2166 throw std::runtime_error(os.str());
2170 out2 <<
" Warning: No temperature fit available for " << species_name
2171 <<
" band " << i <<
"\n";
2173 std::ostringstream os;
2174 os <<
" Bugged input data for " << species_name <<
". "
2175 <<
"Length of cross sections (" << xd.
mxsecs[i].
nelem()
2176 <<
") does not match length of temperature fit data ("
2178 throw std::runtime_error(os.str());
2182 std::ostringstream os;
2183 os <<
" Bugged input data for " << species_name <<
". "
2184 <<
"Length of temperature fit slope data (" << xd.
mtslope[i].
nelem()
2185 <<
") does not match length of temperature fit intersect data ("
2187 throw std::runtime_error(os.str());
2194 for (
Index i = 0; i < ndatasets; i++) {
2221 Vector fmin(ndatasets), fmax(ndatasets);
2222 for (
Index i = 0; i < ndatasets; i++) {
2223 fmin[i] = xd.
Fgrids()[i][0];
2256 throw runtime_error(
"Method not implemented!");
2264 throw runtime_error(
"Method not implemented!");
2273 throw runtime_error(
"Method not implemented!");
2281 throw runtime_error(
"Method not implemented!");
2290 throw runtime_error(
"Method not implemented!");
2298 throw runtime_error(
"Method not implemented!");
2307 throw runtime_error(
"Method not implemented!");
2315 throw runtime_error(
"Method not implemented!");
std::size_t pos() const noexcept
Implementation of gridded fields.
const Matrix & get_dense() const
const ArrayOfString & get_string_grid(Index i) const
Get a string grid.
virtual void checksize_strict() const =0
Strict consistency check.
void set_grid_name(Index i, const String &s)
Set grid name.
const Numeric & Mass() const
Mass of the isotopologue.
ConstVectorView RefTemperature() const
Get reference temperatures.
ArrayOfVector mtintersect
PropagationMatrix PropagationMatrix
Container class for Quantum Numbers.
const Index & Analytical() const
Returns the analytical tag.
Stokes vector is as Propagation matrix but only has 4 possible values.
void check_name(const String &expected_name)
Check tag name.
Class to identify and match lines by their quantum numbers.
const Sparse & get_sparse() const
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
const QuantumContainer & GetNumbers() const
Get the numbers.
PType PTypeFromString(const String &ptype_string)
Convert ptype name to enum value.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
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.
void chk_scat_data(const SingleScatteringData &scat_data_single, const Verbosity &verbosity)
Check single scattering data.
void ConvertAzimuthallyRandomSingleScatteringData(SingleScatteringData &ssd)
Convert azimuthally-random oriented SingleScatteringData to latest version.
const Vector & Energies() const noexcept
Energy level type.
const String & SubSubtag() const
Returns the sub-sub-tag.
const Tensor4 & Data() const noexcept
Energy level type.
Range get_column_range() const
std::vector< Block > correlations_
Verbosity verbosity(Workspace &ws) noexcept
String Name() const
Return the full name of the tag.
const ArrayOfVector & Xsecs() const
Get cross sections.
Index get_dim() const
Get the dimension of this gridded field.
void xml_parse_from_stream(istream &is_xml, ArrayOfString &astring, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &verbosity)
Parse ArrayOfString from XML input stream.
const ArrayOfVector & TemperatureIntersect() const
Get intersect of temperature fit.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
bool ReadFromStream(String &artsid, istream &is, Index nparams, const Verbosity &verbosity)
Read parameters from input stream (only for version 1 format).
void telsem_calc_correspondence()
MatrixType get_matrix_type() const
An Antenna object used by MCGeneral.
void xml_set_stream_precision(ostream &os)
invlib::Matrix< ArtsCovarianceMatrixWrapper > CovarianceMatrix
invlib wrapper type for ARTS the ARTS covariance class.
const Array< SpeciesRecord > species_data
Species Data.
void setParam(const Index species, const Index isotopologue, const AuxType auxtype, const ArrayOfGriddedField1 &auxdata)
Set parameter.
PType PType2FromString(const String &ptype_string)
Convert ptype name to enum value.
const ArrayOfGriddedField1 & getParam(const Index species, const Index isotopologue) const
Return a constant reference to the parameters.
void write_to_stream(ostream &os)
Write XML tag.
The structure to describe a propagation path and releated quantities.
Auxiliary data for isotopologues.
String energylevelmaptype2string(EnergyLevelMapType type)
void parse_xml_tag_content_as_string(std::istream &is_xml, String &content)
Get the content of an xml tag as a string.
An absorption lookup table.
constexpr Index get_start() const
Returns the start index of the range.
void SetFromString(String str)
Set from a String object.
Index nlibraries() const
Returns the number of libraries.
Implementation of Matrix, Vector, and such stuff.
const Index & HitranTag() const
HITRAN-96 tag numbers for all isotopologues.
GridType get_grid_type(Index i) const
Get grid type.
This file contains private function declarations and template instantiation to handle XML data files.
A tag group can consist of the sum of several of these.
std::vector< Block > inverses_
Index nelem(const Lines &l)
Number of lines.
const ArrayOfQuantumIdentifier & Levels() const noexcept
Energy level type.
Index species_index_from_species_name(String name)
Return species index for given species name.
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
PType
An attribute to classify the particle type (ptype) of a SingleScatteringData.
void ThrowIfNotOK() const
EnergyLevelMapType Type() const noexcept
Energy level type.
void read_from_stream(istream &is)
Reads next XML tag.
const String & MainTag() const
Returns the main tag.
ConstVectorView Coeffs() const
Get coefficients.
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
Index nelem() const
Returns the number of elements.
const Numeric & Abundance() const
Normal abundance ( = isotopologue ratio).
Vector t_ref
The reference temperature profile [K].
This file contains private function declarations and template instantiation to handle XML data files.
Range get_row_range() const
Ppath ppath(Workspace &ws) noexcept
Vector f_grid
The frequency grid [Hz].
Vector p_grid
The pressure grid for the table [Pa].
const String & Mode() const
Returns the mode.
const ArrayOfIndex & JplTags() const
JPL tag numbers for all isotopologues.
Routines for setting up the jacobian.
NUMERIC Numeric
The type to use for all floating point numbers.
void add_attribute(const String &aname, const String &value)
Adds a String attribute to tag.
Binary output file stream class.
Tensor4 & Data()
Get full view to data.
void set_name(const String &s)
Set name of this gridded field.
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
EnergyLevelMapType string2energylevelmaptype(const String &s)
const String & get_name() const
Get the name of this gridded field.
Tensor4 xsec
Absorption cross sections.
Index nisotopologues(const Index species) const
Returns number of isotopologues for a certain species.
ArrayOfGriddedField2 mdata
The data itself, directly from the HITRAN file.
Contains the lookup data for one species.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
constexpr Index get_extent() const
Returns the extent of the range.
Internal cloudbox functions.
String SpeciesName() const
Return species name.
void xml_read_from_stream(istream &is_xml, CIARecord &cr, bifstream *pbifs, const Verbosity &verbosity)
Reads CIARecord from XML input stream.
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
const String & Name() const
Isotopologue name.
Structure to store a grid position.
const Array< IsotopologueRecord > & Isotopologue() const
void set_grid(Index i, const Vector &g)
Set a numeric grid.
Contains the lookup data for one isotopologue.
const ArrayOfVector & Fgrids() const
Get frequency grids of cross sections.
const Index & MytranTag() const
MYTRAN2 tag numbers for all isotopologues.
const ArrayOfGriddedField2 & Data() const
Return CIA data.
const String & Name() const
const ArrayOfVector & TemperatureSlope() const
Get slope of temperature fit.
A 2D sequential linear interpolation (SLI) lookup table This class holds the gridded for 2D SLI as we...
CIA data for a single pair of molecules.
Header file for sparse matrices.
Index nspecies() const
Returns number of species.
void xml_write_to_stream(ostream &os_xml, const CIARecord &cr, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes CIARecord to XML output stream.
void InitFromSpeciesData()
void SetSpecies(const Index first, const Index second)
Set CIA species.
INDEX Index
The type to use for all integer numbers and indices.
IndexPair get_indices() const
const String & get_grid_name(Index i) const
Get grid name.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
String getTypeString(const Index species, const Index isotopologue) const
Return a parameter type as string.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
Matrix vmrs_ref
The reference VMR profiles.
String MoleculeName(const Index i) const
Return each molecule name (as a string) that is associated with this CIARecord.
Vector t_pert
The vector of temperature perturbations [K].
void set_name(const String &new_name)
Index nelem() const
Number of elements.
const String & Subtag() const
Returns the sub-tag.
StokesVector StokesVector
ConstVectorView RefPressure() const
Get reference pressures.
The global header file for ARTS.
Binary output file stream class.
const Numeric & Perturbation() const
Returns the size of perturbation.