Go to the documentation of this file.
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());
224 istringstream is(def);
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
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();
505 if (tg[i].
Species() != spec_ind) {
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;
657 num_free_electrons++;
658 has_free_electrons =
true;
662 has_particles =
true;
666 has_hitran_xsec =
true;
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 "
680 throw std::runtime_error(
681 "'particles' must not be combined "
682 "with other tags in the same group.");
685 throw std::runtime_error(
686 "'hitran_xsec' must not be combined "
687 "with other tags in the same group.");
725 for (
Index i = 0; i < tags1.
nelem() && !found; ++i) {
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());
752 for (
Index i=0; i<list_of_tags.
nelem(); i++) {
753 for (
Index j=0; j<list_of_tags[i].
nelem(); j++) {
754 if (list_of_tags[i][j] == tag) {
SpeciesTag()
Default constructor.
Declarations required for the calculation of absorption coefficients.
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.
String Name() const
Return the full name of the tag.
Index misotopologue
Isotopologue species index.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
const Array< SpeciesRecord > species_data
Species Data.
Numeric muf
The upper line center frequency in Hz.
Numeric SpeciesMass() const
Mass of main species.
A tag group can consist of the sum of several of these.
Index nelem(const Lines &l)
Number of lines.
Index species_index_from_species_name(String name)
Return species index for given species name.
String species_name_from_species_index(const Index spec_ind)
Return species name for given species index.
bool IsIsotopologue(const String &i) const
Check if the isotopologue is same as SpeciesTag(s).Isotopologue()
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Index mcia_dataset
CIA dataset index.
NUMERIC Numeric
The type to use for all floating point numbers.
void trim()
Trim leading and trailing whitespace.
Numeric mlf
The lower limit line center frequency in Hz.
Index mtype
Type of this tag.
Type
Type of line shape to compute.
Contains the lookup data for one species.
Index nelem() const
Number of elements.
const Array< IsotopologueRecord > & Isotopologue() const
String SpeciesNameMain() const
Name of main species.
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
const String & Name() const
Index mcia_second
2nd CIA species index.
bool IsSpecies(const String &s) const
Check if the species is same as SpeciesTag(s).Species()
Index mspecies
Molecular species index.
INDEX Index
The type to use for all integer numbers and indices.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
static const Index npos
Define npos:
Index Type() const
Return the type of this tag.
Index Species() const
Molecular species index.
Index nelem() const
Number of elements.
The global header file for ARTS.