66 name = def.substr(0, n);
85 if (name ==
"free_electrons") {
92 if (name ==
"particles") {
99 os <<
"Species \"" << name <<
"\" is not a valid species.";
100 throw runtime_error(os.
str());
106 if (0 == def.
nelem()) {
119 isoname = def.substr(0, n);
122 if (
"Z" == isoname) {
127 isoname = def.substr(0, n);
138 if (
"HXSEC" == isoname) {
143 isoname = def.substr(0, n);
159 if (
"Z" == isoname) {
166 if (
"HXSEC" == isoname) {
176 if (
"*" == isoname) {
185 else if (
"CIA" == isoname)
196 os <<
"Invalid species tag " << def_original <<
".\n" 197 <<
"I am missing a minus sign (and a dataset index after that.)";
198 throw runtime_error(os.
str());
201 String otherspec = def.substr(0, n);
208 os <<
"CIA species \"" << otherspec <<
"\" is not a valid species.";
209 throw runtime_error(os.
str());
216 if (!isdigit(def[
i])) {
218 os <<
"Invalid species tag " << def_original <<
".\n" 219 <<
"The tag should end with a dataset index";
220 throw runtime_error(os.
str());
231 for (
Index i = 0;
i < spr.Isotopologue().nelem(); ++
i)
232 ins.push_back(spr.Isotopologue()[
i].Name());
239 os <<
"Isotopologue " << isoname <<
" is not a valid isotopologue or " 240 <<
"absorption model for species " << name <<
".\n" 241 <<
"Valid options are:\n";
243 os << name <<
"-" << ins[
i] <<
"\n";
244 throw runtime_error(os.
str());
252 if (0 == def.
nelem()) {
260 if (def[0] !=
'*' && !isdigit(def[0])) {
262 os <<
"Expected frequency limits, but got \"" << def <<
"\"";
263 throw runtime_error(os.
str());
273 fname = def.substr(0, n);
280 }
else if (!isdigit(fname[0])) {
282 os <<
"Expected frequency limit, but got \"" << fname <<
"\"";
283 throw runtime_error(os.
str());
287 mlf = strtod(fname.c_str(), &endptr);
288 if (endptr != fname.c_str() + fname.
nelem()) {
290 os <<
"Error parsing frequency limit \"" << fname <<
"\"";
291 throw runtime_error(os.
str());
298 "You must either specify both frequency limits\n" 299 "(at least with jokers), or none.");
307 }
else if (!isdigit(def[0])) {
309 os <<
"Expected frequency limit, but got \"" << def <<
"\"";
310 throw runtime_error(os.
str());
314 muf = strtod(def.c_str(), &endptr);
315 if (endptr != def.c_str() + def.
nelem()) {
317 os <<
"Error parsing frequency limit \"" << def <<
"\"";
318 throw runtime_error(os.
str());
345 os << spr.
Name() <<
"-";
385 #error Numeric must be double or float 393 os << setprecision(precision);
401 os << setprecision(precision);
448 return os << ot.
Name();
468 for (i = 0; i < tg.
nelem() - 1; ++
i) {
469 name += tg[
i].Name() +
", ";
471 name += tg[
i].Name();
499 Index spec_ind = tg[0].Species();
507 os <<
"All tags in a tag group must belong to the same species!\n" 509 throw runtime_error(os.
str());
565 if (spec == tgs[
i][0].
Species())
return i;
593 String these_names = names;
596 Index n = these_names.find(
',');
597 if (n == these_names.
npos)
601 tag_def.push_back(these_names);
604 tag_def.push_back(these_names.substr(0, n));
605 these_names.erase(0, n + 1);
621 "Tags in a tag group must belong to the same species.");
630 "Zeeman tags and plain line-by-line tags must " 631 "not be mixed in the same tag group.");
634 tags.push_back(this_tag);
650 Index num_free_electrons = 0;
652 bool has_free_electrons =
false;
653 bool has_particles =
false;
654 bool has_hitran_xsec =
false;
655 for (
Index s = 0; s < abs_species[
i].
nelem(); ++s) {
657 num_free_electrons++;
658 has_free_electrons =
true;
662 has_particles =
true;
666 has_hitran_xsec =
true;
670 if (abs_species[
i].
nelem() > 1 && has_free_electrons)
671 throw std::runtime_error(
672 "'free_electrons' must not be combined " 673 "with other tags in the same group.");
674 if (num_free_electrons > 1)
675 throw std::runtime_error(
676 "'free_electrons' must not be defined " 679 if (abs_species[
i].
nelem() > 1 && has_particles)
680 throw std::runtime_error(
681 "'particles' must not be combined " 682 "with other tags in the same group.");
684 if (abs_species[
i].
nelem() > 1 && has_hitran_xsec)
685 throw std::runtime_error(
686 "'hitran_xsec' must not be combined " 687 "with other tags in the same group.");
731 if (tag2[j].
Name() != tags1[
i][j].Name()) ok =
false;
743 os <<
"The tag String \"" << tag2
744 <<
"\" does not match any of the given tags.\n";
745 throw runtime_error(os.
str());
754 if (list_of_tags[
i][j] == tag) {
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.
Index misotopologue
Isotopologue species index.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
SpeciesTag()
Default constructor.
Index nelem() const
Number of elements.
String Name() const
Return the full name of the tag.
Index Species() const
Molecular species index.
Index Type() const
Return the type of this tag.
const Array< SpeciesRecord > species_data
Species Data.
Numeric mlf
The lower limit line center frequency in Hz.
String species_name_from_species_index(const Index spec_ind)
Return species name for given species index.
const Array< IsotopologueRecord > & Isotopologue() const
The global header file for ARTS.
bool IsSpecies(const String &s) const
Check if the species is same as SpeciesTag(s).Species()
_CS_string_type str() const
Contains the lookup data for one species.
A tag group can consist of the sum of several of these.
NUMERIC Numeric
The type to use for all floating point numbers.
Numeric SpeciesMass() const
Mass of main species.
Index nelem() const
Number of elements.
const String & Name() const
Declarations required for the calculation of absorption coefficients.
bool IsIsotopologue(const String &i) const
Check if the isotopologue is same as SpeciesTag(s).Isotopologue()
Index mspecies
Molecular species index.
Numeric muf
The upper line center frequency in Hz.
Index species_index_from_species_name(String name)
Return species index for given species name.
void trim()
Trim leading and trailing whitespace.
Index mcia_dataset
CIA dataset index.
Index nelem(const Lines &l)
Number of lines.
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
Index mtype
Type of this tag.
static const Index npos
Define npos:
String SpeciesNameMain() const
Name of main species.
Index mcia_second
2nd CIA species index.