33 line_mixing_data.resize(abs_species.
nelem());
34 line_mixing_data_lut.resize(abs_species.
nelem());
52 if (abs_species.
nelem() != line_mixing_data.
nelem())
53 throw runtime_error(
"*line_mixing_data* doesn't match *abs_species*.\n" 54 "Make sure to call line_mixing_dataInit first." );
55 if (abs_species.
nelem() != line_mixing_data_lut.
nelem())
56 throw runtime_error(
"*line_mixing_data_lut* doesn't match *abs_species*.\n" 57 "Make sure to call line_mixing_dataInit first." );
62 Index species_index = -1;
63 for (
Index i = 0; species_index == -1 && i < abs_species.
nelem(); i++)
66 if (this_species == abs_species[i][0])
69 if (species_index == -1)
72 os <<
"Can't find tag \"" << species_tag <<
"\" in *abs_species*.";
73 throw runtime_error(os.str());
76 line_mixing_data[species_index] = line_mixing_records;
79 line_mixing_data_lut[species_index].resize(abs_lines_per_species[species_index].nelem());
80 line_mixing_data_lut[species_index] = -1;
85 for (
Index i = 0; i < line_mixing_data[species_index].nelem(); i++)
89 abs_lines_per_species[species_index],
96 out3 <<
" Found no matching lines for\n" << this_lmr.
Quantum() <<
"\n";
98 else if (matches.
nelem() == 1)
100 out3 <<
" Found matching line for\n" << this_lmr.
Quantum() <<
"\n";
101 line_mixing_data_lut[species_index][matches[0]] = i;
107 os <<
" Found multiple lines for\n" << this_lmr.
Quantum() << endl
108 <<
" Matching lines are: " << endl;
110 os <<
" " << abs_lines_per_species[species_index][matches[m]] << endl
111 <<
" " << abs_lines_per_species[species_index][matches[m]].
QuantumNumbers()
113 throw runtime_error(os.str());
117 out2 <<
" Matched " << nmatches <<
" lines out of " << line_mixing_data[species_index].nelem()
119 out2 <<
" abs_lines_per_species contains " << abs_lines_per_species[species_index].
nelem()
120 <<
" lines for " << species_tag <<
".\n";
134 line_mixing_records.resize(0);
148 || (line.
nelem() && line[0] ==
'#'))
157 is >> species_string;
163 is >> r; lmr.Quantum().SetLower(
QN_v1, r);
164 lmr.Quantum().SetUpper(
QN_v1, r);
165 is >> r; lmr.Quantum().SetUpper(
QN_N, r);
166 is >> r; lmr.Quantum().SetLower(
QN_N, r);
167 is >> r; lmr.Quantum().SetUpper(
QN_J, r);
168 is >> r; lmr.Quantum().SetLower(
QN_J, r);
170 vector<Numeric> temp_mixing_data;
173 while (is.good() && is)
179 temp_mixing_data.push_back(strtod(s.c_str(), &c));
180 if (c != s.c_str() + s.nelem())
181 throw runtime_error(line);
185 lmr.Data() = temp_mixing_data;
186 line_mixing_records.push_back(lmr);
187 }
catch (runtime_error e) {
190 os <<
"Error parsing line mixing file in line " << linenr << endl;
192 throw runtime_error(os.str());
197 out2 <<
" Read " << line_mixing_records.
nelem() <<
" lines from " << filename <<
".\n";
INDEX Index
The type to use for all integer numbers and indices.
void line_mixing_dataMatch(ArrayOfArrayOfLineMixingRecord &line_mixing_data, ArrayOfArrayOfIndex &line_mixing_data_lut, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &species_tag, const ArrayOfLineMixingRecord &line_mixing_records, const Verbosity &verbosity)
WORKSPACE METHOD: line_mixing_dataMatch.
void ArrayOfLineMixingRecordReadAscii(ArrayOfLineMixingRecord &line_mixing_records, const String &filename, const Verbosity &verbosity)
WORKSPACE METHOD: ArrayOfLineMixingRecordReadAscii.
Index nelem() const
Number of elements.
QuantumNumberRecord & Quantum()
Index Species() const
Molecular species index.
This file contains basic functions to handle ASCII files.
Index Isotopologue() const
The implementation for String, the ARTS string class.
The global header file for ARTS.
LineMixingRecord class for storing line mixing data.
A tag group can consist of the sum of several of these.
bool find_matching_lines(ArrayOfIndex &matches, const ArrayOfLineRecord &abs_lines, const Index species, const Index isotopologue, const QuantumNumberRecord qr, const LineMatchingCriteria match_criteria)
Find lines matching the given criteria.
Index nelem() const
Number of elements.
Declarations required for the calculation of absorption coefficients.
void trim()
Trim leading and trailing whitespace.
Container class for Quantum Numbers.
This can be used to make arrays out of anything.
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
void line_mixing_dataInit(ArrayOfArrayOfLineMixingRecord &line_mixing_data, ArrayOfArrayOfIndex &line_mixing_data_lut, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
WORKSPACE METHOD: line_mixing_dataInit.
Index Isotopologue() const
Isotopologue species index.