85 name = def.substr(0,n);
106 if (name ==
"free_electrons")
114 if (name ==
"particles")
123 os <<
"Species \"" << name <<
"\" is not a valid species.";
124 throw runtime_error(os.str());
130 if ( 0 == def.
nelem() )
145 isoname = def.substr(0,n);
155 isoname = def.substr(0,n);
186 if (
"*" == isoname )
196 else if (
"CIA" == isoname )
208 os <<
"Invalid species tag " << def_original <<
".\n" 209 <<
"I am missing a minus sign (and a dataset index after that.)";
210 throw runtime_error(os.str());
213 String otherspec = def.substr(0,n);
222 os <<
"CIA species \"" << otherspec <<
"\" is not a valid species.";
223 throw runtime_error(os.str());
230 if (!isdigit(def[i])) {
232 os <<
"Invalid species tag " << def_original <<
".\n" 233 <<
"The tag should end with a dataset index";
234 throw runtime_error(os.str());
238 istringstream is(def);
247 for (
Index i=0; i<spr.Isotopologue().nelem(); ++i )
248 ins.push_back( spr.Isotopologue()[i].Name() );
256 os <<
"Isotopologue " << isoname <<
" is not a valid isotopologue or " 257 <<
"absorption model for species " << name <<
".\n" 258 <<
"Valid options are:\n";
260 os << name <<
"-" << ins[i] <<
"\n";
261 throw runtime_error(os.str());
266 if ( !isdigit(isoname[0]) )
270 if ( 0 == def.
nelem() )
281 if (def.substr(0, 2) ==
"LM")
286 String lmtype = def.substr(0, n);
287 if (lmtype ==
"LM_2NDORDER")
289 else if (lmtype ==
"LM_NONE")
294 os <<
"Unknown line mixing type \"" << lmtype <<
"\"";
295 throw runtime_error(os.str());
301 if (!def.
nelem())
return;
304 if (def[0] !=
'*' && !isdigit(def[0]))
307 os <<
"Expected frequency limits, but got \"" << def <<
"\"";
308 throw runtime_error(os.str());
319 fname = def.substr(0,n);
328 else if (!isdigit(fname[0]))
331 os <<
"Expected frequency limit, but got \"" << fname <<
"\"";
332 throw runtime_error(os.str());
338 mlf = strtod(fname.c_str(), &endptr);
339 if (endptr != fname.c_str() + fname.
nelem())
342 os <<
"Error parsing frequency limit \"" << fname <<
"\"";
343 throw runtime_error(os.str());
351 throw runtime_error(
"You must either specify both frequency limits\n" 352 "(at least with jokers), or none.");
363 else if (!isdigit(def[0]))
366 os <<
"Expected frequency limit, but got \"" << def <<
"\"";
367 throw runtime_error(os.str());
373 muf = strtod(def.c_str(), &endptr);
374 if (endptr != def.c_str() + def.
nelem())
377 os <<
"Error parsing frequency limit \"" << def <<
"\"";
378 throw runtime_error(os.str());
407 os << spr.
Name() <<
"-";
453 throw runtime_error(
"Invalid line mixing type. This is impossible.");
470 #error Numeric must be double or float 481 os << setprecision(precision);
492 os << setprecision(precision);
501 return os << ot.
Name();
522 for ( i=0; i<tg.
nelem()-1; ++i )
524 name += tg[i].Name() +
", ";
526 name += tg[i].Name();
555 Index spec_ind = tg[0].Species();
562 if (tg[i].
Species() != spec_ind)
565 os <<
"All tags in a tag group must belong to the same species!\n" 567 throw runtime_error( os.str() );
626 if ( spec == tgs[i][0].
Species() )
657 String these_names = names;
661 Index n = these_names.find(
',');
662 if ( n == these_names.
npos )
666 tag_def.push_back(these_names);
671 tag_def.push_back(these_names.substr(0,n));
672 these_names.erase(0,n+1);
689 throw runtime_error(
"Tags in a tag group must belong to the same species.");
700 throw runtime_error(
"Zeeman tags and plain line-by-line tags must " 701 "not be mixed in the same tag group.");
704 tags.push_back(this_tag);
722 Index num_free_electrons = 0;
725 bool has_free_electrons =
false;
726 bool has_particles =
false;
727 bool has_line_mixing =
false;
728 for (
Index s=0; s<abs_species[i].
nelem(); ++s )
732 num_free_electrons++;
733 has_free_electrons =
true;
738 has_particles =
true;
743 has_line_mixing =
true;
747 if (abs_species[i].nelem() > 1 && has_free_electrons)
748 throw runtime_error(
"'free_electrons' must not be combined " 749 "with other tags in the same group.");
750 if (num_free_electrons > 1)
751 throw runtime_error(
"'free_electrons' must not be defined " 754 if (abs_species[i].nelem() > 1 && has_particles)
755 throw runtime_error(
"'particles' must not be combined " 756 "with other tags in the same group.");
757 if (abs_species[i].nelem() > 1 && has_line_mixing)
758 throw runtime_error(
"Line mixing species must not be combined " 759 "with other tags in the same group.");
803 i<tgs1.
nelem() && !found;
813 if ( tg2[j].
Name() != tgs1[i][j].Name() )
828 os <<
"The tag String \"" << tg2 <<
829 "\" does not match any of the given tags.\n";
830 throw runtime_error(os.str());
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 mline_mixing_type
Line Mixing Type of this tag.
Index Species() const
Molecular species index.
Index Type() const
Return the type of this tag.
void spec(Array< SpeciesRecord >::iterator &is, Array< IsotopologueRecord >::iterator &ii, String name)
Define partition function coefficients lookup data.
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.
Contains the lookup data for one species.
A tag group can consist of the sum of several of these.
Index nelem() const
Number of elements.
const String & Name() const
Declarations required for the calculation of absorption coefficients.
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 mtype
Type of this tag.
static const Index npos
Define npos:
Index LineMixingType() const
Return the line mixing type of this tag.
Index mcia_second
2nd CIA species index.