ARTS 2.5.9 (git: 825fa5f2)
isotopologues.h
Go to the documentation of this file.
1#ifndef isotopologues_h
2#define isotopologues_h
3
4#include <limits>
5#include <string_view>
6
7#include "enums.h"
8#include "mystring.h"
9#include "nonstd.h"
10#include "species.h"
11
12namespace Species {
13inline constexpr std::string_view Joker = "*";
14
19
21 std::string_view isotname;
22
25
28
29 constexpr explicit IsotopeRecord(Species spec_, const std::string_view isotname_=Joker, Numeric mass_=std::numeric_limits<Numeric>::quiet_NaN(), Index gi_=-1) noexcept
30 : spec(spec_), isotname(isotname_), mass(mass_), gi(gi_) {}
31
32 constexpr IsotopeRecord() noexcept : IsotopeRecord(Species::FINAL) {}
33
34 friend std::ostream& operator<<(std::ostream& os, const IsotopeRecord& ir) {
35 return os << ir.spec << ' ' << ir.isotname << ' ' << ir.mass << ' ' << ir.gi;
36 }
37 constexpr bool operator==(const IsotopeRecord& that) const noexcept {
38 return that.spec == spec and that.isotname == isotname;
39 }
40
42 constexpr bool operator==(const std::string_view specstr) const noexcept {
43 auto lim = specstr.find('-');
44 return (lim not_eq specstr.npos) and (fromShortName(specstr.substr(0, lim)) == spec) and (specstr.substr(lim+1) == isotname);
45 }
46
47 template <typename T> constexpr bool operator!=(T x)const noexcept {return not operator==(x);}
48
49 [[nodiscard]] String FullName() const noexcept {return String(toShortName(spec)) + String("-") + String(isotname);}
50 [[nodiscard]] constexpr bool joker() const noexcept {return isotname == Joker;}
51 [[nodiscard]] constexpr bool OK() const noexcept {return good_enum(spec);}
52};
53
54#define deal_with_spec(SPEC) IsotopeRecord(Species::SPEC),
55
57inline constexpr std::array Isotopologues {
59 deal_with_spec(Water)
60 IsotopeRecord(fromShortName("H2O"), "161", 18.010565, 1),
61 IsotopeRecord(fromShortName("H2O"), "162", 19.016740, 6),
62 IsotopeRecord(fromShortName("H2O"), "171", 19.014780, 6),
63 IsotopeRecord(fromShortName("H2O"), "172", 20.020956, 36),
64 IsotopeRecord(fromShortName("H2O"), "181", 20.014811, 1),
65 IsotopeRecord(fromShortName("H2O"), "182", 21.020985, 6),
66 IsotopeRecord(fromShortName("H2O"), "262", 20.022915, 1),
67 IsotopeRecord(fromShortName("H2O"), "ForeignContCKDMT350"),
68 IsotopeRecord(fromShortName("H2O"), "ForeignContCKDMT400"),
69 IsotopeRecord(fromShortName("H2O"), "ForeignContStandardType"),
70 IsotopeRecord(fromShortName("H2O"), "MPM89"),
71 IsotopeRecord(fromShortName("H2O"), "PWR98"),
72 IsotopeRecord(fromShortName("H2O"), "SelfContCKDMT350"),
73 IsotopeRecord(fromShortName("H2O"), "SelfContCKDMT400"),
74 IsotopeRecord(fromShortName("H2O"), "SelfContStandardType"),
78 deal_with_spec(CarbonDioxide)
79 IsotopeRecord(fromShortName("CO2"), "626", 43.989830, 1),
80 IsotopeRecord(fromShortName("CO2"), "627", 44.994045, 6),
81 IsotopeRecord(fromShortName("CO2"), "628", 45.994076, 1),
82 IsotopeRecord(fromShortName("CO2"), "636", 44.993185, 2),
83 IsotopeRecord(fromShortName("CO2"), "637", 45.997400, 12),
84 IsotopeRecord(fromShortName("CO2"), "638", 46.997431, 2),
85 IsotopeRecord(fromShortName("CO2"), "727", 45.998262, 1),
86 IsotopeRecord(fromShortName("CO2"), "737", 47.001618, 2),
87 IsotopeRecord(fromShortName("CO2"), "827", 46.998291, 6),
88 IsotopeRecord(fromShortName("CO2"), "828", 47.998322, 1),
89 IsotopeRecord(fromShortName("CO2"), "837", 48.001646, 12),
90 IsotopeRecord(fromShortName("CO2"), "838", 49.001675, 2),
91 IsotopeRecord(fromShortName("CO2"), "CKDMT252"),
95 deal_with_spec(Ozone)
96 IsotopeRecord(fromShortName("O3"), "666", 47.984745, 1),
97 IsotopeRecord(fromShortName("O3"), "667", 48.988960, 6),
98 IsotopeRecord(fromShortName("O3"), "668", 49.988991, 1),
99 IsotopeRecord(fromShortName("O3"), "676", 48.988960, 6),
100 IsotopeRecord(fromShortName("O3"), "686", 49.988991, 1),
104 deal_with_spec(NitrogenOxide)
105 IsotopeRecord(fromShortName("N2O"), "446", 44.001062, 9),
106 IsotopeRecord(fromShortName("N2O"), "447", 45.005278, 54),
107 IsotopeRecord(fromShortName("N2O"), "448", 46.005308, 9),
108 IsotopeRecord(fromShortName("N2O"), "456", 44.998096, 6),
109 IsotopeRecord(fromShortName("N2O"), "546", 44.998096, 6),
113 deal_with_spec(CarbonMonoxide)
114 IsotopeRecord(fromShortName("CO"), "26", 27.994915, 1),
115 IsotopeRecord(fromShortName("CO"), "27", 28.999130, 6),
116 IsotopeRecord(fromShortName("CO"), "28", 29.999161, 1),
117 IsotopeRecord(fromShortName("CO"), "36", 28.998270, 2),
118 IsotopeRecord(fromShortName("CO"), "37", 30.002485, 12),
119 IsotopeRecord(fromShortName("CO"), "38", 31.002516, 2),
123 deal_with_spec(Methane)
124 IsotopeRecord(fromShortName("CH4"), "211", 16.031300, 1),
125 IsotopeRecord(fromShortName("CH4"), "212", 17.037475, 3),
126 IsotopeRecord(fromShortName("CH4"), "311", 17.034655, 2),
127 IsotopeRecord(fromShortName("CH4"), "312", 18.040830, 6),
131 deal_with_spec(Oxygen)
132 IsotopeRecord(fromShortName("O2"), "66", 31.989830, 1),
133 IsotopeRecord(fromShortName("O2"), "67", 32.994045, 6),
134 IsotopeRecord(fromShortName("O2"), "68", 33.994076, 1),
135 IsotopeRecord(fromShortName("O2"), "CIAfunCKDMT100"),
136 IsotopeRecord(fromShortName("O2"), "MPM2020"),
137 IsotopeRecord(fromShortName("O2"), "MPM89"),
138 IsotopeRecord(fromShortName("O2"), "PWR98"),
139 IsotopeRecord(fromShortName("O2"), "SelfContStandardType"),
140 IsotopeRecord(fromShortName("O2"), "TRE05"),
141 IsotopeRecord(fromShortName("O2"), "v0v0CKDMT100"),
142 IsotopeRecord(fromShortName("O2"), "v1v0CKDMT100"),
143 IsotopeRecord(fromShortName("O2"), "visCKDMT252"),
147 deal_with_spec(NitricOxide)
148 IsotopeRecord(fromShortName("NO"), "46", 29.997989, 3),
149 IsotopeRecord(fromShortName("NO"), "48", 32.002234, 3),
150 IsotopeRecord(fromShortName("NO"), "56", 30.995023, 2),
154 deal_with_spec(SulfurDioxide)
155 IsotopeRecord(fromShortName("SO2"), "626", 63.961901, 1),
156 IsotopeRecord(fromShortName("SO2"), "628", 65.966146, 1),
157 IsotopeRecord(fromShortName("SO2"), "636", 64.961286, 4),
158 IsotopeRecord(fromShortName("SO2"), "646", 65.957695, 1),
162 deal_with_spec(NitrogenDioxide)
163 IsotopeRecord(fromShortName("NO2"), "646", 45.992904, 3),
164 IsotopeRecord(fromShortName("NO2"), "656", 46.989938, 2),
168 deal_with_spec(Ammonia)
169 IsotopeRecord(fromShortName("NH3"), "4111", 17.026549, 3),
170 IsotopeRecord(fromShortName("NH3"), "4112", 18), // FIXME: Better mass and some gj?
171 IsotopeRecord(fromShortName("NH3"), "5111", 18.023583, 2),
175 deal_with_spec(NitricAcid)
176 IsotopeRecord(fromShortName("HNO3"), "146", 62.995644, 6),
177 IsotopeRecord(fromShortName("HNO3"), "156", 63.992680, 4),
181 deal_with_spec(Hydroxyl)
182 IsotopeRecord(fromShortName("OH"), "61", 17.002740, 2),
183 IsotopeRecord(fromShortName("OH"), "62", 18.008915, 3),
184 IsotopeRecord(fromShortName("OH"), "81", 19.006986, 2),
188 deal_with_spec(HydrogenFluoride)
189 IsotopeRecord(fromShortName("HF"), "19", 20.006229, 4),
190 IsotopeRecord(fromShortName("HF"), "29", 21.012404, 6),
194 deal_with_spec(HydrogenChloride)
195 IsotopeRecord(fromShortName("HCl"), "15", 35.976678, 8),
196 IsotopeRecord(fromShortName("HCl"), "17", 37.973729, 8),
197 IsotopeRecord(fromShortName("HCl"), "25", 36.982853, 12),
198 IsotopeRecord(fromShortName("HCl"), "27", 38.979904, 12),
202 deal_with_spec(HydrogenBromide)
203 IsotopeRecord(fromShortName("HBr"), "11", 81.924115, 8),
204 IsotopeRecord(fromShortName("HBr"), "19", 79.926160, 8),
205 IsotopeRecord(fromShortName("HBr"), "21", 82.930289, 12),
206 IsotopeRecord(fromShortName("HBr"), "29", 80.932336, 12),
210 deal_with_spec(HydrogenIodide)
211 IsotopeRecord(fromShortName("HI"), "17", 127.912297, 12),
212 IsotopeRecord(fromShortName("HI"), "27", 128.918472, 18),
216 deal_with_spec(ChlorineMonoxide)
217 IsotopeRecord(fromShortName("ClO"), "56", 50.963768, 4),
218 IsotopeRecord(fromShortName("ClO"), "76", 52.960819, 4),
222 deal_with_spec(CarbonylSulfide)
223 IsotopeRecord(fromShortName("OCS"), "622", 59.966986, 1),
224 IsotopeRecord(fromShortName("OCS"), "623", 60.966371, 4),
225 IsotopeRecord(fromShortName("OCS"), "624", 61.962780, 1),
226 IsotopeRecord(fromShortName("OCS"), "632", 60.970341, 2),
227 IsotopeRecord(fromShortName("OCS"), "634", 62.966137, 2),
228 IsotopeRecord(fromShortName("OCS"), "822", 61.971231, 1),
232 deal_with_spec(Formaldehyde)
233 IsotopeRecord(fromShortName("H2CO"), "126", 30.010565, 1),
234 IsotopeRecord(fromShortName("H2CO"), "128", 32.014811, 1),
235 IsotopeRecord(fromShortName("H2CO"), "136", 31.013920, 2),
239 deal_with_spec(HeavyFormaldehyde)
240 IsotopeRecord(fromShortName("HDCO"), "26", 31), // FIXME: Better mass and some gj? What is the AFGL code???
244 deal_with_spec(VeryHeavyFormaldehyde)
245 IsotopeRecord(fromShortName("D2CO"), "26", 32), // FIXME: Better mass and some gj? What is the AFGL code???
249 deal_with_spec(HypochlorousAcid)
250 IsotopeRecord(fromShortName("HOCl"), "165", 51.971593, 8),
251 IsotopeRecord(fromShortName("HOCl"), "167", 53.968644, 8),
255 deal_with_spec(Nitrogen)
256 IsotopeRecord(fromShortName("N2"), "44", 28.006148, 1),
257 IsotopeRecord(fromShortName("N2"), "45", 29.003182, 6),
258 IsotopeRecord(fromShortName("N2"), "CIAfunCKDMT252"),
259 IsotopeRecord(fromShortName("N2"), "CIArotCKDMT252"),
260 IsotopeRecord(fromShortName("N2"), "SelfContStandardType"),
264 deal_with_spec(HydrogenCyanide)
265 IsotopeRecord(fromShortName("HCN"), "124", 27.010899, 6),
266 IsotopeRecord(fromShortName("HCN"), "125", 28.007933, 4),
267 IsotopeRecord(fromShortName("HCN"), "134", 28.014254, 12),
268 IsotopeRecord(fromShortName("HCN"), "224", 28), // FIXME: Better mass and some gj?
272 deal_with_spec(Chloromethane)
273 IsotopeRecord(fromShortName("CH3Cl"), "215", 49.992328, 4),
274 IsotopeRecord(fromShortName("CH3Cl"), "217", 51.989379, 4),
278 deal_with_spec(HydrogenPeroxide)
279 IsotopeRecord(fromShortName("H2O2"), "1661", 34.005480, 1),
283 deal_with_spec(Acetylene)
284 IsotopeRecord(fromShortName("C2H2"), "1221", 26.015650, 1),
285 IsotopeRecord(fromShortName("C2H2"), "1222", 27.021825, 6),
286 IsotopeRecord(fromShortName("C2H2"), "1231", 27.019005, 8),
290 deal_with_spec(Ethane)
291 IsotopeRecord(fromShortName("C2H6"), "1221", 30.046950, 1),
292 IsotopeRecord(fromShortName("C2H6"), "1231", 31.050305, 2),
296 deal_with_spec(Phosphine)
297 IsotopeRecord(fromShortName("PH3"), "1111", 33.997238, 2),
301 deal_with_spec(CarbonylFluoride)
302 IsotopeRecord(fromShortName("COF2"), "269", 65.991722, 1),
303 IsotopeRecord(fromShortName("COF2"), "369", 66.995083, 2),
307 deal_with_spec(SulfurHexafluoride)
308 IsotopeRecord(fromShortName("SF6"), "29", 145.962492, 1),
312 deal_with_spec(HydrogenSulfide)
313 IsotopeRecord(fromShortName("H2S"), "121", 33.987721, 1),
314 IsotopeRecord(fromShortName("H2S"), "122", 35), // FIXME: Better mass and some gj?
315 IsotopeRecord(fromShortName("H2S"), "131", 34.987105, 4),
316 IsotopeRecord(fromShortName("H2S"), "141", 35.983515, 1),
320 deal_with_spec(FormicAcid)
321 IsotopeRecord(fromShortName("HCOOH"), "126", 46.005480, 4),
322 IsotopeRecord(fromShortName("HCOOH"), "136", 47), // FIXME: Better mass and some gj?
326 deal_with_spec(LeftHeavyFormicAcid)
327 IsotopeRecord(fromShortName("DCOOH"), "266", 47), // FIXME: Better mass and some gj? What is the AFGL code???
331 deal_with_spec(RightHeavyFormicAcid)
332 IsotopeRecord(fromShortName("HCOOD"), "266", 47), // FIXME: Better mass and some gj? What is the AFGL code???
336 deal_with_spec(Hydroperoxyl)
337 IsotopeRecord(fromShortName("HO2"), "166", 32.997655, 2),
341 deal_with_spec(OxygenAtom)
342 IsotopeRecord(fromShortName("O"), "6", 15.994915, 1),
346 deal_with_spec(ChlorineNitrate)
347 IsotopeRecord(fromShortName("ClONO2"), "5646", 96.956672, 12),
348 IsotopeRecord(fromShortName("ClONO2"), "7646", 98.953723, 12),
352 deal_with_spec(NitricOxideCation)
353 IsotopeRecord(fromShortName("NO+"), "46", 29.997989, 3),
357 deal_with_spec(ChlorineDioxide)
358 IsotopeRecord(fromShortName("OClO"), "656", 67), // FIXME: Better mass and some gj?
359 IsotopeRecord(fromShortName("OClO"), "676", 69), // FIXME: Better mass and some gj?
363 deal_with_spec(BromineMonoxide)
364 IsotopeRecord(fromShortName("BrO"), "16", 97), // FIXME: Better mass and some gj?
365 IsotopeRecord(fromShortName("BrO"), "96", 95), // FIXME: Better mass and some gj?
369 deal_with_spec(SulfuricAcid)
370 IsotopeRecord(fromShortName("H2SO4"), "126", 98), // FIXME: Better mass and some gj?
374 deal_with_spec(ChlorineMonoxideDimer)
375 IsotopeRecord(fromShortName("Cl2O2"), "565", 102), // FIXME: Better mass and some gj?
376 IsotopeRecord(fromShortName("Cl2O2"), "765", 104), // FIXME: Better mass and some gj?
380 deal_with_spec(HypobromousAcid)
381 IsotopeRecord(fromShortName("HOBr"), "161", 97.919027, 8),
382 IsotopeRecord(fromShortName("HOBr"), "169", 95.921076, 8),
386 deal_with_spec(Ethylene)
387 IsotopeRecord(fromShortName("C2H4"), "221", 28.031300, 1),
388 IsotopeRecord(fromShortName("C2H4"), "231", 29.034655, 2),
392 deal_with_spec(Methanol)
393 IsotopeRecord(fromShortName("CH3OH"), "2161", 32.026215, 2),
397 deal_with_spec(Bromomethane)
398 IsotopeRecord(fromShortName("CH3Br"), "211", 95.939764, 4),
399 IsotopeRecord(fromShortName("CH3Br"), "219", 93.941811, 4),
403 deal_with_spec(Acetonitrile)
404 IsotopeRecord(fromShortName("CH3CN"), "2124", 41.026549, 3),
405 IsotopeRecord(fromShortName("CH3CN"), "2125", 42), // FIXME: Better mass and some gj?
406 IsotopeRecord(fromShortName("CH3CN"), "2134", 42), // FIXME: Better mass and some gj?
407 IsotopeRecord(fromShortName("CH3CN"), "3124", 42), // FIXME: Better mass and some gj?
411 deal_with_spec(HeavyAcetonitrile)
412 IsotopeRecord(fromShortName("CH2DCN"), "224", 42), // FIXME: Better mass and some gj? What is the AFGL code???
416 deal_with_spec(CarbonTetrafluoride)
417 IsotopeRecord(fromShortName("CF4"), "29", 87.993616, 1),
421 deal_with_spec(Diacetylene)
422 IsotopeRecord(fromShortName("C4H2"), "2211", 50.015650, 1),
426 deal_with_spec(Cyanoacetylene)
427 IsotopeRecord(fromShortName("HC3N"), "12224", 51.010899, 6),
428 IsotopeRecord(fromShortName("HC3N"), "12225", 52), // FIXME: Better mass and some gj?
429 IsotopeRecord(fromShortName("HC3N"), "12234", 52), // FIXME: Better mass and some gj?
430 IsotopeRecord(fromShortName("HC3N"), "12324", 52), // FIXME: Better mass and some gj?
431 IsotopeRecord(fromShortName("HC3N"), "13224", 52), // FIXME: Better mass and some gj?
432 IsotopeRecord(fromShortName("HC3N"), "22224", 52), // FIXME: Better mass and some gj?
436 deal_with_spec(Hydrogen)
437 IsotopeRecord(fromShortName("H2"), "11", 2.015650, 1),
438 IsotopeRecord(fromShortName("H2"), "12", 3.021825, 6),
442 deal_with_spec(CarbonMonosulfide)
443 IsotopeRecord(fromShortName("CS"), "22", 43.971036, 1),
444 IsotopeRecord(fromShortName("CS"), "23", 44.970399, 4),
445 IsotopeRecord(fromShortName("CS"), "24", 45.966787, 1),
446 IsotopeRecord(fromShortName("CS"), "32", 44.974368, 2),
450 deal_with_spec(HydrogenIsocyanide)
451 IsotopeRecord(fromShortName("HNC"), "142", 27), // FIXME: Better mass and some gj?
452 IsotopeRecord(fromShortName("HNC"), "143", 28), // FIXME: Better mass and some gj?
453 IsotopeRecord(fromShortName("HNC"), "152", 28), // FIXME: Better mass and some gj?
454 IsotopeRecord(fromShortName("HNC"), "242", 28), // FIXME: Better mass and some gj?
458 deal_with_spec(SulfurMonoxide)
459 IsotopeRecord(fromShortName("SO"), "26", 47.966986, 1),
460 IsotopeRecord(fromShortName("SO"), "28", 49.971231, 1),
461 IsotopeRecord(fromShortName("SO"), "46", 49.962782, 1),
465 deal_with_spec(Propane)
466 IsotopeRecord(fromShortName("C3H8"), "21", 54), // FIXME: Better mass and some gj?
470 deal_with_spec(HydrogenAtom)
471 IsotopeRecord(fromShortName("H"), "1", 1), // FIXME: Better mass and some gj?
475 deal_with_spec(Helium)
476 IsotopeRecord(fromShortName("He"), "4", 4), // FIXME: Better mass and some gj?
480 deal_with_spec(Argon)
481 IsotopeRecord(fromShortName("Ar"), "8", 39.948), // FIXME: Better mass and some gj?
485 deal_with_spec(SulfurTrioxide)
486 IsotopeRecord(fromShortName("SO3"), "26", 79.956820, 1),
490 deal_with_spec(Cyanogen)
491 IsotopeRecord(fromShortName("C2N2"), "4224", 52.006148, 1),
495 deal_with_spec(Phosgene)
496 IsotopeRecord(fromShortName("COCl2"), "2655", 97.932620, 1),
497 IsotopeRecord(fromShortName("COCl2"), "2657", 99.929670, 16),
501 deal_with_spec(CarbonDisulfide)
502 IsotopeRecord(fromShortName("CS2"), "222", 75.944140, 1),
503 IsotopeRecord(fromShortName("CS2"), "223", 76.943256, 4),
504 IsotopeRecord(fromShortName("CS2"), "224", 77.939940, 1),
505 IsotopeRecord(fromShortName("CS2"), "232", 76.947495, 2),
508 deal_with_spec(Methyl)
509 deal_with_spec(Cyclopropene)
510 deal_with_spec(Hexafluoroethane)
511 deal_with_spec(Perfluoropropane)
512 deal_with_spec(Perfluorobutane)
513 deal_with_spec(Perfluoropentane)
514 deal_with_spec(Perfluorohexane)
515 deal_with_spec(Perfluorooctane)
516 deal_with_spec(Perfluorocyclobutane)
517 deal_with_spec(CarbonTetrachloride)
518 deal_with_spec(CFC11)
519 deal_with_spec(CFC113)
520 deal_with_spec(CFC114)
521 deal_with_spec(CFC115)
522 deal_with_spec(CFC12)
523 deal_with_spec(Dichloromethane)
524 deal_with_spec(Trichloroethane)
525 deal_with_spec(Trichloromethane)
526 deal_with_spec(Bromochlorodifluoromethane)
527 deal_with_spec(Bromotrifluoromethane)
528 deal_with_spec(Dibromotetrafluoroethane)
529 deal_with_spec(HCFC141b)
530 deal_with_spec(HCFC142b)
531 deal_with_spec(HCFC22)
532 deal_with_spec(HFC125)
533 deal_with_spec(HFC134a)
534 deal_with_spec(HFC143a)
535 deal_with_spec(HFC152a)
536 deal_with_spec(HFC227ea)
537 deal_with_spec(HFC23)
538 deal_with_spec(HFC236fa)
539 deal_with_spec(HFC245fa)
540 deal_with_spec(HFC32)
541 deal_with_spec(HFC365mfc)
542
543
544 deal_with_spec(NitrogenTrifluoride)
545 IsotopeRecord(fromShortName("NF3"), "4999", 70.998286, 3),
548 deal_with_spec(SulfurylFluoride)
549 deal_with_spec(HFC4310mee)
550
551
552 deal_with_spec(Germane)
553 IsotopeRecord(fromShortName("GeH4"), "011", 73.955550, 1),
554 IsotopeRecord(fromShortName("GeH4"), "211", 75.953380, 1),
555 IsotopeRecord(fromShortName("GeH4"), "311", 76.954764, 10),
556 IsotopeRecord(fromShortName("GeH4"), "411", 77.952479, 1),
557 IsotopeRecord(fromShortName("GeH4"), "611", 79.952703, 1),
561 deal_with_spec(Iodomethane)
562 IsotopeRecord(fromShortName("CH3I"), "217", 141.927947, 6),
566 deal_with_spec(Fluoromethane)
567 IsotopeRecord(fromShortName("CH3F"), "219", 34.021878, 2),
571 deal_with_spec(liquidcloud)
572 IsotopeRecord(Species::liquidcloud, "ELL07"),
573 deal_with_spec(icecloud)
574 deal_with_spec(rain)
575 deal_with_spec(free_electrons)
576 deal_with_spec(particles)
578};
579
580#undef deal_with_spec
581
582consteval std::array<std::size_t, std::size_t(Species::FINAL)+1> start_positions() noexcept {
583 std::array<bool, std::size_t(Species::FINAL)> found{};
584 for (auto& x: found) x = false;
585
586 std::array<std::size_t, std::size_t(Species::FINAL)+1> out{};
587 for (auto& x: out) x = Isotopologues.size();
588
589 for (std::size_t i=0; i<Isotopologues.size(); i++) {
590 const auto ind = std::size_t(Isotopologues[i].spec);
591 if (not found[ind]) {
592 found[ind] = true;
593 out[ind] = i;
594 }
595 }
596 return out;
597}
598
599inline constexpr auto IsotopologuesStart = start_positions();
600
601template <Species spec>
602consteval std::size_t count_isotopologues() noexcept {
603 return IsotopologuesStart[std::size_t(spec) + 1] - IsotopologuesStart[std::size_t(spec)];
604}
605
606template <Species spec>
607consteval std::array<IsotopeRecord, count_isotopologues<spec>()> isotopologues() noexcept {
608 static_assert(count_isotopologues<spec>() not_eq 0, "All species must be defined in the Isotopologues!");
609 std::array<IsotopeRecord, count_isotopologues<spec>()> isots;
610 for (std::size_t i=0; i<count_isotopologues<spec>(); i++) {
611 isots[i] = Isotopologues[i + IsotopologuesStart[std::size_t(spec)]];
612 }
613 return isots;
614}
615
617
618constexpr Index find_species_index(const Species spec,
619 const std::string_view isot) noexcept {
620 if (good_enum(spec)) {
621 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
622 if (isot == Isotopologues[i].isotname) {
623 return i;
624 }
625 }
626 }
627 return -1;
628}
629
630
631constexpr Index find_species_index(const IsotopeRecord ir) noexcept {
632 return find_species_index(ir.spec, ir.isotname);
633}
634
635constexpr Index find_species_index(const std::string_view spec,
636 const std::string_view isot) noexcept {
637 return find_species_index(fromShortName(spec), isot);
638}
639
640constexpr Index find_species_index(std::string_view s) {
641 auto minus = s.find('-');
642 return find_species_index(s.substr(0, minus), s.substr(minus+1));
643}
644
645constexpr const IsotopeRecord& select(Species spec, const std::string_view isotname) noexcept {
646 return Isotopologues[find_species_index(spec, isotname)];
647}
648
649constexpr const IsotopeRecord& select(const std::string_view spec,
650 const std::string_view isotname) noexcept {
651 return Isotopologues[find_species_index(spec, isotname)];
652}
653
654constexpr const IsotopeRecord& select_joker(Species spec) noexcept {
655 return select(spec, Joker);
656}
657
658constexpr const IsotopeRecord& select_joker(std::string_view spec) noexcept {
659 return select(fromShortName(spec), Joker);
660}
661
663
664constexpr bool is_predefined_model(const IsotopeRecord& ir) noexcept {
665 return not (nonstd::isdigit(ir.isotname[0]) or ir.isotname == Joker);
666}
667
668constexpr bool is_normal_isotopologue(const IsotopeRecord& ir) noexcept {
669 return nonstd::isdigit(ir.isotname[0]) and ir.isotname not_eq Joker;
670}
671
673
674constexpr bool same_or_joker(const IsotopeRecord& ir1, const IsotopeRecord& ir2) noexcept {
675 if (ir1.spec not_eq ir2.spec) return false;
676 if (ir1.joker() or ir2.joker()) return true;
677 return ir1.isotname == ir2.isotname;
678}
679
681 static constexpr Index maxsize = Index(Isotopologues.size());
682 std::array<Numeric, maxsize> data;
683
684 constexpr IsotopologueRatios() noexcept : data() {
685 for (auto& x: data) x = std::numeric_limits<Numeric>::quiet_NaN();
686 }
687
688 constexpr Numeric operator[](const Index spec_ind) const ARTS_NOEXCEPT {
689 ARTS_ASSERT(spec_ind < maxsize and spec_ind >= 0)
690 return data[spec_ind];
691 }
692
693 constexpr Numeric operator[](const IsotopeRecord& ir) const {
694 const Index spec_ind = find_species_index(ir);
695 ARTS_USER_ERROR_IF(spec_ind >= maxsize or spec_ind < 0,
696 "Cannot understand: ", ir.FullName(), " as a valid species")
697 return data[spec_ind];
698 }
699
700 friend std::ostream& operator<<(std::ostream& os, const IsotopologueRatios& iso_rat) {
701 for (size_t i=0; i<iso_rat.maxsize; i++) {
702 if (i not_eq 0)
703 os << '\n';
704 os << Isotopologues[i].FullName() << ' ' << iso_rat.data[i];
705 }
706 return os;
707 }
708
709 [[nodiscard]] constexpr bool all_isotopes_have_a_value() const noexcept {
710 for (Index i=0; i<maxsize; i++) {
711 if (not is_predefined_model(Isotopologues[i]) and not Isotopologues[i].joker() and nonstd::isnan(data[i])) {
712 return false;
713 }
714 }
715 return true;
716 }
717};
718
720 IsotopologueRatios isotopologue_ratios;
721
722 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O", ISOT)] = VAL
723 set_isot_val("161", .997317E+00);
724 set_isot_val("181", 1.99983E-03);
725 set_isot_val("171", 3.71884E-04);
726 set_isot_val("162", 3.10693E-04);
727 set_isot_val("182", 6.23003E-07);
728 set_isot_val("172", 1.15853E-07);
729 set_isot_val("262", 2.41970E-08);
730 #undef set_isot_val
731
732 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO2", ISOT)] = VAL
733 set_isot_val("626", .984204E+00);
734 set_isot_val("636", 1.10574E-02);
735 set_isot_val("628", 3.94707E-03);
736 set_isot_val("627", 7.33989E-04);
737 set_isot_val("638", 4.43446E-05);
738 set_isot_val("637", 8.24623E-06);
739 set_isot_val("828", 3.95734E-06);
740 set_isot_val("827", 1.47180E-06);
741 set_isot_val("727", 1.36847E-07);
742 set_isot_val("838", 4.44600E-08);
743 set_isot_val("837", 1.65354E-08);
744 set_isot_val("737", 1.53750E-09);
745 #undef set_isot_val
746
747 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O3", ISOT)] = VAL
748 set_isot_val("666", .992901E+00);
749 set_isot_val("668", 3.98194E-03);
750 set_isot_val("686", 1.99097E-03);
751 set_isot_val("667", 7.40475E-04);
752 set_isot_val("676", 3.70237E-04);
753 #undef set_isot_val
754
755 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2O", ISOT)] = VAL
756 set_isot_val("446", .990333E+00);
757 set_isot_val("456", 3.64093E-03);
758 set_isot_val("546", 3.64093E-03);
759 set_isot_val("448", 1.98582E-03);
760 set_isot_val("447", 3.69280E-04);
761 #undef set_isot_val
762
763 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO", ISOT)] = VAL
764 set_isot_val("26", .986544E+00);
765 set_isot_val("36", 1.10836E-02);
766 set_isot_val("28", 1.97822E-03);
767 set_isot_val("27", 3.67867E-04);
768 set_isot_val("38", 2.22250E-05);
769 set_isot_val("37", 4.13292E-06);
770 #undef set_isot_val
771
772 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH4", ISOT)] = VAL
773 set_isot_val("211", .988274E+00);
774 set_isot_val("311", 1.11031E-02);
775 set_isot_val("212", 6.15751E-04);
776 set_isot_val("312", 6.91785E-06);
777 #undef set_isot_val
778
779 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O2", ISOT)] = VAL
780 set_isot_val("66", .995262E+00);
781 set_isot_val("68", 3.99141E-03);
782 set_isot_val("67", 7.42235E-04);
783 #undef set_isot_val
784
785 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO", ISOT)] = VAL
786 set_isot_val("46", .993974E+00);
787 set_isot_val("56", 3.65431E-03);
788 set_isot_val("48", 1.99312E-03);
789 #undef set_isot_val
790
791 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO2", ISOT)] = VAL
792 set_isot_val("626", .945678E+00);
793 set_isot_val("646", 4.19503E-02);
794 set_isot_val("636", 0.0074989421);
795 set_isot_val("628", 0.0020417379);
796 #undef set_isot_val
797
798 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO2", ISOT)] = VAL
799 set_isot_val("646", .991616E+00);
800 set_isot_val("656", 3.64564E-03);
801 #undef set_isot_val
802
803 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NH3", ISOT)] = VAL
804 set_isot_val("4111", .995872E+00);
805 set_isot_val("5111", 3.66129E-03);
806 set_isot_val("4112", 0.00044792294);
807 #undef set_isot_val
808
809 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNO3", ISOT)] = VAL
810 set_isot_val("146", .989110E+00);
811 set_isot_val("156", 3.63600E-03);
812 #undef set_isot_val
813
814 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OH", ISOT)] = VAL
815 set_isot_val("61", .997473E+00);
816 set_isot_val("81", 2.00014E-03);
817 set_isot_val("62", 1.55371E-04);
818 #undef set_isot_val
819
820 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HF", ISOT)] = VAL
821 set_isot_val("19", .999844E+00);
822 set_isot_val("29", 1.55741E-04);
823 #undef set_isot_val
824
825 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCl", ISOT)] = VAL
826 set_isot_val("15", .757587E+00);
827 set_isot_val("17", .242257E+00);
828 set_isot_val("25", 1.18005E-04);
829 set_isot_val("27", 3.77350E-05);
830 #undef set_isot_val
831
832 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HBr", ISOT)] = VAL
833 set_isot_val("19", .506781E+00);
834 set_isot_val("11", .493063E+00);
835 set_isot_val("29", 7.89384E-05);
836 set_isot_val("21", 7.68016E-05);
837 #undef set_isot_val
838
839 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HI", ISOT)] = VAL
840 set_isot_val("17", .999844E+00);
841 set_isot_val("27", 1.55741E-04);
842 #undef set_isot_val
843
844 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClO", ISOT)] = VAL
845 set_isot_val("56", .755908E+00);
846 set_isot_val("76", .241720E+00);
847 #undef set_isot_val
848
849 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OCS", ISOT)] = VAL
850 set_isot_val("622", .937395E+00);
851 set_isot_val("624", 4.15828E-02);
852 set_isot_val("632", 1.05315E-02);
853 set_isot_val("623", 7.39908E-03);
854 set_isot_val("822", 1.87967E-03);
855 set_isot_val("634", 4.67508E-04);
856 #undef set_isot_val
857
858 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2CO", ISOT)] = VAL
859 set_isot_val("126", .986237E+00);
860 set_isot_val("136", 1.10802E-02);
861 set_isot_val("128", 1.97761E-03);
862 #undef set_isot_val
863
864 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HDCO", ISOT)] = VAL
865 set_isot_val("26", 0.00029578940);
866 #undef set_isot_val
867
868 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("D2CO", ISOT)] = VAL
869 set_isot_val("26", 2.2181076E-08);
870 #undef set_isot_val
871
872 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOCl", ISOT)] = VAL
873 set_isot_val("165", .755790E+00);
874 set_isot_val("167", .241683E+00);
875 #undef set_isot_val
876
877 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2", ISOT)] = VAL
878 set_isot_val("44", .992687E+00);
879 set_isot_val("45", 7.47809E-03);
880 #undef set_isot_val
881
882 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCN", ISOT)] = VAL
883 set_isot_val("124", .985114E+00);
884 set_isot_val("134", 1.10676E-02);
885 set_isot_val("125", 3.62174E-03);
886 set_isot_val("224", 0.00014773545);
887 #undef set_isot_val
888
889 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Cl", ISOT)] = VAL
890 set_isot_val("215", .748937E+00);
891 set_isot_val("217", .239491E+00);
892 #undef set_isot_val
893
894 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O2", ISOT)] = VAL
895 set_isot_val("1661", .994952E+00);
896 #undef set_isot_val
897
898 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H2", ISOT)] = VAL
899 set_isot_val("1221", .977599E+00);
900 set_isot_val("1231", 2.19663E-02);
901 set_isot_val("1222", 3.04550E-04);
902 #undef set_isot_val
903
904 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H6", ISOT)] = VAL
905 set_isot_val("1221", .976990E+00);
906 set_isot_val("1231", 2.19526E-02);
907 #undef set_isot_val
908
909 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("PH3", ISOT)] = VAL
910 set_isot_val("1111", .999533E+00);
911 #undef set_isot_val
912
913 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COF2", ISOT)] = VAL
914 set_isot_val("269", .986544E+00);
915 set_isot_val("369", 1.10834E-02);
916 #undef set_isot_val
917
918 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SF6", ISOT)] = VAL
919 set_isot_val("29", .950180E+00);
920 #undef set_isot_val
921
922 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2S", ISOT)] = VAL
923 set_isot_val("121", .949884E+00);
924 set_isot_val("141", 4.21369E-02);
925 set_isot_val("131", 7.49766E-03);
926 set_isot_val("122", 0.00029991625);
927 #undef set_isot_val
928
929 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOH", ISOT)] = VAL
930 set_isot_val("126", .983898E+00);
931 set_isot_val("136", 0.010913149);
932 #undef set_isot_val
933
934 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("DCOOH", ISOT)] = VAL
935 set_isot_val("266", 0.00014755369);
936 #undef set_isot_val
937
938 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOD", ISOT)] = VAL
939 set_isot_val("266", 0.00014755369);
940 #undef set_isot_val
941
942 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HO2", ISOT)] = VAL
943 set_isot_val("166", .995107E+00);
944 #undef set_isot_val
945
946 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O", ISOT)] = VAL
947 set_isot_val("6", .997628E+00);
948 #undef set_isot_val
949
950 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClONO2", ISOT)] = VAL
951 set_isot_val("5646", .749570E+00);
952 set_isot_val("7646", .239694E+00);
953 #undef set_isot_val
954
955 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO+", ISOT)] = VAL
956 set_isot_val("46", .993974E+00);
957 #undef set_isot_val
958
959 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OClO", ISOT)] = VAL
960 set_isot_val("656", 0.75509223);
961 set_isot_val("676", 0.24490632);
962 #undef set_isot_val
963
964 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("BrO", ISOT)] = VAL
965 set_isot_val("96", 0.50582466);
966 set_isot_val("16", 0.49431069);
967 #undef set_isot_val
968
969 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2SO4", ISOT)] = VAL
970 set_isot_val("126", 0.95060479);
971 #undef set_isot_val
972
973 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Cl2O2", ISOT)] = VAL
974 set_isot_val("565", 0.57016427);
975 set_isot_val("765", 0.36982818);
976 #undef set_isot_val
977
978 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOBr", ISOT)] = VAL
979 set_isot_val("169", .505579E+00);
980 set_isot_val("161", .491894E+00);
981 #undef set_isot_val
982
983 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H4", ISOT)] = VAL
984 set_isot_val("221", .977294E+00);
985 set_isot_val("231", .219595E-01);
986 #undef set_isot_val
987
988 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3OH", ISOT)] = VAL
989 set_isot_val("2161", .985930E+00);
990 #undef set_isot_val
991
992 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Br", ISOT)] = VAL
993 set_isot_val("219", .500995E+00);
994 set_isot_val("211", .487433E+00);
995 #undef set_isot_val
996
997 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3CN", ISOT)] = VAL
998 set_isot_val("2124", .973866E+00);
999 set_isot_val("3124", .102683e-01);
1000 set_isot_val("2134", .102683e-01);
1001 set_isot_val("2125", .347136e-02);
1002 #undef set_isot_val
1003
1004 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH2DCN", ISOT)] = VAL
1005 set_isot_val("224", .441185e-03);
1006 #undef set_isot_val
1007
1008 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CF4", ISOT)] = VAL
1009 set_isot_val("29", .988890E+00);
1010 #undef set_isot_val
1011
1012 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HC3N", ISOT)] = VAL
1013 set_isot_val("12224", .963346E+00);
1014 set_isot_val("12234", .106852e-01);
1015 set_isot_val("12324", .106852e-01);
1016 set_isot_val("13224", .106852e-01);
1017 set_isot_val("12225", .356272e-02);
1018 set_isot_val("22224", .144472e-03);
1019 #undef set_isot_val
1020
1021 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS", ISOT)] = VAL
1022 set_isot_val("22", .939624E+00);
1023 set_isot_val("24", .416817E-01);
1024 set_isot_val("32", .105565E-01);
1025 set_isot_val("23", .741668E-02);
1026 #undef set_isot_val
1027
1028 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNC", ISOT)] = VAL
1029 set_isot_val("142", .985280e+00);
1030 set_isot_val("143", .109285e-01);
1031 set_isot_val("152", .364384e-02);
1032 set_isot_val("242", .147761e-03);
1033 #undef set_isot_val
1034
1035 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO", ISOT)] = VAL
1036 set_isot_val("26", .950605e+00);
1037 set_isot_val("46", .420727e-01);
1038 set_isot_val("28", .194089e-02);
1039 #undef set_isot_val
1040
1041 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C3H8", ISOT)] = VAL
1042 set_isot_val("21", 9.66290e-01);
1043 #undef set_isot_val
1044
1045 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2", ISOT)] = VAL
1046 set_isot_val("11", .999688E+00);
1047 set_isot_val("12", 3.11432E-04);
1048 #undef set_isot_val
1049
1050 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H", ISOT)] = VAL
1051 set_isot_val("1", 1.00);
1052 #undef set_isot_val
1053
1054 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("He", ISOT)] = VAL
1055 set_isot_val("4", 1.00);
1056 #undef set_isot_val
1057
1058 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Ar", ISOT)] = VAL
1059 set_isot_val("8", 1.00);
1060 #undef set_isot_val
1061
1062 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C4H2", ISOT)] = VAL
1063 set_isot_val("2211", .955998E+00);
1064 #undef set_isot_val
1065
1066 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO3", ISOT)] = VAL
1067 set_isot_val("26", .943400E+00);
1068 #undef set_isot_val
1069
1070 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS2", ISOT)] = VAL
1071 set_isot_val("222", 8.92811E-01);
1072 set_isot_val("224", 7.92600E-02);
1073 set_isot_val("223", 1.40940E-02);
1074 set_isot_val("232", 1.03100E-02);
1075 #undef set_isot_val
1076
1077 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2N2", ISOT)] = VAL
1078 set_isot_val("4224", 9.70752E-01);
1079 #undef set_isot_val
1080
1081 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COCl2", ISOT)] = VAL
1082 set_isot_val("2655", 5.66392E-01);
1083 set_isot_val("2657", 3.62235E-01);
1084 #undef set_isot_val
1085
1086 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3F", ISOT)] = VAL
1087 set_isot_val("219", 9.88428E-01);
1088 #undef set_isot_val
1089
1090 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("GeH4", ISOT)] = VAL
1091 set_isot_val("411", 3.65172E-01);
1092 set_isot_val("211", 2.74129E-01);
1093 set_isot_val("011", 2.05072E-01);
1094 set_isot_val("311", 7.75517E-01);
1095 set_isot_val("611", 7.75517E-01);
1096 #undef set_isot_val
1097
1098 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3I", ISOT)] = VAL
1099 set_isot_val("217", 9.88428E-01);
1100 #undef set_isot_val
1101
1102 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NF3", ISOT)] = VAL
1103 set_isot_val("4999", 9.96337E-01);
1104 #undef set_isot_val
1105
1106 return isotopologue_ratios;
1107}
1108
1119constexpr Numeric mean_mass(Species spec, const IsotopologueRatios& ir) noexcept {
1120 Numeric sum_rm=0;
1121 Numeric sum_r =0;
1122 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i <IsotopologuesStart[std::size_t(spec) + 1]; i++) {
1123 if (not nonstd::isnan(Isotopologues[i].mass) and not nonstd::isnan(ir[i])) {
1124 sum_rm += ir[i] * Isotopologues[i].mass;
1125 sum_r += ir[i];
1126 }
1127 }
1128 if (sum_r not_eq 0) return sum_rm / sum_r;
1129 return std::numeric_limits<Numeric>::signaling_NaN();
1130}
1131
1141String update_isot_name(const String& old_name);
1142
1143constexpr bool all_have_ratio(const Species spec, const IsotopologueRatios& ir) noexcept {
1144 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
1145 if (not Isotopologues[i].joker() and not is_predefined_model(Isotopologues[i]) and nonstd::isnan(ir[i])) {
1146 return false;
1147 }
1148 }
1149 return true;
1150}
1151
1152std::pair<ArrayOfString, ArrayOfString> names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios& ir) noexcept;
1153} // namespace Species
1154
1156
1158
1160
1162
1163#endif // isotopologues_h
This can be used to make arrays out of anything.
Definition: array.h:48
The Joker class.
Definition: matpackI.h:126
#define ARTS_NOEXCEPT
Definition: debug.h:79
#define ARTS_ASSERT(condition,...)
Definition: debug.h:82
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
constexpr bool good_enum(EnumType x) noexcept
Checks if the enum number is good.
Definition: enums.h:21
#define deal_with_spec(SPEC)
#define set_isot_val(ISOT, VAL)
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
const Joker joker
This file contains the definition of String, the ARTS string class.
my_basic_string< char > String
The String type for ARTS.
Definition: mystring.h:216
String isotopologues_names(Species spec)
consteval std::size_t count_isotopologues() noexcept
constexpr bool all_have_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
consteval std::array< std::size_t, std::size_t(Species::FINAL)+1 > start_positions() noexcept
constexpr Numeric mean_mass(Species spec, const IsotopologueRatios &ir) noexcept
constexpr const IsotopeRecord & select_joker(Species spec) noexcept
constexpr bool is_predefined_model(const IsotopeRecord &ir) noexcept
constexpr std::array Isotopologues
A list of all ARTS isotopologues, note how the species enum class input HAS to be sorted.
Definition: isotopologues.h:57
constexpr bool is_normal_isotopologue(const IsotopeRecord &ir) noexcept
constexpr bool same_or_joker(const IsotopeRecord &ir1, const IsotopeRecord &ir2) noexcept
constexpr auto IsotopologuesStart
std::pair< ArrayOfString, ArrayOfString > names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
consteval std::array< IsotopeRecord, count_isotopologues< spec >()> isotopologues() noexcept
constexpr IsotopologueRatios isotopologue_ratiosInitFromBuiltin()
String update_isot_name(const String &old_name)
Updates the name of the isotopologue based on updates of the isotopologues.
String predefined_model_names() noexcept
constexpr const IsotopeRecord & select(Species spec, const std::string_view isotname) noexcept
constexpr Index find_species_index(const Species spec, const std::string_view isot) noexcept
constexpr std::string_view Joker
Definition: isotopologues.h:13
constexpr int isdigit(int ch) noexcept
Definition: nonstd.h:24
constexpr bool isnan(double d) noexcept
Definition: nonstd.h:53
Struct containing all information needed about one isotope.
Definition: isotopologues.h:16
String FullName() const noexcept
Definition: isotopologues.h:49
Index gi
The degeneracy of states of the molecule. It is -1 if not defined.
Definition: isotopologues.h:27
Species spec
Species type as defined in species.h.
Definition: isotopologues.h:18
Numeric mass
The mass of the isotope in units of grams per mol. It is Nan if not defined.
Definition: isotopologues.h:24
std::string_view isotname
A custom name that is unique for this Species type.
Definition: isotopologues.h:21
constexpr bool joker() const noexcept
Definition: isotopologues.h:50
friend std::ostream & operator<<(std::ostream &os, const IsotopeRecord &ir)
Definition: isotopologues.h:34
constexpr IsotopeRecord(Species spec_, const std::string_view isotname_=Joker, Numeric mass_=std::numeric_limits< Numeric >::quiet_NaN(), Index gi_=-1) noexcept
Definition: isotopologues.h:29
constexpr IsotopeRecord() noexcept
Definition: isotopologues.h:32
constexpr bool OK() const noexcept
Definition: isotopologues.h:51
constexpr bool operator==(const IsotopeRecord &that) const noexcept
Definition: isotopologues.h:37
constexpr bool operator!=(T x) const noexcept
Definition: isotopologues.h:47
constexpr bool operator==(const std::string_view specstr) const noexcept
A comparison with pure named string (this is not an exact comparison)
Definition: isotopologues.h:42
constexpr bool all_isotopes_have_a_value() const noexcept
friend std::ostream & operator<<(std::ostream &os, const IsotopologueRatios &iso_rat)
constexpr Numeric operator[](const IsotopeRecord &ir) const
constexpr IsotopologueRatios() noexcept
constexpr Numeric operator[](const Index spec_ind) const ARTS_NOEXCEPT
std::array< Numeric, maxsize > data
static constexpr Index maxsize