ARTS  2.4.0(git:4fb77825)
m_absorptionlines.cc
Go to the documentation of this file.
1 /* Copyright (C) 2019
2  Richard Larsson <larsson@mps.mpg.de>
3 
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20  USA. */
21 
30 #include "absorptionlines.h"
31 #include "auto_md.h"
32 #include "file.h"
33 #include "global_data.h"
34 #include "xml_io_private.h"
35 #include "m_xml.h"
36 
40 
47 std::vector<QuantumNumberType> string2vecqn(const String& qnstr)
48 {
49  std::vector<QuantumNumberType> nums(0);
50 
51  String part;
52  if (qnstr not_eq "") {
53  std::istringstream str(qnstr);
54  while (not str.eof()) {
55  str >> part;
56  if (IsValidQuantumNumberName(part)) {
57  nums.push_back(string2quantumnumbertype(part));
58  } else {
59  std::ostringstream os;
60  os << "The quantum number key: \"" << part << "\" is invalid.\n";
61  throw std::runtime_error(os.str());
62  }
63  }
64  }
65 
66  return nums;
67 }
68 
69 /* Workspace method: Doxygen documentation will be auto-generated */
71  const String& artscat_file,
72  const Numeric& fmin,
73  const Numeric& fmax,
74  const String& globalquantumnumbers,
75  const String& localquantumnumbers,
76  const String& normalization_option,
77  const String& mirroring_option,
78  const String& population_option,
79  const String& lineshapetype_option,
80  const String& cutoff_option,
81  const Numeric& cutoff_value,
82  const Numeric& linemixinglimit_value,
83  const Verbosity& verbosity)
84 {
85  // Global numbers
86  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
87 
88  // Local numbers
89  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
90 
92 
93  ArtsXMLTag tag(verbosity);
94  Index nelem;
95 
96  // ARTSCAT data
97  shared_ptr<istream> ifs = nullptr;
98  xml_find_and_open_input_file(ifs, artscat_file, verbosity);
99  istream& is_xml = *ifs;
100  auto a = FILE_TYPE_ASCII;
101  auto b = NUMERIC_TYPE_DOUBLE;
102  auto c = ENDIAN_TYPE_LITTLE;
103  xml_read_header_from_stream(is_xml, a,b,c,
104  verbosity);
105 
106  tag.read_from_stream(is_xml);
107  tag.check_name("Array");
108 
109  Index num_arrays;
110  tag.get_attribute_value("nelem", num_arrays);
111 
112  std::vector<Absorption::SingleLineExternal> v(0);
113 
114  for (Index i=0; i<num_arrays; i++) {
115  tag.read_from_stream(is_xml);
116  tag.check_name("ArrayOfLineRecord");
117 
118  tag.get_attribute_value("nelem", nelem);
119 
120  String version;
121  tag.get_attribute_value("version", version);
122 
123  Index artscat_version;
124 
125  if (version == "3") {
126  artscat_version = 3;
127  } else if (version.substr(0, 8) != "ARTSCAT-") {
128  ostringstream os;
129  os << "The ARTS line file you are trying to read does not contain a valid version tag.\n"
130  << "Probably it was created with an older version of ARTS that used different units.";
131  throw runtime_error(os.str());
132  } else {
133  istringstream is(version.substr(8));
134  is >> artscat_version;
135  }
136 
137  if (artscat_version < 3 or artscat_version > 5) {
138  ostringstream os;
139  os << "Unknown ARTS line file version: " << version;
140  throw runtime_error(os.str());
141  }
142 
143  bool go_on = true;
144  Index n = 0;
145  while (go_on and n<nelem) {
146  switch(artscat_version) {
147  case 3:
148  v.push_back(Absorption::ReadFromArtscat3Stream(is_xml));
149  break;
150  case 4:
151  v.push_back(Absorption::ReadFromArtscat4Stream(is_xml));
152  break;
153  case 5:
154  v.push_back(Absorption::ReadFromArtscat5Stream(is_xml));
155  break;
156  default:
157  throw std::runtime_error("Bad version!");
158  }
159 
160  if (v.back().bad) {
161  v.pop_back();
162  go_on = false;
163  } else if (v.back().line.F0() < fmin) {
164  v.pop_back();
165  } else if (v.back().line.F0() > fmax) {
166  v.pop_back();
167  go_on = false;
168  }
169 
170  n++;
171  }
172 
173  tag.read_from_stream(is_xml);
174  tag.check_name("/ArrayOfLineRecord");
175  }
176 
177  tag.read_from_stream(is_xml);
178  tag.check_name("/Array");
179 
180  for (auto& x: v)
181  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
182 
183  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
184  abs_lines.resize(0);
185  abs_lines.reserve(x.size());
186  while (x.size()) {
187  abs_lines.push_back(x.back());
188  abs_lines.back().sort_by_frequency();
189  x.pop_back();
190  }
191 
192  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
193  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
194  abs_linesSetPopulation(abs_lines, population_option, verbosity);
195  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
196  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
197  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
198 }
199 
200 /* Workspace method: Doxygen documentation will be auto-generated */
202  const String& artscat_file,
203  const Numeric& fmin,
204  const Numeric& fmax,
205  const String& globalquantumnumbers,
206  const String& localquantumnumbers,
207  const String& normalization_option,
208  const String& mirroring_option,
209  const String& population_option,
210  const String& lineshapetype_option,
211  const String& cutoff_option,
212  const Numeric& cutoff_value,
213  const Numeric& linemixinglimit_value,
214  const Verbosity& verbosity)
215 {
216  // Global numbers
217  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
218 
219  // Local numbers
220  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
221 
222  CREATE_OUT2;
223 
224  ArtsXMLTag tag(verbosity);
225  Index nelem;
226 
227  // ARTSCAT data
228  shared_ptr<istream> ifs = nullptr;
229  xml_find_and_open_input_file(ifs, artscat_file, verbosity);
230  istream& is_xml = *ifs;
231  auto a = FILE_TYPE_ASCII;
232  auto b = NUMERIC_TYPE_DOUBLE;
233  auto c = ENDIAN_TYPE_LITTLE;
234  xml_read_header_from_stream(is_xml, a,b,c,
235  verbosity);
236 
237  tag.read_from_stream(is_xml);
238  tag.check_name("ArrayOfLineRecord");
239 
240  tag.get_attribute_value("nelem", nelem);
241 
242  String version;
243  tag.get_attribute_value("version", version);
244 
245  Index artscat_version;
246 
247  if (version == "3") {
248  artscat_version = 3;
249  } else if (version.substr(0, 8) != "ARTSCAT-") {
250  ostringstream os;
251  os << "The ARTS line file you are trying to read does not contain a valid version tag.\n"
252  << "Probably it was created with an older version of ARTS that used different units.";
253  throw runtime_error(os.str());
254  } else {
255  istringstream is(version.substr(8));
256  is >> artscat_version;
257  }
258 
259  if (artscat_version < 3 or artscat_version > 5) {
260  ostringstream os;
261  os << "Unknown ARTS line file version: " << version;
262  throw runtime_error(os.str());
263  }
264 
265  std::vector<Absorption::SingleLineExternal> v(0);
266 
267  bool go_on = true;
268  Index n = 0;
269  while (n<nelem) {
270  if (go_on) {
271  switch(artscat_version) {
272  case 3:
273  v.push_back(Absorption::ReadFromArtscat3Stream(is_xml));
274  break;
275  case 4:
276  v.push_back(Absorption::ReadFromArtscat4Stream(is_xml));
277  break;
278  case 5:
279  v.push_back(Absorption::ReadFromArtscat5Stream(is_xml));
280  break;
281  default:
282  throw std::runtime_error("Bad version!");
283  }
284 
285  if (v.back().bad) {
286  v.pop_back();
287  go_on = false;
288  } else if (v.back().line.F0() < fmin) {
289  v.pop_back();
290  } else if (v.back().line.F0() > fmax) {
291  v.pop_back();
292  go_on = false;
293  }
294  } else {
295  String line;
296  getline(is_xml, line);
297  }
298 
299  n++;
300  }
301 
302  tag.read_from_stream(is_xml);
303  tag.check_name("/ArrayOfLineRecord");
304 
305  for (auto& x: v)
306  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
307 
308  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
309  abs_lines.resize(0);
310  abs_lines.reserve(x.size());
311  while (x.size()) {
312  abs_lines.push_back(x.back());
313  abs_lines.back().sort_by_frequency();
314  x.pop_back();
315  }
316 
317  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
318  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
319  abs_linesSetPopulation(abs_lines, population_option, verbosity);
320  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
321  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
322  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
323 }
324 
325 /* Workspace method: Doxygen documentation will be auto-generated */
328  const String& basename,
329  const Numeric& fmin,
330  const Numeric& fmax,
331  const String& globalquantumnumbers,
332  const String& localquantumnumbers,
333  const Index& ignore_missing,
334  const String& normalization_option,
335  const String& mirroring_option,
336  const String& population_option,
337  const String& lineshapetype_option,
338  const String& cutoff_option,
339  const Numeric& cutoff_value,
340  const Numeric& linemixinglimit_value,
341  const Verbosity& verbosity)
342 {
344 
345  // Build a set of species indices. Duplicates are ignored.
346  std::set<Index> unique_species;
347  for (auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
348  for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
349  if (sp->Type() == SpeciesTag::TYPE_PLAIN || sp->Type() == SpeciesTag::TYPE_ZEEMAN) {
350  unique_species.insert(sp->Species());
351  }
352  }
353  }
354 
355  String tmpbasename = basename;
356  if (basename.length() && basename[basename.length() - 1] != '/') {
357  tmpbasename += '.';
358  }
359 
360  // Read catalogs for each identified species and put them all into
361  // abs_lines.
362  abs_lines.resize(0);
363  for (auto it = unique_species.begin(); it != unique_species.end(); it++) {
364  ArrayOfAbsorptionLines more_abs_lines;
365 
366  try {
367  ReadARTSCAT(more_abs_lines,
368  tmpbasename + (species_data[*it].Name()) + ".xml",
369  fmin,
370  fmax,
371  globalquantumnumbers,
372  localquantumnumbers,
373  normalization_option,
374  mirroring_option,
375  population_option,
376  lineshapetype_option,
377  cutoff_option,
378  cutoff_value,
379  linemixinglimit_value,
380  verbosity);
381 
382  // Either find a line like this in the list of lines or start a new Lines
383  for (auto& newband: more_abs_lines) {
384  bool found = false;
385  for (auto& band: abs_lines) {
386  if (band.Match(newband)) {
387  for (Index k=0; k<newband.NumLines(); k++) {
388  band.AppendSingleLine(newband.Line(k));
389  found = true;
390  }
391  }
392  }
393  if (not found) {
394  abs_lines.push_back(newband);
395  }
396  }
397  } catch (const std::exception& e) {
398  if (not ignore_missing) {
399  std::ostringstream os;
400  os << "Errors in calls by *propmat_clearskyAddZeeman*:\n";
401  os << e.what();
402  throw std::runtime_error(os.str());
403  } else {
404  continue;
405  }
406  }
407  }
408 
409  for (auto& band: abs_lines)
410  band.sort_by_frequency();
411 
412  if (normalization_option != "None")
413  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
414  if (mirroring_option != "None")
415  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
416  if (population_option != "None")
417  abs_linesSetPopulation(abs_lines, population_option, verbosity);
418  if (lineshapetype_option != "None")
419  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
420  if (cutoff_option != "None")
421  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
422  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
423 }
424 
425 enum class HitranType {
426  Pre2004,
427  Post2004,
428  Online,
429 };
430 
432  if (s == "Pre2004")
433  return HitranType::Pre2004;
434  else if (s == "Post2004")
435  return HitranType::Post2004;
436  else if (s == "Online")
437  return HitranType::Online;
438  else {
439  std::ostringstream os;
440  os << "The type \"" << s << "\" is an invalid hitran type\n";
441  throw std::runtime_error(os.str());
442  }
443 }
444 
445 /* Workspace method: Doxygen documentation will be auto-generated */
447  const String& hitran_file,
448  const Numeric& fmin,
449  const Numeric& fmax,
450  const String& globalquantumnumbers,
451  const String& localquantumnumbers,
452  const String& hitran_type,
453  const String& normalization_option,
454  const String& mirroring_option,
455  const String& population_option,
456  const String& lineshapetype_option,
457  const String& cutoff_option,
458  const Numeric& cutoff_value,
459  const Numeric& linemixinglimit_value,
460  const Verbosity& verbosity)
461 {
462  // Global numbers
463  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
464 
465  // Local numbers
466  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
467 
468  // HITRAN type
469  const auto hitran_version = string2hitrantype(hitran_type);
470 
471  // Hitran data
472  ifstream is;
473  open_input_file(is, hitran_file);
474 
475  std::vector<Absorption::SingleLineExternal> v(0);
476 
477  bool go_on = true;
478  while (go_on) {
479  switch (hitran_version) {
480  case HitranType::Post2004:
481  v.push_back(Absorption::ReadFromHitran2004Stream(is));
482  break;
483  case HitranType::Pre2004:
484  v.push_back(Absorption::ReadFromHitran2001Stream(is));
485  break;
486  case HitranType::Online:
488  break;
489  default:
490  throw std::runtime_error("A bad developer did not throw in time to stop this message.\nThe HitranType enum class has to be fully updated!\n");
491  }
492 
493  if (v.back().bad) {
494  v.pop_back();
495  go_on = false;
496  } else if (v.back().line.F0() < fmin) {
497  v.pop_back();
498  } else if (v.back().line.F0() > fmax) {
499  v.pop_back();
500  go_on = false;
501  }
502  }
503 
504  for (auto& x: v)
505  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
506 
507  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
508  abs_lines.resize(0);
509  abs_lines.reserve(x.size());
510  while (x.size()) {
511  abs_lines.push_back(x.back());
512  abs_lines.back().sort_by_frequency();
513  x.pop_back();
514  }
515 
516  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
517  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
518  abs_linesSetPopulation(abs_lines, population_option, verbosity);
519  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
520  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
521  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
522 }
523 
524 /* Workspace method: Doxygen documentation will be auto-generated */
526  const String& lblrtm_file,
527  const Numeric& fmin,
528  const Numeric& fmax,
529  const String& globalquantumnumbers,
530  const String& localquantumnumbers,
531  const String& normalization_option,
532  const String& mirroring_option,
533  const String& population_option,
534  const String& lineshapetype_option,
535  const String& cutoff_option,
536  const Numeric& cutoff_value,
537  const Numeric& linemixinglimit_value,
538  const Verbosity& verbosity)
539 {
540  // Global numbers
541  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
542 
543  // Local numbers
544  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
545 
546  // LBLRTM data
547  ifstream is;
548  open_input_file(is, lblrtm_file);
549 
550  std::vector<Absorption::SingleLineExternal> v(0);
551 
552  bool go_on = true;
553  while (go_on) {
554  v.push_back(Absorption::ReadFromLBLRTMStream(is));
555 
556  if (v.back().bad) {
557  v.pop_back();
558  go_on = false;
559  } else if (v.back().line.F0() < fmin) {
560  v.pop_back();
561  } else if (v.back().line.F0() > fmax) {
562  v.pop_back();
563  go_on = false;
564  }
565  }
566 
567  for (auto& x: v)
568  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
569 
570  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
571  abs_lines.resize(0);
572  abs_lines.reserve(x.size());
573  while (x.size()) {
574  abs_lines.push_back(x.back());
575  abs_lines.back().sort_by_frequency();
576  x.pop_back();
577  }
578 
579  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
580  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
581  abs_linesSetPopulation(abs_lines, population_option, verbosity);
582  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
583  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
584  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
585 }
586 
587 /* Workspace method: Doxygen documentation will be auto-generated */
589  const String& mytran2_file,
590  const Numeric& fmin,
591  const Numeric& fmax,
592  const String& globalquantumnumbers,
593  const String& localquantumnumbers,
594  const String& normalization_option,
595  const String& mirroring_option,
596  const String& population_option,
597  const String& lineshapetype_option,
598  const String& cutoff_option,
599  const Numeric& cutoff_value,
600  const Numeric& linemixinglimit_value,
601  const Verbosity& verbosity)
602 {
603  // Global numbers
604  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
605 
606  // Local numbers
607  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
608 
609  // LBLRTM data
610  ifstream is;
611  open_input_file(is, mytran2_file);
612 
613  std::vector<Absorption::SingleLineExternal> v(0);
614 
615  bool go_on = true;
616  while (go_on) {
617  v.push_back(Absorption::ReadFromMytran2Stream(is));
618 
619  if (v.back().bad) {
620  v.pop_back();
621  go_on = false;
622  } else if (v.back().line.F0() < fmin) {
623  v.pop_back();
624  } else if (v.back().line.F0() > fmax) {
625  v.pop_back();
626  go_on = false;
627  }
628  }
629 
630  for (auto& x: v)
631  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
632 
633  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
634  abs_lines.resize(0);
635  abs_lines.reserve(x.size());
636  while (x.size()) {
637  abs_lines.push_back(x.back());
638  abs_lines.back().sort_by_frequency();
639  x.pop_back();
640  }
641 
642  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
643  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
644  abs_linesSetPopulation(abs_lines, population_option, verbosity);
645  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
646  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
647  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
648 }
649 
650 /* Workspace method: Doxygen documentation will be auto-generated */
652  const String& jpl_file,
653  const Numeric& fmin,
654  const Numeric& fmax,
655  const String& globalquantumnumbers,
656  const String& localquantumnumbers,
657  const String& normalization_option,
658  const String& mirroring_option,
659  const String& population_option,
660  const String& lineshapetype_option,
661  const String& cutoff_option,
662  const Numeric& cutoff_value,
663  const Numeric& linemixinglimit_value,
664  const Verbosity& verbosity)
665 {
666  // Global numbers
667  const std::vector<QuantumNumberType> global_nums = string2vecqn(globalquantumnumbers);
668 
669  // Local numbers
670  const std::vector<QuantumNumberType> local_nums = string2vecqn(localquantumnumbers);
671 
672  // LBLRTM data
673  ifstream is;
674  open_input_file(is, jpl_file);
675 
676  std::vector<Absorption::SingleLineExternal> v(0);
677 
678  bool go_on = true;
679  while (go_on) {
680  v.push_back(Absorption::ReadFromJplStream(is));
681 
682  if (v.back().bad) {
683  v.pop_back();
684  go_on = false;
685  } else if (v.back().line.F0() < fmin) {
686  v.pop_back();
687  } else if (v.back().line.F0() > fmax) {
688  v.pop_back();
689  go_on = false;
690  }
691  }
692 
693  for (auto& x: v)
694  x.line.Zeeman() = Zeeman::GetAdvancedModel(x.quantumidentity);
695 
696  auto x = Absorption::split_list_of_external_lines(v, local_nums, global_nums);
697  abs_lines.resize(0);
698  abs_lines.reserve(x.size());
699  while (x.size()) {
700  abs_lines.push_back(x.back());
701  abs_lines.back().sort_by_frequency();
702  x.pop_back();
703  }
704 
705  abs_linesSetNormalization(abs_lines, normalization_option, verbosity);
706  abs_linesSetMirroring(abs_lines, mirroring_option, verbosity);
707  abs_linesSetPopulation(abs_lines, population_option, verbosity);
708  abs_linesSetLineShapeType(abs_lines, lineshapetype_option, verbosity);
709  abs_linesSetCutoff(abs_lines, cutoff_option, cutoff_value, verbosity);
710  abs_linesSetLinemixingLimit(abs_lines, linemixinglimit_value, verbosity);
711 }
712 
716 
717 /* Workspace method: Doxygen documentation will be auto-generated */
718 void abs_linesWriteSplitXML(const String& output_format,
720  const String& basename,
721  const Verbosity& verbosity)
722 {
723  std::map<String, int> names;
724 
725  String true_basename = basename;
726  if (not(true_basename.back() == '.' or true_basename.back() == '/'))
727  true_basename += '.';
728 
729  for (auto& lines : abs_lines) {
730  auto name = lines.SpeciesName();
731  const String fname = true_basename + name;
732 
733  WriteXML(output_format, lines,
734  fname + '.' + std::to_string(names[name]++) + ".xml",
735  0, "", "", "", verbosity);
736  }
737 }
738 
739 /* Workspace method: Doxygen documentation will be auto-generated */
740 void abs_linesWriteSpeciesSplitXML(const String& output_format,
742  const String& basename,
743  const Verbosity& verbosity)
744 {
745  // Set the true name of the saving
746  String true_basename = basename;
747  if (not(true_basename.back() == '.' or true_basename.back() == '/'))
748  true_basename += '.';
749 
750  // Find all species
751  ArrayOfString specs(0);
752  for (auto& band: abs_lines) {
753  auto specname = band.SpeciesName();
754 
755  bool any = false;
756  for (auto& thisname: specs) {
757  if (any) break;
758  else if (thisname == specname) any = true;
759  }
760 
761  if (not any)
762  specs.push_back(specname);
763  }
764 
765  // Make all species into a species tag array
766  Index throwaway;
768  abs_speciesSet(as, throwaway, throwaway, specs, verbosity);
769 
770  // Split lines by species
773 
774  // Save the arrays
775  for (Index i=0; i<specs.nelem(); i++) {
776  auto& name = specs[i];
777  auto& lines = alps[i];
778 
779  WriteXML(output_format, lines,
780  true_basename + name + ".xml",
781  0, "", "", "", verbosity);
782  }
783 }
784 
785 /* Workspace method: Doxygen documentation will be auto-generated */
786 void abs_lines_per_speciesWriteSplitXML(const String& output_format,
788  const String& basename,
789  const Verbosity& verbosity)
790 {
791  std::map<String, int> names;
792 
793  String true_basename = basename;
794  if (not(true_basename.back() == '.' or true_basename.back() == '/'))
795  true_basename += '.';
796 
797  for (auto& spec_lines : abs_lines_per_species) {
798  for (auto& lines : spec_lines) {
799  auto name = lines.SpeciesName();
800  const String fname = true_basename + name;
801 
802  WriteXML(output_format, lines,
803  fname + '.' + std::to_string(names[name]++) + ".xml",
804  0, "", "", "", verbosity);
805  }
806  }
807 }
808 
809 /* Workspace method: Doxygen documentation will be auto-generated */
812  const String& basename,
813  const Verbosity& verbosity)
814 {
815  // Compact to abs_lines
817  for (auto& lines: abs_lines_per_species) {
818  for (auto& band: lines) {
819  abs_lines.push_back(band);
820  }
821  }
822 
823  // Save using the other function
824  abs_linesWriteSpeciesSplitXML(output_format, abs_lines, basename, verbosity);
825 }
826 
827 /* Workspace method: Doxygen documentation will be auto-generated */
830  const String& basename,
831  const Verbosity& verbosity)
832 {
834 
835  // Build a set of species indices. Duplicates are ignored.
836  std::set<Index> unique_species;
837  for (auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
838  for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
839  if (sp->Type() == SpeciesTag::TYPE_PLAIN || sp->Type() == SpeciesTag::TYPE_ZEEMAN) {
840  unique_species.insert(sp->Species());
841  }
842  }
843  }
844 
845  String tmpbasename = basename;
846  if (basename.length() && basename[basename.length() - 1] != '/') {
847  tmpbasename += '.';
848  }
849 
850  // Read catalogs for each identified species and put them all into
851  // abs_lines
853  for (auto it = unique_species.begin(); it != unique_species.end(); it++) {
854  for (Index k=0; k<species_data[*it].Isotopologue().nelem(); k++) {
855  String filename;
856  Index i = 0;
857  do {
858  filename = tmpbasename + species_data[*it].FullName(k) + '.' + std::to_string(i) + ".xml";
859  if (find_xml_file_existence(filename)) {
860  abs_lines.push_back(AbsorptionLines());
861  xml_read_from_file(filename, abs_lines.back(), verbosity);
862  i++;
863  } else {
864  break;
865  }
866  } while (true);
867  }
868  }
869 
871 }
872 
873 /* Workspace method: Doxygen documentation will be auto-generated */
875  const String& basename,
876  const Index& robust,
877  const Verbosity& verbosity)
878 {
880 
881  CREATE_OUT3;
882  std::size_t bands_found{0};
883 
884  String tmpbasename = basename;
885  if (basename.length() && basename[basename.length() - 1] != '/') {
886  tmpbasename += '.';
887  }
888 
889  // Read catalogs for each identified species and put them all into
890  // abs_lines
891  abs_lines.resize(0);
892  for (auto it = species_data.begin(); it != species_data.end(); it++) {
893  for (Index k=0; k<(*it).Isotopologue().nelem(); k++) {
894  String filename;
895  filename = tmpbasename + (*it).FullName(k) + ".xml";
896  if (find_xml_file_existence(filename)) {
897  ArrayOfAbsorptionLines speclines;
898  xml_read_from_file(filename, speclines, verbosity);
899  for (auto& band: speclines) {
900  abs_lines.push_back(band);
901  bands_found++;
902  }
903  }
904  }
905  }
906 
907  if (not bands_found and not robust)
908  throw std::runtime_error("Cannot find any bands in the directory you are reading");
909  else
910  out3 << "Found " << bands_found << " bands\n";
911 }
912 
913 /* Workspace method: Doxygen documentation will be auto-generated */
916  const String& basename,
917  const Index& robust,
918  const Verbosity& verbosity)
919 {
921 
922  CREATE_OUT3;
923  std::size_t bands_found{0};
924 
925  // Build a set of species indices. Duplicates are ignored.
926  std::set<Index> unique_species;
927  for (auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
928  for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
929  if (sp->Type() == SpeciesTag::TYPE_PLAIN || sp->Type() == SpeciesTag::TYPE_ZEEMAN) {
930  unique_species.insert(sp->Species());
931  }
932  }
933  }
934 
935  String tmpbasename = basename;
936  if (basename.length() && basename[basename.length() - 1] != '/') {
937  tmpbasename += '.';
938  }
939 
940  // Read catalogs for each identified species and put them all into
941  // abs_lines
943  for (auto it = unique_species.begin(); it != unique_species.end(); it++) {
944  for (Index k=0; k<species_data[*it].Isotopologue().nelem(); k++) {
945  String filename;
946  filename = tmpbasename + species_data[*it].FullName(k) + ".xml";
947  if (find_xml_file_existence(filename)) {
948  ArrayOfAbsorptionLines speclines;
949  xml_read_from_file(filename, speclines, verbosity);
950  for (auto& band: speclines) {
951  abs_lines.push_back(band);
952  bands_found++;
953  }
954  }
955  }
956  }
957 
958  if (not bands_found and not robust)
959  throw std::runtime_error("Cannot find any bands in the directory you are reading");
960  else
961  out3 << "Found " << bands_found << " bands\n";
962 
964 }
965 
969 
970 /* Workspace method: Doxygen documentation will be auto-generated */
972  const String& qn,
973  const Rational& x,
974  const QuantumIdentifier& QI,
975  const Verbosity&)
976 {
977  auto QN = string2quantumnumbertype(qn);
978  if (QN == QuantumNumberType::FINAL_ENTRY) {
979  ostringstream os;
980  os << "Usupported quantum number key: " << qn << '\n';
981  throw std::runtime_error(os.str());
982  }
983 
984  for (auto& band: abs_lines) {
985  for (Index k=0; k<band.NumLines(); k++) {
986  if (Absorption::id_in_line_lower(band, QI, k)) {
987  band.LowerQuantumNumber(k, QN) = x;
988  } else if (Absorption::id_in_line_upper(band, QI, k)) {
989  band.UpperQuantumNumber(k, QN) = x;
990  }
991  }
992  }
993 }
994 
995 /* Workspace method: Doxygen documentation will be auto-generated */
997  const String& qn,
998  const Rational& x,
999  const QuantumIdentifier& QI,
1000  const Verbosity& v)
1001 {
1002  for (auto& band: abs_lines_per_species)
1003  abs_linesSetQuantumNumberForMatch(band, qn, x, QI, v);
1004 }
1005 
1006 /* Workspace method: Doxygen documentation will be auto-generated */
1008  const Verbosity&)
1009 {
1011 
1012  for (auto& lines: abs_lines) {
1013  lines.truncate_global_quantum_numbers();
1014 
1015  Index match = -1;
1016  for (Index ind=0; ind<x.nelem(); ind++) {
1017  if (x[ind].Match(lines)) {
1018  match = ind;
1019  break;
1020  }
1021  }
1022 
1023  if (match < 0)
1024  x.push_back(lines);
1025  else {
1026  for (auto& line: lines.AllLines())
1027  x[match].AppendSingleLine(line);
1028  }
1029  }
1030 
1031  abs_lines = std::move(x);
1032  for (auto& lines: abs_lines)
1033  lines.sort_by_frequency();
1034 }
1035 
1036 /* Workspace method: Doxygen documentation will be auto-generated */
1038  const Verbosity&)
1039 {
1040  for (auto& lines: abs_lines) {
1041  lines.RemoveUnusedLocalQuantums();
1042  }
1043 }
1044 
1048 
1049 /* Workspace method: Doxygen documentation will be auto-generated */
1051 {
1052  for (auto& rlines: replacing_lines) {
1053  Index number_of_matching_bands = 0;
1054  for (auto& tlines: abs_lines) {
1055  if (tlines.Match(rlines)) {
1056  number_of_matching_bands++;
1057  for (auto& rline: rlines.AllLines()) {
1058  Index number_of_matching_single_lines = 0;
1059  for (auto& tline: tlines.AllLines()) {
1060  if (tline.SameQuantumNumbers(rline)) {
1061  number_of_matching_single_lines++;
1062  tline = rline;
1063  }
1064  }
1065 
1066  if (number_of_matching_single_lines not_eq 1) {
1067  throw std::runtime_error("Error: Did not match to a single single line. This means the input data has not been understood. This function needs exactly one match.");
1068  }
1069  }
1070  tlines.sort_by_frequency();
1071  }
1072  }
1073 
1074  if (number_of_matching_bands not_eq 1) {
1075  throw std::runtime_error("Error: Did not match to a single set of absorption lines. This means the input data has not been understood. This function needs exactly one match.");
1076  }
1077  }
1078 }
1079 
1080 /* Workspace method: Doxygen documentation will be auto-generated */
1082 {
1083  if (safe) {
1084  std::vector<AbsorptionLines> addedlines(0);
1085 
1086  for (auto& alines: appending_lines) {
1087  Index number_of_matching_bands = 0;
1088  for (auto& tlines: abs_lines) {
1089  if (tlines.Match(alines)) {
1090  number_of_matching_bands++;
1091  for (auto& aline: alines.AllLines()) {
1092  Index number_of_matching_single_lines = 0;
1093  for (auto& tline: tlines.AllLines()) {
1094  if (tline.SameQuantumNumbers(aline)) {
1095  number_of_matching_single_lines++;
1096  }
1097  }
1098  if (number_of_matching_single_lines not_eq 0) {
1099  throw std::runtime_error("Error: Did match to a single single line. This means the input data has not been understood. This function needs exactly zero matches.");
1100  }
1101  tlines.AppendSingleLine(aline);
1102  }
1103  tlines.sort_by_frequency();
1104  }
1105  }
1106 
1107  if (number_of_matching_bands == 0)
1108  addedlines.push_back(alines);
1109  else if (number_of_matching_bands not_eq 1) {
1110  throw std::runtime_error("Error: Did not match to a single set of absorption lines. This means the input data has not been understood. This function needs exactly one or zero matches.");
1111  }
1112  }
1113 
1114  for (auto& lines: addedlines) {
1115  abs_lines.push_back(std::move(lines));
1116  }
1117  } else {
1118  for (auto& band: appending_lines)
1119  abs_lines.push_back(band);
1120  }
1121 }
1122 
1123 /* Workspace method: Doxygen documentation will be auto-generated */
1125 {
1126  for (auto& lines: abs_lines) {
1127  std::vector<Index> hits;
1128  for (Index i=0; i<lines.NumLines(); i++) {
1129  if (lower and lines.F0(i) < f0)
1130  hits.push_back(i);
1131  else if (not lower and lines.F0(i) > f0)
1132  hits.push_back(i);
1133  }
1134 
1135  // Remove the bad values (sort by descending firs)
1136  std::sort(hits.begin(), hits.end());
1137  while(not hits.empty()) {
1138  lines.RemoveLine(hits.back());
1139  hits.pop_back();
1140  }
1141  }
1142 }
1143 
1144 /* Workspace method: Doxygen documentation will be auto-generated */
1146 {
1147  for (auto& dlines: deleting_lines) {
1148  for (auto& tlines: abs_lines) {
1149  std::vector<Index> hits(0);
1150 
1151  if (tlines.Match(dlines)) {
1152  for (auto& dline: dlines.AllLines()) {
1153  for (Index i=0; i<tlines.NumLines(); i++) {
1154  if (tlines.AllLines()[i].SameQuantumNumbers(dline)) {
1155  hits.push_back(i);
1156  }
1157  }
1158  }
1159 
1160  // Sort and test the input
1161  std::sort(hits.begin(), hits.end());
1162  auto n = hits.size();
1163  hits.erase(std::unique(hits.begin(), hits.end()), hits.end());
1164  if(n not_eq hits.size()) {
1165  throw std::runtime_error("Removing the same line more than once is not accepted");
1166  }
1167 
1168  // Remove the bad values
1169  while(not hits.empty()) {
1170  tlines.RemoveLine(hits.back());
1171  hits.pop_back();
1172  }
1173  }
1174  }
1175  }
1176 }
1177 
1178 /* Workspace method: Doxygen documentation will be auto-generated */
1180 {
1181  CREATE_OUT2;
1182  Index i = 0;
1183 
1184  for (auto& band: abs_lines) {
1185  std::vector<Index> deleters(0);
1186 
1187  for (Index iline=0; iline<band.NumLines(); iline++) {
1188  if (std::any_of(band.Line(iline).LowerQuantumNumbers().cbegin(),
1189  band.Line(iline).LowerQuantumNumbers().cend(),
1190  [](auto x) -> bool {return x.isUndefined();}) or
1191  std::any_of(band.Line(iline).UpperQuantumNumbers().cbegin(),
1192  band.Line(iline).UpperQuantumNumbers().cend(),
1193  [](auto x) -> bool {return x.isUndefined();})) {
1194  deleters.push_back(iline);
1195  }
1196  }
1197 
1198  while (deleters.size()) {
1199  band.RemoveLine(deleters.back());
1200  deleters.pop_back();
1201  i++;
1202  }
1203  }
1204 
1205  out2 << "Deleted " << i << " lines.\n";
1206 }
1207 
1208 /* Workspace method: Doxygen documentation will be auto-generated */
1210 {
1211  CREATE_OUT2;
1212  Index i = 0;
1213 
1214  for (auto& band: abs_lines) {
1215  std::vector<Index> deleters(0);
1216 
1217  for (Index iline=0; iline<band.NumLines(); iline++) {
1218  auto Jlo = band.LowerQuantumNumber(iline, QuantumNumberType::J);
1219  auto Jup = band.UpperQuantumNumber(iline, QuantumNumberType::J);
1220 
1221  if (Jlo.isUndefined() or Jup.isUndefined() or 1 < abs(Jup - Jlo)) {
1222  deleters.push_back(iline);
1223  }
1224  }
1225 
1226  while (deleters.size()) {
1227  band.RemoveLine(deleters.back());
1228  deleters.pop_back();
1229  i++;
1230  }
1231  }
1232 
1233  out2 << "Deleted " << i << " lines.\n";
1234 }
1235 
1236 /* Workspace method: Doxygen documentation will be auto-generated */
1238 {
1239  const auto qn = string2quantumnumbertype(qn_id);
1240 
1241  for (auto& band: abs_lines) {
1242  for (Index i=band.NumLines() - 1; i>=0; i--) {
1243  if (band.UpperQuantumNumber(i, qn) > qn_val or band.LowerQuantumNumber(i, qn) > qn_val) {
1244  band.RemoveLine(i);
1245  }
1246  }
1247  }
1248 }
1249 
1250 /* Workspace method: Doxygen documentation will be auto-generated */
1252 {
1253  for (auto& band: abs_lines) {
1254  std::array<bool, LineShape::nVars> var_is_empty;
1255 
1256  // Species by species can be empty, so loop each species by themselves
1257  for (Index ispec=0; ispec<band.NumBroadeners(); ispec++) {
1258  var_is_empty.fill(true);
1259 
1260  // Check if any variable in this band for any line is non-empty
1261  for (Index iline=0; iline<band.NumLines(); iline++) {
1262  for (Index ivar=0; ivar < LineShape::nVars; ivar++) {
1263  if (not LineShape::modelparameterEmpty(band.Line(iline).LineShape().Data()[ispec].Data()[ivar])) {
1264  var_is_empty[ivar] = false;
1265  }
1266  }
1267  }
1268 
1269  // Remove empty variables from the writing. This will also speed up some calculations
1270  for (Index iline=0; iline<band.NumLines(); iline++) {
1271  for (Index ivar=0; ivar < LineShape::nVars; ivar++) {
1272  if (var_is_empty[ivar]) {
1273  band.Line(iline).LineShape().Data()[ispec].Data()[ivar].type = LineShape::TemperatureModel::None;
1274  }
1275  }
1276  }
1277  }
1278  }
1279 }
1280 
1281 void abs_linesKeepBands(ArrayOfAbsorptionLines& abs_lines, const QuantumIdentifier& qid, const Index& ignore_spec, const Index& ignore_isot, const Verbosity&)
1282 {
1283  // Invalid setting
1284  if (ignore_spec and not ignore_isot) {
1285  throw std::runtime_error("Cannot ignore the species and not ignore the isotopologue");
1286  }
1287 
1288  // local ID is a transition even if an energy level is given
1289  QuantumIdentifier this_id=qid;
1290  if (QuantumIdentifier::ENERGY_LEVEL == this_id.Type()) {
1291  this_id.SetTransition();
1294  }
1295 
1296  for (auto& band: abs_lines) {
1297  if (ignore_spec)
1298  this_id.Species() = band.Species();
1299  if (ignore_isot)
1300  this_id.Isotopologue() = band.Isotopologue();
1301 
1302  const bool in_lines = band.QuantumIdentity().In(this_id);
1303  while (not in_lines and band.NumLines()) {
1304  band.RemoveLine(0);
1305  }
1306  }
1307 }
1308 
1309 
1311 {
1312  for (Index i=abs_lines.nelem() - 1; i>=0; i--) {
1313  if (abs_lines[i].NumLines() == 0) {
1314  abs_lines.erase(abs_lines.begin() + i);
1315  }
1316  }
1317 }
1318 
1322 
1326 
1327 /* Workspace method: Doxygen documentation will be auto-generated */
1329  const String& type,
1330  const Numeric& x,
1331  const Verbosity&)
1332 {
1333  auto t = Absorption::string2cutofftype(type);
1334  for (auto& lines: abs_lines) {
1335  lines.Cutoff(t);
1336  lines.CutoffFreqValue(x);
1337  }
1338 }
1339 
1340 /* Workspace method: Doxygen documentation will be auto-generated */
1342  const String& type,
1343  const Numeric& x,
1344  const Verbosity& v)
1345 {
1346  for (auto& abs_lines: abs_lines_per_species)
1347  abs_linesSetCutoff(abs_lines, type, x, v);
1348 }
1349 
1350 /* Workspace method: Doxygen documentation will be auto-generated */
1353  const String& type,
1354  const Numeric& x,
1355  const QuantumIdentifier& QI,
1356  const Verbosity&)
1357 {
1358  auto t = Absorption::string2cutofftype(type);
1359  for (auto& band: abs_lines) {
1360  if (QI.In(band.QuantumIdentity())) {
1361  band.Cutoff(t);
1362  band.CutoffFreqValue(x);
1363  }
1364  }
1365 }
1366 
1367 /* Workspace method: Doxygen documentation will be auto-generated */
1370  const String& type,
1371  const Numeric& x,
1372  const QuantumIdentifier& QI,
1373  const Verbosity& verbosity)
1374 {
1375  for (auto& lines: abs_lines_per_species) {
1376  abs_linesSetCutoffForMatch(lines, type, x, QI, verbosity);
1377  }
1378 }
1379 
1380 /* Workspace method: Doxygen documentation will be auto-generated */
1384  const String& type,
1385  const Numeric& x,
1386  const String& species_tag,
1387  const Verbosity& verbosity)
1388 {
1389  Index t1, t2;
1390  ArrayOfArrayOfSpeciesTag target_species;
1391  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1392  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1393  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1395  }
1396  }
1397 }
1398 
1402 
1403 /* Workspace method: Doxygen documentation will be auto-generated */
1405  const String& type,
1406  const Verbosity&)
1407 {
1408  auto t = Absorption::string2mirroringtype(type);
1409  for (auto& lines: abs_lines)
1410  lines.Mirroring(t);
1411 }
1412 
1413 /* Workspace method: Doxygen documentation will be auto-generated */
1415  const String& type,
1416  const Verbosity& v)
1417 {
1418  for (auto& abs_lines: abs_lines_per_species)
1419  abs_linesSetMirroring(abs_lines, type, v);
1420 }
1421 
1422 /* Workspace method: Doxygen documentation will be auto-generated */
1424  const String& type,
1425  const QuantumIdentifier& QI,
1426  const Verbosity&)
1427 {
1428  auto t = Absorption::string2mirroringtype(type);
1429  for (auto& band: abs_lines) {
1430  if (QI.In(band.QuantumIdentity())) {
1431  band.Mirroring(t);
1432  }
1433  }
1434 }
1435 
1436 /* Workspace method: Doxygen documentation will be auto-generated */
1438  const String& type,
1439  const QuantumIdentifier& QI,
1440  const Verbosity& v)
1441 {
1442  for (auto& abs_lines: abs_lines_per_species)
1444 }
1445 
1446 /* Workspace method: Doxygen documentation will be auto-generated */
1450  const String& type,
1451  const String& species_tag,
1452  const Verbosity& verbosity)
1453 {
1454  Index t1, t2;
1455  ArrayOfArrayOfSpeciesTag target_species;
1456  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1457  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1458  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1460  }
1461  }
1462 }
1463 
1467 
1468 /* Workspace method: Doxygen documentation will be auto-generated */
1470  const String& type,
1471  const Verbosity&)
1472 {
1473  auto t = Absorption::string2populationtype(type);
1474  for (auto& lines: abs_lines)
1475  lines.Population(t);
1476 }
1477 
1478 /* Workspace method: Doxygen documentation will be auto-generated */
1480  const String& type,
1481  const Verbosity& v)
1482 {
1483  for (auto& abs_lines: abs_lines_per_species)
1485 }
1486 
1487 /* Workspace method: Doxygen documentation will be auto-generated */
1489  const String& type,
1490  const QuantumIdentifier& QI,
1491  const Verbosity&)
1492 {
1493  auto t = Absorption::string2populationtype(type);
1494  for (auto& lines: abs_lines)
1495  if (QI.In(lines.QuantumIdentity()))
1496  lines.Population(t);
1497 }
1498 
1499 /* Workspace method: Doxygen documentation will be auto-generated */
1501  const String& type,
1502  const QuantumIdentifier& QI,
1503  const Verbosity& v)
1504 {
1505  for (auto& abs_lines: abs_lines_per_species)
1507 }
1508 
1509 /* Workspace method: Doxygen documentation will be auto-generated */
1513  const String& type,
1514  const String& species_tag,
1515  const Verbosity& verbosity)
1516 {
1517  Index t1, t2;
1518  ArrayOfArrayOfSpeciesTag target_species;
1519  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1520  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1521  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1523  }
1524  }
1525 }
1526 
1530 
1531 /* Workspace method: Doxygen documentation will be auto-generated */
1533  const String& type,
1534  const Verbosity&)
1535 {
1536  auto t = Absorption::string2normalizationtype(type);
1537  for (auto& lines: abs_lines)
1538  lines.Normalization(t);
1539 }
1540 
1541 /* Workspace method: Doxygen documentation will be auto-generated */
1543  const String& type,
1544  const Verbosity& v)
1545 {
1546  for (auto& abs_lines: abs_lines_per_species)
1548 }
1549 
1550 /* Workspace method: Doxygen documentation will be auto-generated */
1552  const String& type,
1553  const QuantumIdentifier& QI,
1554  const Verbosity&)
1555 {
1556  auto t = Absorption::string2normalizationtype(type);
1557  for (auto& lines: abs_lines)
1558  if (QI.In(lines.QuantumIdentity()))
1559  lines.Normalization(t);
1560 }
1561 
1562 /* Workspace method: Doxygen documentation will be auto-generated */
1564  const String& type,
1565  const QuantumIdentifier& QI,
1566  const Verbosity& v)
1567 {
1568  for (auto& abs_lines: abs_lines_per_species)
1570 }
1571 
1572 /* Workspace method: Doxygen documentation will be auto-generated */
1576  const String& type,
1577  const String& species_tag,
1578  const Verbosity& verbosity)
1579 {
1580  Index t1, t2;
1581  ArrayOfArrayOfSpeciesTag target_species;
1582  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1583  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1584  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1586  }
1587  }
1588 }
1589 
1593 
1594 /* Workspace method: Doxygen documentation will be auto-generated */
1596  const String& type,
1597  const Verbosity&)
1598 {
1599  auto t = LineShape::string2shapetype(type);
1600  for (auto& lines: abs_lines)
1601  lines.LineShapeType(t);
1602 }
1603 
1604 /* Workspace method: Doxygen documentation will be auto-generated */
1606  const String& type,
1607  const Verbosity& v)
1608 {
1609  for (auto& abs_lines: abs_lines_per_species)
1611 }
1612 
1613 /* Workspace method: Doxygen documentation will be auto-generated */
1615  const String& type,
1616  const QuantumIdentifier& QI,
1617  const Verbosity&)
1618 {
1619  auto t = LineShape::string2shapetype(type);
1620  for (auto& lines: abs_lines)
1621  if (QI.In(lines.QuantumIdentity()))
1622  lines.LineShapeType(t);
1623 }
1624 
1625 /* Workspace method: Doxygen documentation will be auto-generated */
1627  const String& type,
1628  const QuantumIdentifier& QI,
1629  const Verbosity& v)
1630 {
1631  for (auto& abs_lines: abs_lines_per_species)
1633 }
1634 
1635 /* Workspace method: Doxygen documentation will be auto-generated */
1639  const String& type,
1640  const String& species_tag,
1641  const Verbosity& verbosity)
1642 {
1643  Index t1, t2;
1644  ArrayOfArrayOfSpeciesTag target_species;
1645  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1646  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1647  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1649  }
1650  }
1651 }
1652 
1656 
1657 /* Workspace method: Doxygen documentation will be auto-generated */
1659  const Numeric& x,
1660  const Verbosity&)
1661 {
1662  for (auto& lines: abs_lines)
1663  lines.LinemixingLimit(x);
1664 }
1665 
1666 /* Workspace method: Doxygen documentation will be auto-generated */
1668  const Numeric& x,
1669  const Verbosity& v)
1670 {
1671  for (auto& abs_lines: abs_lines_per_species)
1673 }
1674 
1675 /* Workspace method: Doxygen documentation will be auto-generated */
1677  const Numeric& x,
1678  const QuantumIdentifier& QI,
1679  const Verbosity&)
1680 {
1681  for (auto& lines: abs_lines)
1682  if (QI.In(lines.QuantumIdentity()))
1683  lines.LinemixingLimit(x);
1684 }
1685 
1686 /* Workspace method: Doxygen documentation will be auto-generated */
1688  const Numeric& x,
1689  const QuantumIdentifier& QI,
1690  const Verbosity& v)
1691 {
1692  for (auto& abs_lines: abs_lines_per_species)
1694 }
1695 
1696 /* Workspace method: Doxygen documentation will be auto-generated */
1700  const Numeric& x,
1701  const String& species_tag,
1702  const Verbosity& verbosity)
1703 {
1704  Index t1, t2;
1705  ArrayOfArrayOfSpeciesTag target_species;
1706  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1707  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1708  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1710  }
1711  }
1712 }
1713 
1717 
1718 /* Workspace method: Doxygen documentation will be auto-generated */
1720  const Numeric& x,
1721  const Verbosity&)
1722 {
1723  for (auto& lines: abs_lines)
1724  lines.T0(x);
1725 }
1726 
1727 /* Workspace method: Doxygen documentation will be auto-generated */
1729  const Numeric& x,
1730  const Verbosity& v)
1731 {
1732  for (auto& abs_lines: abs_lines_per_species)
1733  abs_linesSetT0(abs_lines, x, v);
1734 }
1735 
1736 /* Workspace method: Doxygen documentation will be auto-generated */
1738  const Numeric& x,
1739  const QuantumIdentifier& QI,
1740  const Verbosity&)
1741 {
1742  for (auto& lines: abs_lines)
1743  if (QI.In(lines.QuantumIdentity()))
1744  lines.T0(x);
1745 }
1746 
1747 /* Workspace method: Doxygen documentation will be auto-generated */
1749  const Numeric& x,
1750  const QuantumIdentifier& QI,
1751  const Verbosity& v)
1752 {
1753  for (auto& abs_lines: abs_lines_per_species)
1755 }
1756 
1757 /* Workspace method: Doxygen documentation will be auto-generated */
1761  const Numeric& x,
1762  const String& species_tag,
1763  const Verbosity& verbosity)
1764 {
1765  Index t1, t2;
1766  ArrayOfArrayOfSpeciesTag target_species;
1767  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1768  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1769  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1771  }
1772  }
1773 }
1774 
1778 
1779 /* Workspace method: Doxygen documentation will be auto-generated */
1781  const QuantumIdentifier& QI,
1782  const String& parameter_name,
1783  const Numeric& change,
1784  const Index& relative,
1785  const Index& loose_matching,
1786  const Verbosity&)
1787 {
1788  Index parameter_switch = -1;
1789 
1790  if (parameter_name.nelem() == 0)
1791  throw std::runtime_error("parameter_name is empty.\n");
1792  else if (parameter_name == "Central Frequency" or
1793  parameter_name == "Line Center")
1794  parameter_switch = 0;
1795  else if (parameter_name == "Line Strength")
1796  parameter_switch = 1;
1797  else if (parameter_name == "Lower State Energy")
1798  parameter_switch = 4;
1799  else if (parameter_name == "Einstein Coefficient")
1800  parameter_switch = 5;
1801  else if (parameter_name == "Lower Statistical Weight")
1802  parameter_switch = 6;
1803  else if (parameter_name == "Upper Statistical Weight")
1804  parameter_switch = 7;
1805  else if (parameter_name == "Lower Zeeman Coefficient")
1806  parameter_switch = 8;
1807  else if (parameter_name == "Upper Zeeman Coefficient")
1808  parameter_switch = 9;
1809 
1810  for (auto& band: abs_lines) {
1811  for (Index k=0; k<band.NumLines(); k++) {
1812  if (loose_matching ? Absorption::id_in_line(band, QI, k)
1813  : Absorption::line_is_id(band, QI, k)) {
1814  switch (parameter_switch) {
1815  case 0: // "Central Frequency":
1816  if (relative == 0)
1817  band.F0(k) += change;
1818  else
1819  band.F0(k) *= 1.0e0 + change;
1820  break;
1821  case 1: // "Line Strength":
1822  if (relative == 0)
1823  band.I0(k) += change;
1824  else
1825  band.I0(k) *= 1.0e0 + change;
1826  break;
1827  case 4: // "Lower State Energy":
1828  if (relative == 0)
1829  band.E0(k) += change;
1830  else
1831  band.E0(k) *= 1.0e0 + change;
1832  break;
1833  case 5: // "Einstein":
1834  if (relative == 0)
1835  band.A(k) += change;
1836  else
1837  band.A(k) *= 1.0e0 + change;
1838  break;
1839  case 6: // "Lower Statistical Weight":
1840  if (relative == 0)
1841  band.g_low(k) += change;
1842  else
1843  band.g_low(k) *= 1.0e0 + change;
1844  break;
1845  case 7: // "Upper Statistical Weight":
1846  if (relative == 0)
1847  band.g_upp(k) += change;
1848  else
1849  band.g_upp(k) *= 1.0e0 + change;
1850  break;
1851  case 8: // "Lower Zeeman Coefficient":
1852  if (relative == 0)
1853  band.Line(k).Zeeman().gl() += change;
1854  else
1855  band.Line(k).Zeeman().gl() *= 1.0e0 + change;
1856  break;
1857  case 9: // "Upper Zeeman Coefficient":
1858  if (relative == 0)
1859  band.Line(k).Zeeman().gu() += change;
1860  else
1861  band.Line(k).Zeeman().gu() *= 1.0e0 + change;
1862  break;
1863  default: {
1864  ostringstream os;
1865  os << "Usupported paramter_name\n"
1866  << parameter_name
1867  << "\nSee method description for supported parameter names.\n";
1868  throw std::runtime_error(os.str());
1869  }
1870  }
1871  }
1872  }
1873  }
1874 }
1875 
1876 /* Workspace method: Doxygen documentation will be auto-generated */
1878  const QuantumIdentifier& QI,
1879  const String& parameter_name,
1880  const Numeric& change,
1881  const Index& relative,
1882  const Index& loose_matching,
1883  const Verbosity& verbosity)
1884 {
1885  for (auto& lines: abs_lines_per_species)
1886  abs_linesChangeBaseParameterForMatchingLines(lines, QI, parameter_name, change, relative, loose_matching, verbosity);
1887 }
1888 
1889 /* Workspace method: Doxygen documentation will be auto-generated */
1893  const QuantumIdentifier& QI,
1894  const String& parameter_name,
1895  const Numeric& change,
1896  const Index& relative,
1897  const Index& loose_matching,
1898  const String& species_tag,
1899  const Verbosity& verbosity)
1900 {
1901  Index t1, t2;
1902  ArrayOfArrayOfSpeciesTag target_species;
1903  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1904  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
1905  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
1906  abs_linesChangeBaseParameterForMatchingLines(abs_lines_per_species[ispec], QI, parameter_name, change, relative, loose_matching, verbosity);
1907  }
1908  }
1909 }
1910 
1911 /* Workspace method: Doxygen documentation will be auto-generated */
1913  const QuantumIdentifier& QI,
1914  const String& parameter_name,
1915  const Numeric& x,
1916  const Index& loose_matching,
1917  const Verbosity&)
1918 {
1919  Index parameter_switch = -1;
1920 
1921  if (parameter_name.nelem() == 0)
1922  throw std::runtime_error("parameter_name is empty.\n");
1923  else if (parameter_name == "Central Frequency" or
1924  parameter_name == "Line Center")
1925  parameter_switch = 0;
1926  else if (parameter_name == "Line Strength")
1927  parameter_switch = 1;
1928  else if (parameter_name == "Lower State Energy")
1929  parameter_switch = 4;
1930  else if (parameter_name == "Einstein Coefficient")
1931  parameter_switch = 5;
1932  else if (parameter_name == "Lower Statistical Weight")
1933  parameter_switch = 6;
1934  else if (parameter_name == "Upper Statistical Weight")
1935  parameter_switch = 7;
1936  else if (parameter_name == "Lower Zeeman Coefficient")
1937  parameter_switch = 8;
1938  else if (parameter_name == "Upper Zeeman Coefficient")
1939  parameter_switch = 9;
1940 
1941  for (auto& band: abs_lines) {
1942  for (Index k=0; k<band.NumLines(); k++) {
1943  if (loose_matching ? Absorption::id_in_line(band, QI, k)
1944  : Absorption::line_is_id(band, QI, k)) {
1945  switch (parameter_switch) {
1946  case 0: // "Central Frequency":
1947  band.F0(k) = x;
1948  break;
1949  case 1: // "Line Strength":
1950  band.I0(k) = x;
1951  break;
1952  case 4: // "Lower State Energy":
1953  band.E0(k) = x;
1954  break;
1955  case 5: // "Einstein":
1956  band.A(k) = x;
1957  break;
1958  case 6: // "Lower Statistical Weight":
1959  band.g_low(k) = x;
1960  break;
1961  case 7: // "Upper Statistical Weight":
1962  band.g_upp(k) = x;
1963  break;
1964  case 8:
1965  band.Line(k).Zeeman().gl() = x;
1966  break;
1967  case 9:
1968  band.Line(k).Zeeman().gu() = x;
1969  break;
1970  default: {
1971  ostringstream os;
1972  os << "Usupported paramter_name\n"
1973  << parameter_name
1974  << "\nSee method description for supported parameter names.\n";
1975  throw std::runtime_error(os.str());
1976  }
1977  }
1978  }
1979  }
1980  }
1981 }
1982 
1983 /* Workspace method: Doxygen documentation will be auto-generated */
1985  const QuantumIdentifier& QI,
1986  const String& parameter_name,
1987  const Numeric& change,
1988  const Index& loose_matching,
1989  const Verbosity& verbosity)
1990 {
1991  for (auto& lines: abs_lines_per_species)
1992  abs_linesSetBaseParameterForMatchingLines(lines, QI, parameter_name, change, loose_matching, verbosity);
1993 }
1994 
1995 /* Workspace method: Doxygen documentation will be auto-generated */
1999  const QuantumIdentifier& QI,
2000  const String& parameter_name,
2001  const Numeric& change,
2002  const Index& loose_matching,
2003  const String& species_tag,
2004  const Verbosity& verbosity)
2005 {
2006  Index t1, t2;
2007  ArrayOfArrayOfSpeciesTag target_species;
2008  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2009  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
2010  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
2011  abs_linesSetBaseParameterForMatchingLines(abs_lines_per_species[ispec], QI, parameter_name, change, loose_matching, verbosity);
2012  }
2013  }
2014 }
2015 
2016 /* Workspace method: Doxygen documentation will be auto-generated */
2019  const QuantumIdentifier& QI,
2020  const String& parameter,
2021  const String& coefficient,
2022  const String& species,
2023  const Numeric& x,
2024  const Index& relative,
2025  const Verbosity&)
2026 {
2027  const bool do_self = species == LineShape::self_broadening;
2028  const bool do_bath = species == LineShape::bath_broadening;
2029 
2030  // Set the spec index if possible
2031  const Index spec = (do_self or do_bath) ? -1 : SpeciesTag(species).Species();
2032 
2034 
2035  for (auto& band: abs_lines) {
2036  for (Index k=0; k<band.NumLines(); k++) {
2037  if (Absorption::id_in_line(band, QI, k)) {
2038  if (do_self and band.Self()) {
2039  if (relative) {
2040  SingleModelParameter(band.Line(k).LineShape().Data().front().Data()[Index(var)], coefficient) *= 1 + x;
2041  } else {
2042  SingleModelParameter(band.Line(k).LineShape().Data().front().Data()[Index(var)], coefficient) += x;
2043  }
2044  } else if (do_bath and band.Bath()) {
2045  if (relative) {
2046  SingleModelParameter(band.Line(k).LineShape().Data().back().Data()[Index(var)], coefficient) *= 1 + x;
2047  } else {
2048  SingleModelParameter(band.Line(k).LineShape().Data().back().Data()[Index(var)], coefficient) += x;
2049  }
2050  } else {
2051  for (Index i=band.Self(); i<band.BroadeningSpecies().nelem()-band.Bath(); i++) {
2052  if (spec == band.BroadeningSpecies()[i].Species()) {
2053  if (relative) {
2054  SingleModelParameter(band.Line(k).LineShape().Data()[i].Data()[Index(var)], coefficient) *= 1 + x;
2055  } else {
2056  SingleModelParameter(band.Line(k).LineShape().Data()[i].Data()[Index(var)], coefficient) += x;
2057  }
2058  }
2059  }
2060  }
2061  }
2062  }
2063  }
2064 }
2065 
2066 /* Workspace method: Doxygen documentation will be auto-generated */
2069  const QuantumIdentifier& QI,
2070  const String& parameter,
2071  const String& coefficient,
2072  const String& species,
2073  const Numeric& x,
2074  const Index& relative,
2075  const Verbosity& verbosity)
2076 {
2077  for (auto& lines: abs_lines_per_species)
2079  lines, QI, parameter, coefficient, species, x, relative, verbosity);
2080 }
2081 
2082 /* Workspace method: Doxygen documentation will be auto-generated */
2086  const QuantumIdentifier& QI,
2087  const String& parameter,
2088  const String& coefficient,
2089  const String& species,
2090  const Numeric& x,
2091  const Index& relative,
2092  const String& species_tag,
2093  const Verbosity& verbosity)
2094 {
2095  Index t1, t2;
2096  ArrayOfArrayOfSpeciesTag target_species;
2097  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2098  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
2099  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
2101  abs_lines_per_species[ispec], QI, parameter, coefficient, species, x, relative, verbosity);
2102  }
2103  }
2104 }
2105 
2106 /* Workspace method: Doxygen documentation will be auto-generated */
2109  const QuantumIdentifier& QI,
2110  const String& parameter,
2111  const String& coefficient,
2112  const String& species,
2113  const Numeric& new_value,
2114  const Verbosity&)
2115 {
2116  const bool do_self = species == LineShape::self_broadening;
2117  const bool do_bath = species == LineShape::bath_broadening;
2118 
2119  // Set the spec index if possible
2120  const Index spec = (do_self or do_bath) ? -1 : SpeciesTag(species).Species();
2121 
2123 
2124  for (auto& band: abs_lines) {
2125  for (Index k=0; k<band.NumLines(); k++) {
2126  if (Absorption::id_in_line(band, QI, k)) {
2127  if (do_self and band.Self()) {
2128  SingleModelParameter(band.Line(k).LineShape().Data().front().Data()[Index(var)], coefficient) = new_value;
2129  } else if (do_bath and band.Bath()) {
2130  SingleModelParameter(band.Line(k).LineShape().Data().back().Data()[Index(var)], coefficient) = new_value;
2131  } else {
2132  for (Index i=band.Self(); i<band.BroadeningSpecies().nelem()-band.Bath(); i++) {
2133  if (spec == band.BroadeningSpecies()[i].Species()) {
2134  SingleModelParameter(band.Line(k).LineShape().Data()[i].Data()[Index(var)], coefficient) = new_value;
2135  }
2136  }
2137  }
2138  }
2139  }
2140  }
2141 }
2142 
2143 /* Workspace method: Doxygen documentation will be auto-generated */
2146  const QuantumIdentifier& QI,
2147  const String& parameter,
2148  const String& coefficient,
2149  const String& species,
2150  const Numeric& new_value,
2151  const Verbosity& verbosity)
2152 {
2153  for (auto& lines: abs_lines_per_species)
2155  lines, QI, parameter, coefficient, species, new_value, verbosity);
2156 }
2157 
2158 /* Workspace method: Doxygen documentation will be auto-generated */
2162  const QuantumIdentifier& QI,
2163  const String& parameter,
2164  const String& coefficient,
2165  const String& species,
2166  const Numeric& new_value,
2167  const String& species_tag,
2168  const Verbosity& verbosity)
2169 {
2170  Index t1, t2;
2171  ArrayOfArrayOfSpeciesTag target_species;
2172  abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2173  for (Index ispec=0; ispec<abs_species.nelem(); ispec++) {
2174  if (std::equal(abs_species[ispec].begin(), abs_species[ispec].end(), target_species[0].begin())) {
2176  abs_lines_per_species[ispec], QI, parameter, coefficient, species, new_value, verbosity);
2177  }
2178  }
2179 }
2180 
2184 
2185 /* Workspace method: Doxygen documentation will be auto-generated */
2187  const QuantumIdentifier& QI,
2188  const String& parameter_name,
2189  const Numeric& change,
2190  const Index& relative,
2191  const Verbosity&)
2192 {
2193  if (QI.Type() not_eq QuantumIdentifier::ENERGY_LEVEL) {
2194  std::ostringstream os;
2195  os << "Bad input. Must be energy level. Is: " << QI << '\n';
2196  throw std::runtime_error(os.str());
2197  }
2198 
2199  Index parameter_switch = -1;
2200 
2201  if (parameter_name.nelem() == 0)
2202  throw std::runtime_error("parameter_name is empty.\n");
2203  else if (parameter_name == "Statistical Weight")
2204  parameter_switch = 1;
2205  else if (parameter_name == "Zeeman Coefficient")
2206  parameter_switch = 2;
2207 
2208  for (auto& band: abs_lines) {
2209  for (Index k=0; k<band.NumLines(); k++) {
2210  if (Absorption::id_in_line_lower(band, QI, k)) {
2211  switch (parameter_switch) {
2212  case 1: // "Statistical Weight":
2213  if (relative == 0)
2214  band.g_low(k) += change;
2215  else
2216  band.g_low(k) *= 1.0e0 + change;
2217  break;
2218  case 2: // "Zeeman Coefficient":
2219  if (relative == 0)
2220  band.Line(k).Zeeman().gl() += change;
2221  else
2222  band.Line(k).Zeeman().gl() *= 1.0e0 + change;
2223  break;
2224  default: {
2225  ostringstream os;
2226  os << "Usupported paramter_name\n"
2227  << parameter_name
2228  << "\nSee method description for supported parameter names.\n";
2229  throw std::runtime_error(os.str());
2230  }
2231  }
2232  } else if (Absorption::id_in_line_upper(band, QI, k)) {
2233  switch (parameter_switch) {
2234  case 1: // "Statistical Weight":
2235  if (relative == 0)
2236  band.g_upp(k) += change;
2237  else
2238  band.g_upp(k) *= 1.0e0 + change;
2239  break;
2240  case 2: // "Zeeman Coefficient":
2241  if (relative == 0)
2242  band.Line(k).Zeeman().gu() += change;
2243  else
2244  band.Line(k).Zeeman().gu() *= 1.0e0 + change;
2245  break;
2246  default: {
2247  ostringstream os;
2248  os << "Usupported paramter_name\n"
2249  << parameter_name
2250  << "\nSee method description for supported parameter names.\n";
2251  throw std::runtime_error(os.str());
2252  }
2253  }
2254  }
2255  }
2256  }
2257 }
2258 
2259 /* Workspace method: Doxygen documentation will be auto-generated */
2261  const QuantumIdentifier& QI,
2262  const String& parameter_name,
2263  const Numeric& change,
2264  const Index& relative,
2265  const Verbosity& verbosity)
2266 {
2267  for (auto& lines: abs_lines_per_species)
2268  abs_linesChangeBaseParameterForMatchingLevel(lines, QI, parameter_name, change, relative, verbosity);
2269 }
2270 
2271 /* Workspace method: Doxygen documentation will be auto-generated */
2273  const ArrayOfQuantumIdentifier& QID,
2274  const String& parameter_name,
2275  const Vector& change,
2276  const Index& relative,
2277  const Verbosity& verbosity)
2278 {
2279  if (QID.nelem() not_eq change.nelem()) {
2280  throw std::runtime_error("Mismatch between QID and change input lengths not allowed");
2281  }
2282 
2283  for (Index iq=0; iq<QID.nelem(); iq++)
2284  abs_linesChangeBaseParameterForMatchingLevel(abs_lines, QID[iq], parameter_name, change[iq], relative, verbosity);
2285 }
2286 
2287 /* Workspace method: Doxygen documentation will be auto-generated */
2289  const ArrayOfQuantumIdentifier& QID,
2290  const String& parameter_name,
2291  const Vector& change,
2292  const Index& relative,
2293  const Verbosity& verbosity)
2294 {
2295  if (QID.nelem() not_eq change.nelem()) {
2296  throw std::runtime_error("Mismatch between QID and change input lengths not allowed");
2297  }
2298 
2299  for (Index iq=0; iq<QID.nelem(); iq++)
2300  for (auto& lines: abs_lines_per_species)
2301  abs_linesChangeBaseParameterForMatchingLevel(lines, QID[iq], parameter_name, change[iq], relative, verbosity);
2302 }
2303 
2304 /* Workspace method: Doxygen documentation will be auto-generated */
2306  const QuantumIdentifier& QI,
2307  const String& parameter_name,
2308  const Numeric& x,
2309  const Verbosity&)
2310 {
2311  if (QI.Type() not_eq QuantumIdentifier::ENERGY_LEVEL) {
2312  std::ostringstream os;
2313  os << "Bad input. Must be energy level. Is: " << QI << '\n';
2314  throw std::runtime_error(os.str());
2315  }
2316 
2317  Index parameter_switch = -1;
2318 
2319  if (parameter_name.nelem() == 0)
2320  throw std::runtime_error("parameter_name is empty.\n");
2321  else if (parameter_name == "Statistical Weight")
2322  parameter_switch = 1;
2323  else if (parameter_name == "Zeeman Coefficient")
2324  parameter_switch = 2;
2325 
2326  for (auto& band: abs_lines) {
2327  for (Index k=0; k<band.NumLines(); k++) {
2328  if (Absorption::id_in_line_lower(band, QI, k)) {
2329  switch (parameter_switch) {
2330  case 1: // "Statistical Weight":
2331  band.g_low(k) = x;
2332  break;
2333  case 2: // "Zeeman Coefficient":
2334  band.Line(k).Zeeman().gl() = x;
2335  break;
2336  default: {
2337  ostringstream os;
2338  os << "Usupported paramter_name\n"
2339  << parameter_name
2340  << "\nSee method description for supported parameter names.\n";
2341  throw std::runtime_error(os.str());
2342  }
2343  }
2344  } else if (Absorption::id_in_line_upper(band, QI, k)) {
2345  switch (parameter_switch) {
2346  case 1: // "Statistical Weight":
2347  band.g_upp(k) = x;
2348  break;
2349  case 2: // "Zeeman Coefficient":
2350  band.Line(k).Zeeman().gu() = x;
2351  break;
2352  default: {
2353  ostringstream os;
2354  os << "Usupported paramter_name\n"
2355  << parameter_name
2356  << "\nSee method description for supported parameter names.\n";
2357  throw std::runtime_error(os.str());
2358  }
2359  }
2360  }
2361  }
2362  }
2363 }
2364 
2365 /* Workspace method: Doxygen documentation will be auto-generated */
2367  const QuantumIdentifier& QI,
2368  const String& parameter_name,
2369  const Numeric& change,
2370  const Verbosity& verbosity)
2371 {
2372  for (auto& lines: abs_lines_per_species)
2373  abs_linesSetBaseParameterForMatchingLevel(lines, QI, parameter_name, change, verbosity);
2374 }
2375 
2376 /* Workspace method: Doxygen documentation will be auto-generated */
2378  const ArrayOfQuantumIdentifier& QID,
2379  const String& parameter_name,
2380  const Vector& change,
2381  const Verbosity& verbosity)
2382 {
2383  if (QID.nelem() not_eq change.nelem()) {
2384  throw std::runtime_error("Mismatch between QID and change input lengths not allowed");
2385  }
2386 
2387  for (Index iq=0; iq<QID.nelem(); iq++)
2388  abs_linesSetBaseParameterForMatchingLevel(abs_lines, QID[iq], parameter_name, change[iq], verbosity);
2389 }
2390 
2391 /* Workspace method: Doxygen documentation will be auto-generated */
2393  const ArrayOfQuantumIdentifier& QID,
2394  const String& parameter_name,
2395  const Vector& change,
2396  const Verbosity& verbosity)
2397 {
2398  if (QID.nelem() not_eq change.nelem()) {
2399  throw std::runtime_error("Mismatch between QID and change input lengths not allowed");
2400  }
2401 
2402  for (Index iq=0; iq<QID.nelem(); iq++)
2403  for (auto& lines: abs_lines_per_species)
2404  abs_linesSetBaseParameterForMatchingLevel(lines, QID[iq], parameter_name, change[iq], verbosity);
2405 }
2406 
2410 
2411 /* Workspace method: Doxygen documentation will be auto-generated */
2413  Index& nlte_do,
2415  const EnergyLevelMap& nlte_field,
2416  const Verbosity&)
2417 {
2418  nlte_field.ThrowIfNotOK();
2419 
2420  if (nlte_field.Data().empty()) {
2421  nlte_do = 0;
2422  return;
2423  } else {
2424  nlte_do = 1;
2425  }
2426 
2427  const Absorption::PopulationType poptyp = nlte_field.Energies().empty() ?
2428  Absorption::PopulationType::ByNLTEPopulationDistribution :
2429  Absorption::PopulationType::ByNLTEVibrationalTemperatures;
2430 
2431  for (auto& spec_lines: abs_lines_per_species) {
2432  for (auto& band: spec_lines) {
2433  for (auto& id: nlte_field.Levels()) {
2434  if (band.QuantumIdentity().UpperQuantumId().In(id) or
2435  band.QuantumIdentity().LowerQuantumId().In(id)) {
2436  for (Index k=0; k<band.NumLines(); k++) {
2437  if (poptyp==Absorption::PopulationType::ByNLTEPopulationDistribution and
2438  (not std::isnormal(band.A(k)) or band.A(k) < 0)) {
2439  std::ostringstream os;
2440  os << "Error in band deemed for NLTE calculations by population distribution\n"
2441  << "some of the lines in the band below have a bad Einstein coefficient:\n"
2442  << band << '\n';
2443  throw std::runtime_error(os.str());
2444  }
2445  }
2446  band.Population(poptyp);
2447  }
2448  }
2449  }
2450  }
2451 }
2452 
2456 
2457 /* Workspace method: Doxygen documentation will be auto-generated */
2460  const Verbosity&) {
2462 }
2463 
2464 /* Workspace method: Doxygen documentation will be auto-generated */
2466  const Vector& f_grid,
2467  const Verbosity&)
2468 {
2469  const Numeric fmax = max(f_grid);
2470  const Numeric fmin = min(f_grid);
2471 
2472  for (auto& band: abs_lines) {
2473  const Numeric fmean = (band.Cutoff() == Absorption::CutoffType::BandFixedFrequency) ? band.F_mean() : 0;
2474  for (Index k=band.NumLines()-1; k>=0; k--) {
2475  const Numeric fcut_upp = band.CutoffFreq(k);
2476  const Numeric fcut_low = band.CutoffFreqMinus(k, fmean);
2477 
2478  if (fmax < fcut_low or fmin > fcut_upp) {
2479  band.RemoveLine(k);
2480  }
2481  }
2482  }
2483 }
2484 
2485 /* Workspace method: Doxygen documentation will be auto-generated */
2487  const Vector& f_grid,
2488  const Verbosity& verbosity)
2489 {
2490  for (auto& lines: abs_lines_per_species) {
2492  }
2493 }
2494 
2495 /* Workspace method: Doxygen documentation will be auto-generated */
2497  const QuantumIdentifier& qid,
2498  const Verbosity&)
2499 {
2500  for (Index i=0; i<abs_lines.nelem(); i++) {
2501  if (qid.In(abs_lines[i].QuantumIdentity())) {
2502  abs_lines.erase(abs_lines.begin()+i);
2503  break;
2504  }
2505  }
2506 }
2507 
2511 
2513  const ArrayOfQuantumIdentifier& qid,
2514  const Vector& gs,
2515  const Verbosity& verbosity) {
2516  if (qid.nelem() not_eq gs.nelem()) throw std::runtime_error("Inputs not matching in size");
2517  for (Index i=0; i<qid.nelem(); i++) {
2518  abs_linesSetBaseParameterForMatchingLevel(abs_lines, qid[i], "Zeeman Coefficient", gs[i], verbosity);
2519  }
2520 }
2521 
2523  const ArrayOfQuantumIdentifier& qid,
2524  const Vector& gs,
2525  const Verbosity& verbosity) {
2526  if (qid.nelem() not_eq gs.nelem()) throw std::runtime_error("Inputs not matching in size");
2527  for (auto& abs_lines: abs_lines_per_species) {
2528  for (Index i=0; i<qid.nelem(); i++) {
2529  abs_linesSetBaseParameterForMatchingLevel(abs_lines, qid[i], "Zeeman Coefficient", gs[i], verbosity);
2530  }
2531  }
2532 }
2533 
2537 
2538 template <class T>
2539 std::vector<T> linspace(T s, T e, typename std::vector<T>::size_type count) noexcept {
2540  std::vector<T> ls(count);
2541 
2542  if (count == 0) {
2543  return ls;
2544  } else if (count == 1) {
2545  ls.front() = (e + s) / 2;
2546  return ls;
2547  } else {
2548  const T step = (e - s) / T(count - 1);
2549  ls.front() = s;
2550  ls.back() = e;
2551  for (typename std::vector<T>::size_type i = 1; i < count - 1; ++i)
2552  ls[i] = s + step * T(i);
2553  return ls;
2554  }
2555 }
2556 
2557 /* Workspace method: Doxygen documentation will be auto-generated */
2560  const Numeric& delta_f_low,
2561  const Numeric& delta_f_upp,
2562  const Index& num_freqs,
2563  const Verbosity&)
2564 {
2566 
2567  if (delta_f_low >= delta_f_upp) {
2568  throw std::runtime_error("The lower frequency delta has to be smaller "
2569  "than the upper frequency delta");
2570  } else if (num_freqs == 0) {
2571  throw std::runtime_error("Need more than zero frequency points");
2572  } else if (n < 1) {
2573  throw std::runtime_error("No lines found. Error? Use *VectorSet* "
2574  "to resize *f_grid*");
2575  }
2576 
2577  std::vector<Numeric> fout(0);
2578  for (auto& lines: abs_lines_per_species) {
2579  for (auto& band: lines) {
2580  for (Index k=0; k<band.NumLines(); k++) {
2581  if (num_freqs > 1) {
2582  auto ftmp = linspace<Numeric>(band.F0(k)+delta_f_low, band.F0(k)+delta_f_upp, std::vector<Numeric>::size_type(num_freqs));
2583  for (auto& f: ftmp) {
2584  if (f > 0) fout.push_back(f);
2585  }
2586  } else {
2587  fout.push_back(band.F0(k));
2588  }
2589  }
2590  }
2591  }
2592 
2593  std::sort(fout.begin(), fout.end());
2594  fout.erase(std::unique(fout.begin(), fout.end()), fout.end());
2595  f_grid.resize(fout.size());
2596  for (Index i=0; i<f_grid.nelem(); i++)
2597  f_grid[i] = fout[i];
2598 }
2599 
2603 
2604 /* Workspace method: Doxygen documentation will be auto-generated */
2606  const Verbosity& verbosity)
2607 {
2608  CREATE_OUT0;
2609 
2610  std::map<Index, Index> qns;
2611 
2612  for (auto& band: abs_lines) {
2613  for (Index iline=0; iline<band.NumLines(); iline++) {
2614  for (Index iqn=0; iqn<Index(QuantumNumberType::FINAL_ENTRY); iqn++) {
2615  if (band.LowerQuantumNumber(iline, QuantumNumberType(iqn)).isDefined() or
2616  band.UpperQuantumNumber(iline, QuantumNumberType(iqn)).isDefined()) {
2617  qns[iqn]++;
2618  }
2619  }
2620  }
2621  }
2622 
2623  for (auto& qn: qns) {
2624  out0 << quantumnumbertype2string(QuantumNumberType(qn.first)) << ':' << ' ' << qn.second << '\n';
2625  }
2626 }
abs_lines_per_speciesReadSpeciesSplitCatalog
void abs_lines_per_speciesReadSpeciesSplitCatalog(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Index &robust, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesReadSpeciesSplitCatalog.
Definition: m_absorptionlines.cc:914
abs_linesSetPopulationForMatch
void abs_linesSetPopulationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulationForMatch.
Definition: m_absorptionlines.cc:1488
abs_linesSetLineShapeModelParameterForMatchingLines
void abs_linesSetLineShapeModelParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &new_value, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeModelParameterForMatchingLines.
Definition: m_absorptionlines.cc:2107
QuantumIdentifier::Isotopologue
void Isotopologue(Index iso)
Set the Isotopologue.
Definition: quantum.h:487
QuantumIdentifier::ENERGY_LEVEL
@ ENERGY_LEVEL
Definition: quantum.h:393
abs_linesCompact
void abs_linesCompact(ArrayOfAbsorptionLines &abs_lines, const Vector &f_grid, const Verbosity &)
WORKSPACE METHOD: abs_linesCompact.
Definition: m_absorptionlines.cc:2465
FILE_TYPE_ASCII
@ FILE_TYPE_ASCII
Definition: xml_io.h:38
ArtsXMLTag::check_name
void check_name(const String &expected_name)
Check tag name.
Definition: xml_io.cc:54
QuantumIdentifier
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
auto_md.h
abs_linesSetQuantumNumberForMatch
void abs_linesSetQuantumNumberForMatch(ArrayOfAbsorptionLines &abs_lines, const String &qn, const Rational &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetQuantumNumberForMatch.
Definition: m_absorptionlines.cc:971
abs_linesSetBaseParameterForMatchingLevel
void abs_linesSetBaseParameterForMatchingLevel(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevel.
Definition: m_absorptionlines.cc:2305
abs_linesChangeBaseParameterForMatchingLevels
void abs_linesChangeBaseParameterForMatchingLevels(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &QID, const String &parameter_name, const Vector &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLevels.
Definition: m_absorptionlines.cc:2272
nlteSetByQuantumIdentifiers
void nlteSetByQuantumIdentifiers(Index &nlte_do, ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const EnergyLevelMap &nlte_field, const Verbosity &)
WORKSPACE METHOD: nlteSetByQuantumIdentifiers.
Definition: m_absorptionlines.cc:2412
abs_lines_per_speciesSetPopulationForSpecies
void abs_lines_per_speciesSetPopulationForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulationForSpecies.
Definition: m_absorptionlines.cc:1510
abs_lines_per_speciesChangeBaseParameterForMatchingLevels
void abs_lines_per_speciesChangeBaseParameterForMatchingLevels(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &QID, const String &parameter_name, const Vector &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLevels.
Definition: m_absorptionlines.cc:2288
abs_lines_per_speciesSetNormalization
void abs_lines_per_speciesSetNormalization(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalization.
Definition: m_absorptionlines.cc:1542
Absorption::ReadFromJplStream
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
Definition: absorptionlines.cc:3310
abs_lines_per_speciesSetLineShapeModelParameterForSpecies
void abs_lines_per_speciesSetLineShapeModelParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &new_value, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeModelParameterForSpecies.
Definition: m_absorptionlines.cc:2159
abs_lines_per_speciesChangeBaseParameterForMatchingLines
void abs_lines_per_speciesChangeBaseParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLines.
Definition: m_absorptionlines.cc:1877
Absorption::id_in_line
bool id_in_line(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
Definition: absorptionlines.cc:2840
abs_linesSetCutoff
void abs_linesSetCutoff(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoff.
Definition: m_absorptionlines.cc:1328
absorptionlines.h
Contains the absorption namespace.
abs_lines_per_speciesSetNormalizationForSpecies
void abs_lines_per_speciesSetNormalizationForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalizationForSpecies.
Definition: m_absorptionlines.cc:1573
abs
#define abs(x)
Definition: legacy_continua.cc:20626
ARTS::Var::verbosity
Verbosity verbosity(Workspace &ws) noexcept
Definition: autoarts.h:7112
ReadJPL
void ReadJPL(ArrayOfAbsorptionLines &abs_lines, const String &jpl_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadJPL.
Definition: m_absorptionlines.cc:651
abs_lines_per_speciesSetNormalizationForMatch
void abs_lines_per_speciesSetNormalizationForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalizationForMatch.
Definition: m_absorptionlines.cc:1563
QuantumNumberType
QuantumNumberType
Enum for Quantum Numbers used for indexing.
Definition: quantum.h:48
abs_linesSetLineShapeType
void abs_linesSetLineShapeType(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeType.
Definition: m_absorptionlines.cc:1595
abs_lines_per_speciesSetMirroring
void abs_lines_per_speciesSetMirroring(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroring.
Definition: m_absorptionlines.cc:1414
abs_linesReadSpeciesSplitCatalog
void abs_linesReadSpeciesSplitCatalog(ArrayOfAbsorptionLines &abs_lines, const String &basename, const Index &robust, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesReadSpeciesSplitCatalog.
Definition: m_absorptionlines.cc:874
LineShape::string2variable
Variable string2variable(const String &type)
Turns predefined strings into a Variable type.
Definition: lineshapemodel.h:246
abs_linesSetEmptyBroadeningParametersToEmpty
void abs_linesSetEmptyBroadeningParametersToEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesSetEmptyBroadeningParametersToEmpty.
Definition: m_absorptionlines.cc:1251
abs_lines_per_speciesSetBaseParameterForMatchingLevel
void abs_lines_per_speciesSetBaseParameterForMatchingLevel(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLevel.
Definition: m_absorptionlines.cc:2366
WriteXML
void WriteXML(const String &file_format, const T &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
WORKSPACE METHOD: WriteXML.
Definition: m_xml.h:118
abs_linesDeleteLinesWithQuantumNumberAbove
void abs_linesDeleteLinesWithQuantumNumberAbove(ArrayOfAbsorptionLines &abs_lines, const String &qn_id, const Index &qn_val, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteLinesWithQuantumNumberAbove.
Definition: m_absorptionlines.cc:1237
ARTS::Var::abs_lines_per_species
ArrayOfArrayOfAbsorptionLines abs_lines_per_species(Workspace &ws) noexcept
Definition: autoarts.h:2022
abs_lines_per_speciesSetPopulation
void abs_lines_per_speciesSetPopulation(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulation.
Definition: m_absorptionlines.cc:1479
abs_linesDeleteBadF0
void abs_linesDeleteBadF0(ArrayOfAbsorptionLines &abs_lines, const Numeric &f0, const Index &lower, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteBadF0.
Definition: m_absorptionlines.cc:1124
open_input_file
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
Definition: file.cc:147
ArtsXMLTag::get_attribute_value
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
Definition: xml_io.cc:153
Absorption::id_in_line_lower
bool id_in_line_lower(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
Definition: absorptionlines.cc:2904
abs_linesTruncateGlobalQuantumNumbers
void abs_linesTruncateGlobalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesTruncateGlobalQuantumNumbers.
Definition: m_absorptionlines.cc:1007
abs_lines_per_speciesSetPopulationForMatch
void abs_lines_per_speciesSetPopulationForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulationForMatch.
Definition: m_absorptionlines.cc:1500
global_data::species_data
const Array< SpeciesRecord > species_data
Species Data.
Definition: partition_function_data.cc:42
CREATE_OUT2
#define CREATE_OUT2
Definition: messages.h:206
string2quantumnumbertype
QuantumNumberType string2quantumnumbertype(const String &s)
Definition: quantum.h:101
Absorption::id_in_line_upper
bool id_in_line_upper(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
Definition: absorptionlines.cc:2877
Absorption::ReadFromArtscat5Stream
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
Definition: absorptionlines.cc:513
abs_linesSetNormalization
void abs_linesSetNormalization(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalization.
Definition: m_absorptionlines.cc:1532
Zeeman::GetAdvancedModel
Model GetAdvancedModel(const QuantumIdentifier &qid) noexcept
Returns an advanced Zeeman model.
Definition: zeemandata.cc:105
abs_lines_per_speciesSetEmpty
void abs_lines_per_speciesSetEmpty(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesSetEmpty.
Definition: m_absorptionlines.cc:2458
abs_lines_per_speciesSetCutoffForSpecies
void abs_lines_per_speciesSetCutoffForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoffForSpecies.
Definition: m_absorptionlines.cc:1381
abs_linesSetBaseParameterForMatchingLines
void abs_linesSetBaseParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &x, const Index &loose_matching, const Verbosity &)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLines.
Definition: m_absorptionlines.cc:1912
ReadSplitARTSCAT
void ReadSplitARTSCAT(ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const Index &ignore_missing, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadSplitARTSCAT.
Definition: m_absorptionlines.cc:326
abs_linesSetNormalizationForMatch
void abs_linesSetNormalizationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalizationForMatch.
Definition: m_absorptionlines.cc:1551
abs_lines_per_speciesSetT0ForSpecies
void abs_lines_per_speciesSetT0ForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetT0ForSpecies.
Definition: m_absorptionlines.cc:1758
ARTS::Var::nlte_field
EnergyLevelMap nlte_field(Workspace &ws) noexcept
Definition: autoarts.h:4604
abs_linesSetMirroringForMatch
void abs_linesSetMirroringForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroringForMatch.
Definition: m_absorptionlines.cc:1423
Array
This can be used to make arrays out of anything.
Definition: array.h:108
xml_io_private.h
This file contains private function declarations and template instantiation to handle XML data files.
NUMERIC_TYPE_DOUBLE
@ NUMERIC_TYPE_DOUBLE
Definition: xml_io.h:43
AbsorptionLines
Absorption::Lines AbsorptionLines
Definition: absorptionlines.h:1850
SpeciesTag
A tag group can consist of the sum of several of these.
Definition: abs_species_tags.h:44
abs_lines_per_speciesSetZeemanCoefficients
void abs_lines_per_speciesSetZeemanCoefficients(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetZeemanCoefficients.
Definition: m_absorptionlines.cc:2522
Absorption::split_list_of_external_lines
std::vector< Lines > split_list_of_external_lines(std::vector< SingleLineExternal > &external_lines, const std::vector< QuantumNumberType > &localquantas={}, const std::vector< QuantumNumberType > &globalquantas={})
Splits a list of lines into proper Lines.
Definition: absorptionlines.cc:2435
Absorption::nelem
Index nelem(const Lines &l)
Number of lines.
Definition: absorptionlines.h:1820
IsValidQuantumNumberName
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
Definition: quantum.cc:164
abs_lines_per_speciesSetLinemixingLimitForMatch
void abs_lines_per_speciesSetLinemixingLimitForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimitForMatch.
Definition: m_absorptionlines.cc:1687
Absorption::ReadFromArtscat3Stream
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
Definition: absorptionlines.cc:155
abs_linesSetT0ForMatch
void abs_linesSetT0ForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0ForMatch.
Definition: m_absorptionlines.cc:1737
abs_lines_per_speciesWriteSpeciesSplitXML
void abs_lines_per_speciesWriteSpeciesSplitXML(const String &output_format, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesWriteSpeciesSplitXML.
Definition: m_absorptionlines.cc:810
min
#define min(a, b)
Definition: legacy_continua.cc:20628
Absorption::CutoffType::None
@ None
xml_read_from_file
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
Definition: xml_io.cc:901
LineShape::modelparameterEmpty
bool modelparameterEmpty(const ModelParameters mp) noexcept
Definition: lineshapemodel.h:313
ReadArrayOfARTSCAT
void ReadArrayOfARTSCAT(ArrayOfAbsorptionLines &abs_lines, const String &artscat_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadArrayOfARTSCAT.
Definition: m_absorptionlines.cc:70
CREATE_OUT3
#define CREATE_OUT3
Definition: messages.h:207
CREATE_OUT0
#define CREATE_OUT0
Definition: messages.h:204
Absorption::ReadFromLBLRTMStream
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
Definition: absorptionlines.cc:1922
QuantumIdentifier::Species
void Species(Index sp)
Set the Species.
Definition: quantum.h:481
ReadMytran2
void ReadMytran2(ArrayOfAbsorptionLines &abs_lines, const String &mytran2_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadMytran2.
Definition: m_absorptionlines.cc:588
ArtsXMLTag::read_from_stream
void read_from_stream(istream &is)
Reads next XML tag.
Definition: xml_io.cc:289
my_basic_string< char >
Absorption::ReadFromHitranOnlineStream
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
Definition: absorptionlines.cc:1171
abs_linesChangeLineShapeModelParameterForMatchingLines
void abs_linesChangeLineShapeModelParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeLineShapeModelParameterForMatchingLines.
Definition: m_absorptionlines.cc:2017
abs_lines_per_speciesChangeLineShapeModelParameterForMatchingLines
void abs_lines_per_speciesChangeLineShapeModelParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeLineShapeModelParameterForMatchingLines.
Definition: m_absorptionlines.cc:2067
abs_linesSetLinemixingLimitForMatch
void abs_linesSetLinemixingLimitForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimitForMatch.
Definition: m_absorptionlines.cc:1676
quantumnumbertype2string
String quantumnumbertype2string(QuantumNumberType s)
Definition: quantum.h:162
LineShape::SingleModelParameter
Numeric & SingleModelParameter(ModelParameters &mp, const String &type)
Get a coefficient from ModelParameters by name.
Definition: lineshapemodel.h:295
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:51
abs_linesChangeBaseParameterForMatchingLines
void abs_linesChangeBaseParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLines.
Definition: m_absorptionlines.cc:1780
abs_lines_per_speciesSetMirroringForMatch
void abs_lines_per_speciesSetMirroringForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroringForMatch.
Definition: m_absorptionlines.cc:1437
QuantumIdentifier::SetTransition
void SetTransition(const QuantumNumbers &upper, const QuantumNumbers &lower)
Set to transition type identifier.
Definition: quantum.cc:229
ReadHITRAN
void ReadHITRAN(ArrayOfAbsorptionLines &abs_lines, const String &hitran_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &hitran_type, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadHITRAN.
Definition: m_absorptionlines.cc:446
ARTS::Var::abs_species
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Definition: autoarts.h:2157
abs_linesSetPopulation
void abs_linesSetPopulation(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulation.
Definition: m_absorptionlines.cc:1469
abs_lines_per_speciesSetLineShapeType
void abs_lines_per_speciesSetLineShapeType(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeType.
Definition: m_absorptionlines.cc:1605
abs_lines_per_speciesSetCutoffForMatch
void abs_lines_per_speciesSetCutoffForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoffForMatch.
Definition: m_absorptionlines.cc:1368
abs_linesReplaceWithLines
void abs_linesReplaceWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &replacing_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesReplaceWithLines.
Definition: m_absorptionlines.cc:1050
string2hitrantype
HitranType string2hitrantype(const String &s)
Definition: m_absorptionlines.cc:431
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:49
SpeciesTag::TYPE_ZEEMAN
@ TYPE_ZEEMAN
Definition: abs_species_tags.h:149
abs_lines_per_speciesSetBaseParameterForMatchingLevels
void abs_lines_per_speciesSetBaseParameterForMatchingLevels(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &QID, const String &parameter_name, const Vector &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLevels.
Definition: m_absorptionlines.cc:2392
linalg::var
void var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the variance of the ranged ys.
Definition: raw.cc:49
global_data.h
ArrayOfArrayOfAbsorptionLines
Array< ArrayOfAbsorptionLines > ArrayOfArrayOfAbsorptionLines
Definition: absorptionlines.h:1852
abs_linesCleanupEmpty
void abs_linesCleanupEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesCleanupEmpty.
Definition: m_absorptionlines.cc:1310
ARTS::Var::f_grid
Vector f_grid(Workspace &ws) noexcept
Definition: autoarts.h:3449
abs_lines_per_speciesChangeBaseParameterForSpecies
void abs_lines_per_speciesChangeBaseParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForSpecies.
Definition: m_absorptionlines.cc:1890
LineShape::Variable
Variable
List of possible shape variables.
Definition: lineshapemodel.h:162
EnergyLevelMap
Definition: energylevelmap.h:60
abs_speciesSet
void abs_speciesSet(ArrayOfArrayOfSpeciesTag &abs_species, Index &abs_xsec_agenda_checked, Index &propmat_clearsky_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesSet.
Definition: m_abs_lookup.cc:1974
ReadLBLRTM
void ReadLBLRTM(ArrayOfAbsorptionLines &abs_lines, const String &lblrtm_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadLBLRTM.
Definition: m_absorptionlines.cc:525
max
#define max(a, b)
Definition: legacy_continua.cc:20629
abs_lines_per_speciesSetLinemixingLimit
void abs_lines_per_speciesSetLinemixingLimit(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimit.
Definition: m_absorptionlines.cc:1667
abs_linesSetZeemanCoefficients
void abs_linesSetZeemanCoefficients(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesSetZeemanCoefficients.
Definition: m_absorptionlines.cc:2512
m_xml.h
Workspace methods and template functions for supergeneric XML IO.
Zeeman::end
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Definition: zeemandata.h:108
abs_linesSetT0
void abs_linesSetT0(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0.
Definition: m_absorptionlines.cc:1719
my_basic_string::nelem
Index nelem() const
Number of elements.
Definition: mystring.h:246
abs_lines_per_speciesCompact
void abs_lines_per_speciesCompact(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Vector &f_grid, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesCompact.
Definition: m_absorptionlines.cc:2486
QuantumIdentifier::Type
constexpr QType Type() const
Definition: quantum.h:526
ENDIAN_TYPE_LITTLE
@ ENDIAN_TYPE_LITTLE
Definition: xml_io.h:44
QuantumIdentifier::LowerQuantumNumbers
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
Definition: quantum.h:592
ARTS::Var::nlte_do
Index nlte_do(Workspace &ws) noexcept
Definition: autoarts.h:4567
abs_lines_per_speciesSetCutoff
void abs_lines_per_speciesSetCutoff(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoff.
Definition: m_absorptionlines.cc:1341
abs_lines_per_speciesSetLineShapeModelParameterForMatchingLines
void abs_lines_per_speciesSetLineShapeModelParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &new_value, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeModelParameterForMatchingLines.
Definition: m_absorptionlines.cc:2144
abs_linesSetCutoffForMatch
void abs_linesSetCutoffForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoffForMatch.
Definition: m_absorptionlines.cc:1351
ARTS::Var::abs_lines
ArrayOfAbsorptionLines abs_lines(Workspace &ws) noexcept
Definition: autoarts.h:2013
abs_linesChangeBaseParameterForMatchingLevel
void abs_linesChangeBaseParameterForMatchingLevel(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &relative, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLevel.
Definition: m_absorptionlines.cc:2186
ReadARTSCAT
void ReadARTSCAT(ArrayOfAbsorptionLines &abs_lines, const String &artscat_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadARTSCAT.
Definition: m_absorptionlines.cc:201
Absorption::ReadFromArtscat4Stream
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
Definition: absorptionlines.cc:317
abs_linesDeleteLinesWithBadOrHighChangingJs
void abs_linesDeleteLinesWithBadOrHighChangingJs(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithBadOrHighChangingJs.
Definition: m_absorptionlines.cc:1209
Absorption::ReadFromHitran2001Stream
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
Definition: absorptionlines.cc:1560
abs_lines_per_speciesChangeLineShapeModelParameterForSpecies
void abs_lines_per_speciesChangeLineShapeModelParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String &parameter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeLineShapeModelParameterForSpecies.
Definition: m_absorptionlines.cc:2083
abs_lines_per_speciesChangeBaseParameterForMatchingLevel
void abs_lines_per_speciesChangeBaseParameterForMatchingLevel(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLevel.
Definition: m_absorptionlines.cc:2260
Absorption::string2normalizationtype
NormalizationType string2normalizationtype(const String &in)
Definition: absorptionlines.h:104
Absorption::ReadFromMytran2Stream
SingleLineExternal ReadFromMytran2Stream(istream &is)
Read from Mytran2 The MYTRAN2 format is as follows (directly taken from the abs_my....
Definition: absorptionlines.cc:2953
SpeciesTag::TYPE_PLAIN
@ TYPE_PLAIN
Definition: abs_species_tags.h:148
abs_lines_per_speciesSetLinemixingLimitForSpecies
void abs_lines_per_speciesSetLinemixingLimitForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimitForSpecies.
Definition: m_absorptionlines.cc:1697
abs_linesWriteSpeciesSplitXML
void abs_linesWriteSpeciesSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSpeciesSplitXML.
Definition: m_absorptionlines.cc:740
abs_lines_per_speciesSetT0
void abs_lines_per_speciesSetT0(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetT0.
Definition: m_absorptionlines.cc:1728
f_gridFromAbsorptionLines
void f_gridFromAbsorptionLines(Vector &f_grid, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &delta_f_low, const Numeric &delta_f_upp, const Index &num_freqs, const Verbosity &)
WORKSPACE METHOD: f_gridFromAbsorptionLines.
Definition: m_absorptionlines.cc:2558
abs_lines_per_speciesSetMirroringForSpecies
void abs_lines_per_speciesSetMirroringForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroringForSpecies.
Definition: m_absorptionlines.cc:1447
abs_lines_per_speciesSetLineShapeTypeForSpecies
void abs_lines_per_speciesSetLineShapeTypeForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeTypeForSpecies.
Definition: m_absorptionlines.cc:1636
LineShape::nVars
constexpr Index nVars
Current max number of line shape variables.
Definition: lineshapemodel.h:356
abs_lines_per_speciesWriteSplitXML
void abs_lines_per_speciesWriteSplitXML(const String &output_format, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesWriteSplitXML.
Definition: m_absorptionlines.cc:786
abs_linesWriteSplitXML
void abs_linesWriteSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSplitXML.
Definition: m_absorptionlines.cc:718
ArtsXMLTag
The ARTS XML tag class.
Definition: xml_io_private.h:90
find_xml_file_existence
bool find_xml_file_existence(String &filename)
As find_xml_file but does not throw in the main body.
Definition: file.cc:452
file.h
This file contains basic functions to handle ASCII files.
abs_lines_per_speciesSetBaseParameterForMatchingLines
void abs_lines_per_speciesSetBaseParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &loose_matching, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLines.
Definition: m_absorptionlines.cc:1984
HitranType::Pre2004
@ Pre2004
abs_linesKeepBands
void abs_linesKeepBands(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &qid, const Index &ignore_spec, const Index &ignore_isot, const Verbosity &)
WORKSPACE METHOD: abs_linesKeepBands.
Definition: m_absorptionlines.cc:1281
abs_lines_per_speciesSetLineShapeTypeForMatch
void abs_lines_per_speciesSetLineShapeTypeForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeTypeForMatch.
Definition: m_absorptionlines.cc:1626
abs_linesSetMirroring
void abs_linesSetMirroring(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroring.
Definition: m_absorptionlines.cc:1404
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
QuantumIdentifier::EnergyLevelQuantumNumbers
const QuantumNumbers & EnergyLevelQuantumNumbers() const noexcept
Return the energy level quantum numbers by const reference.
Definition: quantum.h:617
linspace
std::vector< T > linspace(T s, T e, typename std::vector< T >::size_type count) noexcept
Definition: m_absorptionlines.cc:2539
abs_lines_per_speciesSetT0ForMatch
void abs_lines_per_speciesSetT0ForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetT0ForMatch.
Definition: m_absorptionlines.cc:1748
abs_linesSetLineShapeTypeForMatch
void abs_linesSetLineShapeTypeForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeTypeForMatch.
Definition: m_absorptionlines.cc:1614
Absorption::string2cutofftype
CutoffType string2cutofftype(const String &in)
Definition: absorptionlines.h:213
abs_linesDeleteWithLines
void abs_linesDeleteWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &deleting_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteWithLines.
Definition: m_absorptionlines.cc:1145
abs_linesDeleteLinesWithUndefinedLocalQuanta
void abs_linesDeleteLinesWithUndefinedLocalQuanta(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithUndefinedLocalQuanta.
Definition: m_absorptionlines.cc:1179
HitranType
HitranType
Definition: m_absorptionlines.cc:425
LineShape::string2shapetype
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
Definition: lineshapemodel.h:855
abs_lines_per_speciesSetBaseParameterForSpecies
void abs_lines_per_speciesSetBaseParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String &parameter_name, const Numeric &change, const Index &loose_matching, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForSpecies.
Definition: m_absorptionlines.cc:1996
abs_linesSetLinemixingLimit
void abs_linesSetLinemixingLimit(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimit.
Definition: m_absorptionlines.cc:1658
abs_lines_per_speciesSetQuantumNumberForMatch
void abs_lines_per_speciesSetQuantumNumberForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &qn, const Rational &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetQuantumNumberForMatch.
Definition: m_absorptionlines.cc:996
Vector
The Vector class.
Definition: matpackI.h:860
QuantumIdentifier::In
bool In(const QuantumIdentifier &other) const
Return if this is in other.
Definition: quantum.cc:117
Absorption::PopulationType
PopulationType
Describes the type of population level counter.
Definition: absorptionlines.h:148
abs_linesRemoveUnusedLocalQuantumNumbers
void abs_linesRemoveUnusedLocalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesRemoveUnusedLocalQuantumNumbers.
Definition: m_absorptionlines.cc:1037
string2vecqn
std::vector< QuantumNumberType > string2vecqn(const String &qnstr)
Get a list of quantum numbers from a string.
Definition: m_absorptionlines.cc:47
abs_lines_per_speciesCreateFromLines
void abs_lines_per_speciesCreateFromLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &tgs, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesCreateFromLines.
Definition: m_abs.cc:90
xml_find_and_open_input_file
void xml_find_and_open_input_file(std::shared_ptr< istream > &ifs, const String &filename, const Verbosity &verbosity)
Open plain or zipped xml file.
Definition: xml_io.cc:648
Absorption::string2populationtype
PopulationType string2populationtype(const String &in)
Definition: absorptionlines.h:156
Absorption::ReadFromHitran2004Stream
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
Definition: absorptionlines.cc:752
SpeciesTag::Species
Index Species() const
Molecular species index.
Definition: abs_species_tags.h:64
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:195
Absorption::line_is_id
bool line_is_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier is equal to a line's identifier.
Definition: absorptionlines.cc:2931
Rational
Implements rational numbers to work with other ARTS types.
Definition: rational.h:54
abs_lines_per_speciesReadSplitCatalog
void abs_lines_per_speciesReadSplitCatalog(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesReadSplitCatalog.
Definition: m_absorptionlines.cc:828
abs_linesRemoveBand
void abs_linesRemoveBand(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &qid, const Verbosity &)
WORKSPACE METHOD: abs_linesRemoveBand.
Definition: m_absorptionlines.cc:2496
Absorption::string2mirroringtype
MirroringType string2mirroringtype(const String &in)
Definition: absorptionlines.h:56
abs_linesAppendWithLines
void abs_linesAppendWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &appending_lines, const Index &safe, const Verbosity &)
WORKSPACE METHOD: abs_linesAppendWithLines.
Definition: m_absorptionlines.cc:1081
abs_linesSetBaseParameterForMatchingLevels
void abs_linesSetBaseParameterForMatchingLevels(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &QID, const String &parameter_name, const Vector &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevels.
Definition: m_absorptionlines.cc:2377
abs_linesPrintDefinedQuantumNumbers
void abs_linesPrintDefinedQuantumNumbers(const ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesPrintDefinedQuantumNumbers.
Definition: m_absorptionlines.cc:2605
QuantumIdentifier::UpperQuantumNumbers
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
Definition: quantum.h:587
xml_read_header_from_stream
void xml_read_header_from_stream(istream &is, FileType &ftype, NumericType &ntype, EndianType &etype, const Verbosity &verbosity)
Reads XML header and root tag.
Definition: xml_io.cc:725
QuantumNumberType::J
@ J