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");
404 os_xml, gal.
vmrs_ref, pbofs,
"ReferenceVmrProfiles", verbosity);
406 os_xml, gal.
t_ref, pbofs,
"ReferenceTemperatureProfile", verbosity);
408 os_xml, gal.
t_pert, pbofs,
"TemperaturePerturbations", 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");
1083 os_xml, irecord.
Abundance(), pbofs,
"Abundance", verbosity);
1086 os_xml, irecord.
MytranTag(), pbofs,
"MytranTag", verbosity);
1088 os_xml, irecord.
HitranTag(), pbofs,
"HitranTag", verbosity);
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",
1177 os_xml, ppath.
pos, pbofs,
"PropagationPathPointPositions", verbosity);
1180 os_xml, ppath.
r, pbofs,
"PropagationPathPointRadii", verbosity);
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);
1192 os_xml, ppath.
ngroup, pbofs,
"GroupRefractiveIndex", 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");
1451 os_xml, rq.
Perturbation(), pbofs,
"Perturbation", verbosity);
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");
1835 os_xml, sad.
getParam(isp,
iso), pbofs,
"", verbosity);
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());
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";
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());
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++) {
2232 os_xml, xd.
RefPressure(), pbofs,
"refpressure", verbosity);
2234 os_xml, xd.
RefTemperature(), pbofs,
"reftemperature", verbosity);
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!");
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.
INDEX Index
The type to use for all integer numbers and indices.
void add_attribute(const String &aname, const String &value)
Adds a String attribute to tag.
const Index & MytranTag() const
MYTRAN2 tag numbers for all isotopologues.
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
String energylevelmaptype2string(EnergyLevelMapType type)
const ArrayOfVector & TemperatureSlope() const
Get slope of temperature fit.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
Range get_column_range() const
Numeric constant
The propagation path constant (only used for 1D)
const ArrayOfGriddedField2 & Data() const
Return CIA data.
const ArrayOfVector & Fgrids() const
Get frequency grids of cross sections.
void InitFromSpeciesData()
Index nelem() const
Number of elements.
invlib::Matrix< ArtsCovarianceMatrixWrapper > CovarianceMatrix
invlib wrapper type for ARTS the ARTS covariance class.
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
const Index & Analytical() const
Returns the analytical tag.
const Numeric & Mass() const
Mass of the isotopologue.
const Matrix & get_dense() const
Vector t_pert
The vector of temperature perturbations [K].
void read_from_stream(istream &is)
Reads next XML tag.
String Name() const
Return the full name of the tag.
Matrix los
Line-of-sight at each ppath point.
Routines for setting up the jacobian.
Vector end_pos
End position.
Index dim
Atmospheric dimensionality.
const Sparse & get_sparse() const
const ArrayOfString & get_string_grid(Index i) const
Get a string grid.
virtual void checksize_strict() const =0
Strict consistency check.
const Tensor4 & Data() const noexcept
Energy level type.
ArrayOfGriddedField2 mdata
The data itself, directly from the HITRAN file.
const String & SubSubtag() const
Returns the sub-sub-tag.
Vector lstep
The length between ppath points.
ConstVectorView RefPressure() const
Get reference pressures.
bool ReadFromStream(String &artsid, istream &is, Index nparams, const Verbosity &verbosity)
Read parameters from input stream (only for version 1 format).
GridType get_grid_type(Index i) const
Get grid type.
const Vector & Energies() const noexcept
Energy level type.
Matrix pos
The distance between start pos and the last position in pos.
This file contains private function declarations and template instantiation to handle XML data files...
Vector ngroup
The group index of refraction.
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
Vector start_pos
Start position.
Vector r
Radius of each ppath point.
Stokes vector is as Propagation matrix but only has 4 possible values.
constexpr Index get_start() const
Returns the start index of the range.
A 2D sequential linear interpolation (SLI) lookup table This class holds the gridded for 2D SLI as we...
void SetFromString(String str)
Set from a String object.
void ConvertAzimuthallyRandomSingleScatteringData(SingleScatteringData &ssd)
Convert azimuthally-random oriented SingleScatteringData to latest version.
Index nelem() const
Returns the number of elements.
const Index & HitranTag() const
HITRAN-96 tag numbers for all isotopologues.
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
void setParam(const Index species, const Index isotopologue, const AuxType auxtype, const ArrayOfGriddedField1 &auxdata)
Set parameter.
const Array< SpeciesRecord > species_data
Species Data.
Structure to store a grid position.
Numeric end_lstep
The distance between end pos and the first position in pos.
MatrixType get_matrix_type() const
Deals with internal derivatives, Jacobian definition, and OEM calculations.
const String & get_name() const
Get the name of this gridded field.
Index get_dim() const
Get the dimension of this gridded field.
Vector end_los
End line-of-sight.
ConstVectorView RefTemperature() const
Get reference temperatures.
const Array< IsotopologueRecord > & Isotopologue() const
Tensor4 xsec
Absorption cross sections.
ArrayOfVector mtintersect
void telsem_calc_correspondence()
The global header file for ARTS.
String background
Radiative background.
Matrix vmrs_ref
The reference VMR profiles.
const ArrayOfIndex & JplTags() const
JPL tag numbers for all isotopologues.
void xml_set_stream_precision(ostream &os)
Vector f_grid
The frequency grid [Hz].
EnergyLevelMapType Type() const noexcept
Energy level type.
Header file for sparse matrices.
void chk_scat_data(const SingleScatteringData &scat_data_single, const Verbosity &verbosity)
Check single scattering data.
_CS_string_type str() const
void ThrowIfNotOK() const
void set_name(const String &new_name)
const String & Mode() const
Returns the mode.
void set_grid(Index i, const Vector &g)
Set a numeric grid.
PType
An attribute to classify the particle type (ptype) of a SingleScatteringData.
constexpr Index get_extent() const
Returns the extent of the range.
Binary output file stream class.
PType PTypeFromString(const String &ptype_string)
Convert ptype name to enum value.
const ArrayOfQuantumIdentifier & Levels() const noexcept
Energy level type.
Contains the lookup data for one species.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Numeric start_lstep
Length between sensor and atmospheric boundary.
A tag group can consist of the sum of several of these.
const String & MainTag() const
Returns the main tag.
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.
Class to identify and match lines by their quantum numbers.
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
const ArrayOfGriddedField1 & getParam(const Index species, const Index isotopologue) const
Return a constant reference to the parameters.
NUMERIC Numeric
The type to use for all floating point numbers.
std::vector< Block > correlations_
Range get_row_range() const
Index nlibraries() const
Returns the number of libraries.
Vector nreal
The real part of the refractive index at each path position.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
Tensor4 & Data()
Get full view to data.
String getTypeString(const Index species, const Index isotopologue) const
Return a parameter type as string.
const String & Name() const
Index nspecies() const
Returns number of species.
An Antenna object used by MCGeneral.
Implementation of Matrix, Vector, and such stuff.
Index nisotopologues(const Index species) const
Returns number of isotopologues for a certain species.
Index species_index_from_species_name(String name)
Return species index for given species name.
Vector t_ref
The reference temperature profile [K].
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.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
Container class for Quantum Numbers.
void check_name(const String &expected_name)
Check tag name.
Vector p_grid
The pressure grid for the table [Pa].
This can be used to make arrays out of anything.
Contains the lookup data for one isotopologue.
const String & get_grid_name(Index i) const
Get grid name.
void SetSpecies(const Index first, const Index second)
Set CIA species.
basic_string< _CS_cT, _CS_traits, _CS_alloc > str() const
const QuantumContainer & GetNumbers() const
Get the numbers.
void xml_parse_from_stream(istream &is_xml, ArrayOfString &astring, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &verbosity)
Parse ArrayOfString from XML input stream.
Index np
Number of points describing the ppath.
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
void set_name(const String &s)
Set name of this gridded field.
String MoleculeName(const Index i) const
Return each molecule name (as a string) that is associated with this CIARecord.
Index nelem(const Lines &l)
Number of lines.
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
Binary output file stream class.
PType PType2FromString(const String &ptype_string)
Convert ptype name to enum value.
Vector start_los
Start line-of-sight.
void set_grid_name(Index i, const String &s)
Set grid name.
CIA data for a single pair of molecules.
Implementation of gridded fields.
void xml_read_from_stream(istream &is_xml, CIARecord &cr, bifstream *pbifs, const Verbosity &verbosity)
Reads CIARecord from XML input stream.
const ArrayOfVector & Xsecs() const
Get cross sections.
ConstVectorView Coeffs() const
Get coefficients.
The structure to describe a propagation path and releated quantities.
const Numeric & Abundance() const
Normal abundance ( = isotopologue ratio).
const String & Subtag() const
Returns the sub-tag.
Auxiliary data for isotopologues.
Internal cloudbox functions.
EnergyLevelMapType string2energylevelmaptype(const String &s)
String SpeciesName() const
Return species name.
const String & Name() const
Isotopologue name.
std::vector< Block > inverses_
IndexPair get_indices() const
This file contains private function declarations and template instantiation to handle XML data files...
const Numeric & Perturbation() const
Returns the size of perturbation.
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
const ArrayOfVector & TemperatureIntersect() const
Get intersect of temperature fit.
void write_to_stream(ostream &os)
Write XML tag.