54 Species::Species species1;
55 Species::Species species2;
62 species1 = Species::fromShortName(molecule1);
63 species2 = Species::fromShortName(molecule2);
67 os <<
"Unknown species (1st molecule) in CIARecord: " << molecule1;
68 throw runtime_error(os.str());
72 os <<
"Unknown species (2nd molecule) in CIARecord: " << molecule2;
73 throw runtime_error(os.str());
125 Index n_blocks, row_start, row_extent, column_start, column_extent, row_index,
126 column_index, is_inverse;
133 for (
Index i = 0; i < n_blocks; i++) {
146 Range row_range(row_start, row_extent);
147 Range column_range(column_start, column_extent);
148 if (type ==
"Matrix") {
149 std::shared_ptr<Matrix>
M =
150 std::make_shared<Matrix>(row_extent, column_extent);
156 std::make_pair(row_index, column_index),
161 std::make_pair(row_index, column_index),
164 }
else if (type ==
"Sparse") {
165 std::shared_ptr<Sparse>
M =
166 std::make_shared<Sparse>(row_extent, column_extent);
172 std::make_pair(row_index, column_index),
177 std::make_pair(row_index, column_index),
206 covmat_tag.
set_name(
"CovarianceMatrix");
216 std::tie(i, j) =
c.get_indices();
220 Range row_range =
c.get_row_range();
221 Range column_range =
c.get_column_range();
247 std::tie(i, j) =
c.get_indices();
251 Range row_range =
c.get_row_range();
252 Range column_range =
c.get_column_range();
274 close_tag.
set_name(
"/CovarianceMatrix");
324 open_tag.
set_name(
"EnergyLevelMap");
333 close_tag.
set_name(
"/EnergyLevelMap");
394 os_xml, gal.
vmrs_ref, pbofs,
"ReferenceVmrProfiles", verbosity);
396 os_xml, gal.
t_ref, pbofs,
"ReferenceTemperatureProfile", verbosity);
398 os_xml, gal.
t_pert, pbofs,
"TemperaturePerturbations", verbosity);
402 "NonlinearSpeciesVmrPerturbations",
405 os_xml, gal.
xsec, pbofs,
"AbsorptionCrossSections", verbosity);
407 close_tag.
set_name(
"/GasAbsLookup");
438 }
else if (tag.
get_name() ==
"Array") {
453 "Grids must be of type *Vector* or *ArrayOfString*\n"
459 os <<
"Grids must be of type *Vector* or *ArrayOfString*\n"
460 <<
"but tag <" + tag.
get_name() +
"> found.";
461 if (tag.
get_name() ==
"ArrayOfString")
462 os <<
"\nCorrect XML tag for *ArrayOfString* is <Array type=\"String\" ...>.";
545 if (!name.length() && (gfield.
get_name().length()))
547 else if (name.length())
556 close_tag.
set_name(
"/GriddedField1");
607 if (!name.length() && (gfield.
get_name().length()))
609 else if (name.length())
618 close_tag.
set_name(
"/GriddedField2");
669 if (!name.length() && (gfield.
get_name().length()))
671 else if (name.length())
680 close_tag.
set_name(
"/GriddedField3");
731 if (!name.length() && (gfield.
get_name().length()))
733 else if (name.length())
742 close_tag.
set_name(
"/GriddedField4");
793 if (!name.length() && (gfield.
get_name().length()))
795 else if (name.length())
804 close_tag.
set_name(
"/GriddedField5");
855 if (!name.length() && (gfield.
get_name().length()))
857 else if (name.length())
866 close_tag.
set_name(
"/GriddedField6");
918 "OriginalGridIndexBelowInterpolationPoint",
921 os_xml, gpos.
fd[0], pbofs,
"FractionalDistanceToNextPoint_1", verbosity);
923 os_xml, gpos.
fd[1], pbofs,
"FractionalDistanceToNextPoint_2", verbosity);
967 tag.
check_name(
"/HitranRelaxationMatrixData");
985 open_tag.
set_name(
"HitranRelaxationMatrixData");
1009 close_tag.
set_name(
"/HitranRelaxationMatrixData");
1075 os_xml, ppath.
dim, pbofs,
"AtmosphericDimensionality", verbosity);
1077 os_xml, ppath.
np, pbofs,
"NumberOfPositionInPropagationPath", verbosity);
1079 os_xml, ppath.
constant, pbofs,
"PropagationPathConstant", verbosity);
1081 os_xml, ppath.
background, pbofs,
"RadiativeBackground", verbosity);
1085 "StartPositionOfPropagationPath",
1088 os_xml, ppath.
start_los, pbofs,
"StartLOSOfPropagationPath", verbosity);
1092 "StartLstepOfPropagationPath",
1095 os_xml, ppath.
pos, pbofs,
"PropagationPathPointPositions", verbosity);
1098 os_xml, ppath.
r, pbofs,
"PropagationPathPointRadii", verbosity);
1100 os_xml, ppath.
lstep, pbofs,
"PropagationPathPositionLength", verbosity);
1102 os_xml, ppath.
end_pos, pbofs,
"EndPositionOfPropagationPath", verbosity);
1104 os_xml, ppath.
end_los, pbofs,
"EndLOSOfPropagationPath", verbosity);
1106 os_xml, ppath.
end_lstep, pbofs,
"EndLstepPropagationPath", verbosity);
1108 os_xml, ppath.
nreal, pbofs,
"RefractiveIndexRealPart", verbosity);
1110 os_xml, ppath.
ngroup, pbofs,
"GroupRefractiveIndex", verbosity);
1112 os_xml, ppath.
gp_p, pbofs,
"PressureGridIndexPosition", verbosity);
1114 os_xml, ppath.
gp_lat, pbofs,
"LatitudeGridIndexPosition", verbosity);
1116 os_xml, ppath.
gp_lon, pbofs,
"LongitudeGridIndexPosition", verbosity);
1146 Index nstokes_needed =
d.ncols();
1148 pm.
Data() = std::move(
d);
1149 }
catch (
const std::runtime_error& e) {
1151 os <<
"Error reading PropagationMatrix: "
1154 throw runtime_error(os.str());
1176 open_tag.
set_name(
"PropagationMatrix");
1184 close_tag.
set_name(
"/PropagationMatrix");
1217 "The version of this quantum identifier is too new. You need to upgrade ARTS to use it.")
1223 }
catch (
const std::runtime_error& e) {
1225 os <<
"Error reading QuantumIdentifier: "
1228 throw runtime_error(os.str());
1252 open_tag.
set_name(
"QuantumIdentifier");
1259 close_tag.
set_name(
"/QuantumIdentifier");
1296 target, subtag, subsubtag, mode, target.
perturbation, grids);
1314 open_tag.
set_name(
"RetrievalQuantity");
1324 close_tag.
set_name(
"/RetrievalQuantity");
1348 if (version ==
"3") {
1352 }
else if (version ==
"2") {
1362 os <<
"Ptype value (" << ptype <<
") is wrong."
1366 <<
" - azimuthally randomly oriented particles, or\n"
1368 throw runtime_error(os.str());
1377 if ((ssdata.
za_grid[0] > 1) ||
1380 os <<
"Missing data in xml-stream. Expected za_grid: [0, 180]. "
1381 <<
"Found za_grid: [" << ssdata.
za_grid[0] <<
", "
1383 throw runtime_error(os.str());
1389 throw runtime_error(
1390 "Number of frequencies in f_grid and pha_mat_data "
1422 open_tag.
set_name(
"SingleScatteringData");
1439 close_tag.
set_name(
"/SingleScatteringData");
1463 if (version !=
"3") {
1465 os <<
"Only ScatteringMetaData version 3 can be handled. "
1466 <<
"Versions 1 and 2 are obsolete.";
1467 throw runtime_error(os.str());
1498 open_tag.
set_name(
"ScatteringMetaData");
1512 close_tag.
set_name(
"/ScatteringMetaData");
1575 ARTS_USER_ERROR_IF(pbifs,
"No support for binary IO for (SpeciesIsotopologueRatios)")
1594 if (is_xml.fail()) {
1597 <<
"\n Element: " << n;
1603 "Species: ", name,
" cannot be understood as a species by your compiled version of ARTS")
1605 iso_rat.
data[i] = val;
1609 tag.
check_name(
"/SpeciesIsotopologueRatios");
1626 ARTS_USER_ERROR_IF(pbofs,
"No support for binary IO for (SpeciesIsotopologueRatios)")
1631 open_tag.
set_name(
"SpeciesIsotopologueRatios");
1639 os_xml << iso_rat <<
'\n';
1641 close_tag.
set_name(
"/SpeciesIsotopologueRatios");
1668 bool string_starts_with_quotes =
true;
1679 string_starts_with_quotes =
false;
1681 }
while (is_xml.good() && dummy !=
'"' && string_starts_with_quotes);
1684 if (!string_starts_with_quotes) {
1688 is_xml.get(strbuf,
'"');
1689 if (is_xml.fail()) {
1722 os_xml <<
'\"' << stag.Name() <<
'\"';
1752 Index nstokes_needed =
d.ncols();
1753 sv =
StokesVector(nf, need2stokes<false>(nstokes_needed), nza, naa);
1754 sv.
Data() = std::move(
d);
1755 }
catch (
const std::runtime_error& e) {
1757 os <<
"Error reading StokesVector: "
1760 throw runtime_error(os.str());
1790 close_tag.
set_name(
"/StokesVector");
1860 close_tag.
set_name(
"/TelsemAtlas");
1890 const Species::Species species = Species::fromShortName(species_name);
1893 os <<
" Unknown species in XsecRecord: " << species_name;
1894 throw std::runtime_error(os.str());
1906 for (
const auto& fitcoeffs : xd.
FitCoeffs()) {
1907 const Index ncoeff = fitcoeffs.data.ncols();
1909 ncoeff != 4,
"Wrong number of coefficients, expected 4, found ", ncoeff)
1942 "Mininum pressures from fit",
1947 "Maximum pressures from fit",
1952 "Mininum temperatures from fit",
1957 "Maximum temperatures from fit",
1960 os_xml, xd.
FitCoeffs(), pbofs,
"Fit coefficients", verbosity);
1985 open_tag.
check_name(
"MapOfErrorCorrectedSuddenData");
1993 internal_open_tag.
check_name(
"ErrorCorrectedSuddenData");
2005 for (
Index j=0; j<nelem_specs; j++) {
2008 data[secds.
spec] = secds;
2013 internal_close_tag.
check_name(
"/ErrorCorrectedSuddenData");
2019 close_tag.
check_name(
"/MapOfErrorCorrectedSuddenData");
2022 for (
auto& x: rvb) {
2023 bool found_air=
false;
2024 for (
auto& y: x.data) {
2025 found_air = found_air or (y.spec == Species::Species::Bath);
2028 "Incomplete ErrorCorrectedSuddenData, must contain air, contains:\n",
2050 open_tag.
set_name(
"MapOfErrorCorrectedSuddenData");
2058 for (
auto& r: rvb) {
2060 internal_open_tag.
set_name(
"ErrorCorrectedSuddenData");
2067 os_xml << r <<
'\n';
2070 internal_close_tag.
set_name(
"/ErrorCorrectedSuddenData");
2075 close_tag.
set_name(
"/MapOfErrorCorrectedSuddenData");
2092 throw runtime_error(
"Method not implemented!");
2100 throw runtime_error(
"Method not implemented!");
2109 throw runtime_error(
"Method not implemented!");
2117 throw runtime_error(
"Method not implemented!");
2126 throw runtime_error(
"Method not implemented!");
2134 throw runtime_error(
"Method not implemented!");
2143 throw runtime_error(
"Method not implemented!");
2151 throw runtime_error(
"Method not implemented!");
2160 throw runtime_error(
"Method not implemented!");
2168 throw runtime_error(
"Method not implemented!");
The global header file for ARTS.
Index nelem() const ARTS_NOEXCEPT
Number of elements.
void add_attribute(const String &aname, const std::vector< QuantumNumberType > &value)
Adds value of attribute as type std::vector<QuantumNumberType> to tag.
void get_attribute_value(const String &aname, SpeciesTag &value)
Returns value of attribute as type SpeciesTag.
CIA data for a single pair of molecules.
void SetSpecies(const Species::Species first, const Species::Species second)
Set CIA species.
ArrayOfGriddedField2 mdata
The data itself, directly from the HITRAN file.
const ArrayOfGriddedField2 & Data() const
Return CIA data.
String MoleculeName(const Index i) const
Return each molecule name (as a string) that is associated with this CIARecord.
Index nlibraries() const noexcept
Index nelem() const noexcept
Returns the number of elements.
std::vector< Block > correlations_
std::vector< Block > inverses_
An absorption lookup table.
Vector p_grid
The pressure grid for the table [Pa].
Tensor4 xsec
Absorption cross sections.
Vector t_pert
The vector of temperature perturbations [K].
Vector f_grid
The frequency grid [Hz].
Matrix vmrs_ref
The reference VMR profiles.
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
Vector t_ref
The reference temperature profile [K].
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
const String & get_name() const
Get the name of this gridded field.
void set_name(const String &s)
Set name of this gridded field.
const ArrayOfString & get_string_grid(Index i) const
Get a string grid.
Index get_dim() const
Get the dimension of this gridded field.
void set_grid_name(Index i, const String &s)
Set grid name.
void set_grid(Index i, const Vector &g)
Set a numeric grid.
GridType get_grid_type(Index i) const
Get grid type.
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
const String & get_grid_name(Index i) const
Get grid name.
Tensor4 & Data()
Get full view to data.
constexpr Index get_extent() const noexcept
Returns the extent of the range.
constexpr Index get_start() const noexcept
Returns the start index of the range.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
const String & Mode() const
Returns the mode.
Jacobian::Target & Target()
Get the Jacobian Target.
const String & SubSubtag() const
Returns the sub-sub-tag.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
const String & Subtag() const
Returns the sub-tag.
A 2D sequential linear interpolation (SLI) lookup table This class holds the gridded for 2D SLI as we...
Stokes vector is as Propagation matrix but only has 4 possible values.
void telsem_calc_correspondence()
bool has_attribute(const String &aname) const
Returns if the attribute exists or not.
void write_to_stream(ostream &os)
Write XML tag.
void check_name(const String &expected_name)
Check tag name.
void read_from_stream(istream &is)
Reads next XML tag.
void get_attribute_value(const String &aname, String &value)
void set_name(const String &new_name)
Hitran crosssection class.
const Vector & FitMinPressures() const
Get mininum pressures from fit.
const Vector & FitMinTemperatures() const
Get mininum temperatures from fit.
String SpeciesName() const
Return species name.
void SetVersion(Index version)
Set species name.
Index Version() const
Return species index.
const Vector & FitMaxPressures() const
Get maximum pressures from fit.
const Vector & FitMaxTemperatures() const
Get maximum temperatures.
void SetSpecies(const Species::Species species)
Set species name.
const ArrayOfGriddedField2 & FitCoeffs() const
Get coefficients.
Binary output file stream class.
Binary output file stream class.
Input manipulator class for doubles to enable nan and inf parsing.
void chk_scat_data(const SingleScatteringData &scat_data_single, const Verbosity &verbosity)
Check single scattering data.
Internal cloudbox functions.
std::string var_string(Args &&... args)
#define ARTS_USER_ERROR_IF(condition,...)
EnergyLevelMapType toEnergyLevelMapTypeOrThrow(std::string_view s)
constexpr std::string_view toString(EnergyLevelMapType x) noexcept
constexpr bool good_enum(EnumType x) noexcept
Checks if the enum number is good.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
Index nelem(const Lines &l)
Number of lines.
constexpr Index find_species_index(const Species spec, const std::string_view isot) noexcept
invlib::Matrix< ArtsCovarianceMatrixWrapper > CovarianceMatrix
invlib wrapper type for ARTS the ARTS covariance class.
PType PType2FromString(const String &ptype_string)
Convert ptype name to enum value.
PType PTypeFromString(const String &ptype_string)
Convert ptype name to enum value.
void ConvertAzimuthallyRandomSingleScatteringData(SingleScatteringData &ssd)
Convert azimuthally-random oriented SingleScatteringData to latest version.
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
PType
An attribute to classify the particle type (ptype) of a SingleScatteringData.
Quantum::Number::GlobalState QuantumIdentifier
ArrayOfQuantumIdentifier levels
void ThrowIfNotOK() const ARTS_NOEXCEPT
Structure to store a grid position.
std::array< Numeric, 2 > fd
Holds all information required for individual partial derivatives.
Numeric perturbation
Perturbations for methods where theoretical computations are impossible or plain slow.
An Antenna object used by MCGeneral.
The structure to describe a propagation path and releated quantities.
Matrix los
Line-of-sight at each ppath point.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
String background
Radiative background.
Index np
Number of points describing the ppath.
Matrix pos
The distance between start pos and the last position in pos.
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Numeric end_lstep
The distance between end pos and the first position in pos.
Vector start_pos
Start position.
Vector lstep
The length between ppath points.
Numeric start_lstep
Length between sensor and atmospheric boundary.
Numeric constant
The propagation path constant (only used for 1D)
Vector r
Radius of each ppath point.
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Vector ngroup
The group index of refraction.
Index dim
Atmospheric dimensionality.
Vector end_pos
End position.
Vector start_los
Start line-of-sight.
Vector nreal
The real part of the refractive index at each path position.
Vector end_los
End line-of-sight.
A logical struct for global quantum numbers with species identifiers.
static constexpr Index version
std::array< Numeric, maxsize > data
static constexpr Index maxsize
void xml_data_parse_error(ArtsXMLTag &tag, String str_error)
Throws XML parser runtime error.
This file contains basic functions to handle XML data files.
void xml_parse_from_stream(istream &, Vector &, bifstream *, ArtsXMLTag &, const Verbosity &verbosity)
void parse_xml_tag_content_as_string(std::istream &is_xml, String &content)
Get the content of an xml tag as a string.
void xml_set_stream_precision(ostream &os)
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
void xml_read_from_stream(istream &is_xml, CIARecord &cr, bifstream *pbifs, const Verbosity &verbosity)
Reads CIARecord from XML input stream.
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.