ARTS  2.3.1285(git:92a29ea9-dirty)
absorptionlines.h
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 
32 #ifndef absorptionlines_h
33 #define absorptionlines_h
34 
35 #include <vector>
36 #include "bifstream.h"
37 #include "bofstream.h"
38 #include "lineshapemodel.h"
39 #include "matpack.h"
40 #include "quantum.h"
41 #include "zeemandata.h"
42 
44 namespace Absorption {
49 enum class MirroringType : Index {
50  None, // No mirroring
51  Lorentz, // Mirror, but use Lorentz line shape
52  SameAsLineShape, // Mirror using the same line shape
53  Manual, // Mirror by having a line in the array of line record with negative F0
54 }; // MirroringType
55 
57  if (in == "None")
58  return MirroringType::None;
59  else if (in == "Lorentz")
61  else if (in == "Same")
63  else if (in == "Manual")
64  return MirroringType::Manual;
65  else
66  throw std::runtime_error("Cannot recognize the mirroring type");
67 }
68 
70  if (in == MirroringType::None)
71  return "None";
72  else if (in == MirroringType::Lorentz)
73  return "Lorentz";
74  else if (in == MirroringType::SameAsLineShape)
75  return "Same";
76  else if (in == MirroringType::Manual)
77  return "Manual";
78  std::terminate();
79 }
80 
82  if (in == MirroringType::None)
83  return "These lines are not mirrored at 0 Hz.\n";
84  else if (in == MirroringType::Lorentz)
85  return "These lines are mirrored around 0 Hz using the Lorentz line shape.\n";
86  else if (in == MirroringType::SameAsLineShape)
87  return "These line are mirrored around 0 Hz using the original line shape.\n";
88  else if (in == MirroringType::Manual)
89  return "There are manual line entries in the catalog to mirror this line.\n";
90  std::terminate();
91 }
92 
97 enum class NormalizationType : Index {
98  None, // Do not renormalize the line shape
99  VVH, // Renormalize with Van Vleck and Huber specifications
100  VVW, // Renormalize with Van Vleck and Weiskopf specifications
101  RosenkranzQuadratic, // Renormalize using Rosenkranz's quadratic specifications
102 }; // LineNormalizationType
103 
105  if (in == "None")
107  else if (in == "VVH")
108  return NormalizationType::VVH;
109  else if (in == "VVW")
110  return NormalizationType::VVW;
111  else if (in == "RQ")
113  else
114  throw std::runtime_error("Cannot recognize the normalization type");
115 }
116 
118  if (in == NormalizationType::None)
119  return "None";
120  else if (in == NormalizationType::VVH)
121  return "VVH";
122  else if (in == NormalizationType::VVW)
123  return "VVW";
125  return "RQ";
126  std::terminate();
127 }
128 
130  if (in == NormalizationType::None)
131  return "No re-normalization in the far wing will be applied.\n";
132  else if (in == NormalizationType::VVH)
133  return "van Vleck and Huber far-wing renormalization will be applied, "
134  "i.e. F ~ (f tanh(hf/2kT))/(f0 tanh(hf0/2kT))\n";
135  else if (in == NormalizationType::VVW)
136  return "van Vleck and Weisskopf far-wing renormalization will be applied, "
137  "i.e. F ~ (f/f0)^2\n";
139  return "Rosenkranz quadratic far-wing renormalization will be applied, "
140  "i.e. F ~ hf0/2kT sinh(hf0/2kT) (f/f0)^2\n";
141  std::terminate();
142 }
143 
148 enum class PopulationType : Index {
149  ByLTE, // Assume line is in LTE
150  ByNLTEVibrationalTemperatures, // Assume line is in NLTE described by vibrational temperatures
151  ByNLTEPopulationDistribution, // Assume line is in NLTE and the upper-to-lower ratio is known
152  ByHITRANRosenkranzRelmat, // Assume line needs to compute relaxation matrix to derive HITRAN Y-coefficients
153  ByHITRANFullRelmat, // Assume line needs to compute and directly use the relaxation matrix
154 }; // PopulationType
155 
157  if (in == "LTE")
158  return PopulationType::ByLTE;
159  else if (in == "ByHITRANRosenkranzRelmat")
161  else if (in == "ByHITRANFullRelmat")
163  else if (in == "NLTE-VibrationalTemperatures")
165  else if (in == "NLTE")
167  else
168  throw std::runtime_error("Cannot recognize the population type");
169 }
170 
172  switch (in) {
174  return "LTE";
176  return "ByHITRANFullRelmat";
178  return "ByHITRANRosenkranzRelmat";
180  return "NLTE-VibrationalTemperatures";
182  return "NLTE";
183  } std::terminate();
184 }
185 
187  switch (in) {
189  return "The lines are considered as in pure LTE.\n";
191  return "The lines requires relaxation matrix calculations in LTE - HITRAN full method.\n";
193  return "The lines requires Relaxation matrix calculations in LTE - HITRAN Rosenkranz method.\n";
195  return "The lines are considered as in NLTE by vibrational temperatures.\n";
197  return "The lines are considered as in pure NLTE.\n";
198  } std::terminate();
199 }
200 
202  return in == PopulationType::ByHITRANFullRelmat or
204 }
205 
207 enum class CutoffType : Index {
208  None, // No cutoff frequency at all
209  LineByLineOffset, // The cutoff frequency is at SingleLine::F0 plus the cutoff frequency
210  BandFixedFrequency, // The curoff frequency is the cutoff frequency for all SingleLine(s)
211 }; // LineCutoffType
212 
214  if (in == "None")
215  return CutoffType::None;
216  else if (in == "ByLine")
218  else if (in == "ByBand")
220  else
221  throw std::runtime_error("Cannot recognize the cutoff type");
222 }
223 
225  if (in == CutoffType::None)
226  return "None";
227  else if (in == CutoffType::LineByLineOffset)
228  return "ByLine";
229  else if (in == CutoffType::BandFixedFrequency)
230  return "ByBand";
231  std::terminate();
232 }
233 
236  if (in == CutoffType::None)
237  os << "No cut-off will be applied.\n";
238  else if (in == CutoffType::LineByLineOffset)
239  os << "The lines will be cut-off " << cutoff << " Hz from the line center.\n";
240  else if (in == CutoffType::BandFixedFrequency)
241  os << "All lines are cut-off at " << cutoff << " Hz.\n";
242  return os.str();
243 }
244 
246 class SingleLine {
247 private:
250 
253 
256 
259 
262 
265 
268 
271 
273  std::vector<Rational> mlowerquanta;
274 
276  std::vector<Rational> mupperquanta;
277 
278 public:
293  Numeric I0=0,
294  Numeric E0=0,
295  Numeric glow=0,
296  Numeric gupp=0,
297  Numeric A=0,
298  Zeeman::Model zeeman=Zeeman::Model(),
299  const LineShape::Model& lineshape=LineShape::Model(),
300  const std::vector<Rational>& lowerquanta={},
301  const std::vector<Rational>& upperquanta={}) :
302  mF0(F0),
303  mI0(I0),
304  mE0(E0),
305  mglow(glow),
306  mgupp(gupp),
307  mA(A),
308  mzeeman(zeeman),
309  mlineshape(lineshape),
310  mlowerquanta(lowerquanta),
311  mupperquanta(upperquanta) {}
312 
318  SingleLine(size_t nbroadeners, size_t nquanta, const LineShape::Model& metamodel) :
319  mlineshape(metamodel), mlowerquanta(nquanta), mupperquanta(nquanta) {
320  if(Index(nbroadeners) not_eq mlineshape.nelem())
321  throw std::runtime_error("Mismatch between broadeners and model");
322  }
323 
327 
329  Index LineShapeElems() const noexcept {return mlineshape.nelem();}
330 
332  Index LowerQuantumElems() const noexcept {return mlowerquanta.size();}
333 
335  Index UpperQuantumElems() const noexcept {return mupperquanta.size();}
336 
340 
342  Numeric F0() const noexcept {return mF0;}
343 
345  Numeric E0() const noexcept {return mE0;}
346 
348  Numeric I0() const noexcept {return mI0;}
349 
351  Numeric A() const noexcept {return mA;}
352 
354  Numeric g_low() const noexcept {return mglow;}
355 
357  Numeric g_upp() const noexcept {return mgupp;}
358 
360  Zeeman::Model Zeeman() const noexcept {return mzeeman;}
361 
363  const LineShape::Model& LineShape() const noexcept {return mlineshape;}
364 
366  const std::vector<Rational>& LowerQuantumNumbers() const noexcept {return mlowerquanta;}
367 
369  const std::vector<Rational>& UpperQuantumNumbers() const noexcept {return mupperquanta;}
370 
374 
376  Numeric& F0() noexcept {return mF0;}
377 
379  Numeric& E0() noexcept {return mE0;}
380 
382  Numeric& I0() noexcept {return mI0;}
383 
385  Numeric& A() noexcept {return mA;}
386 
388  Numeric& g_low() noexcept {return mglow;}
389 
391  Numeric& g_upp() noexcept {return mgupp;}
392 
394  Zeeman::Model& Zeeman() noexcept {return mzeeman;}
395 
397  LineShape::Model& LineShape() noexcept {return mlineshape;}
398 
400  std::vector<Rational>& LowerQuantumNumbers() noexcept {return mlowerquanta;}
401 
403  std::vector<Rational>& UpperQuantumNumbers() noexcept {return mupperquanta;}
404 
408 
410  void F0(Numeric x) noexcept {mF0 = x;}
411 
413  void E0(Numeric x) noexcept {mE0 = x;}
414 
416  void I0(Numeric x) noexcept {mI0 = x;}
417 
419  void A(Numeric x) noexcept {mA = x;}
420 
422  void g_low(Numeric x) noexcept {mglow = x;}
423 
425  void g_upp(Numeric x) noexcept {mgupp = x;}
426 
430 
432  Rational LowerQuantumNumber(size_t i) const noexcept {return mlowerquanta[i];}
433 
435  Rational UpperQuantumNumber(size_t i) const noexcept {return mupperquanta[i];}
436 
438  Rational& LowerQuantumNumber(size_t i) noexcept {return mlowerquanta[i];}
439 
441  Rational& UpperQuantumNumber(size_t i) noexcept {return mupperquanta[i];}
442 
444  bool SameQuantumNumbers(const SingleLine& sl) const noexcept;
445 
449 
457  void SetAutomaticZeeman(QuantumIdentifier qid, const std::vector<QuantumNumberType>& keys) {
458  for(size_t i=0; i<keys.size(); i++) {
459  qid.LowerQuantumNumber(keys[i]) = mlowerquanta[i];
460  qid.UpperQuantumNumber(keys[i]) = mupperquanta[i];
461  }
462 
463  mzeeman = Zeeman::Model(qid);
464  }
465 
471  mlineshape.SetLineMixingModel(
474  .Data()[0]);
475  }
476 
481  void SetLineMixing2AER(const Vector& d) {
482  const LineShape::ModelParameters Y = {LineShape::TemperatureModel::LM_AER, d[4], d[5], d[6], d[7]};
483  const LineShape::ModelParameters G = {LineShape::TemperatureModel::LM_AER, d[8], d[9], d[10], d[11]};
484  for (auto& sm : mlineshape.Data()) {
485  sm.Y() = Y;
486  sm.G() = G;
487  }
488  }
489 
493  bif >> mF0 >> mI0 >> mE0 >> mglow >> mgupp >> mA >> mzeeman;
494 
496  mlineshape.read(bif);
497 
499  for (auto& rat: mlowerquanta) rat.read(bif);
500 
502  for (auto& rat: mupperquanta) rat.read(bif);
503 
504  return bif;
505  }
506 
508  bofstream& write(bofstream& bof) const {
510  bof << mF0 << mI0 << mE0 << mglow << mgupp << mA << mzeeman;
511 
513  mlineshape.write(bof);
514 
516  for (auto& rat: mlowerquanta) rat.write(bof);
517 
519  for (auto& rat: mupperquanta) rat.write(bof);
520 
521  return bof;
522  }
523 }; // SingleLine
524 
525 std::ostream& operator<<(std::ostream&, const SingleLine&);
526 
527 std::istream& operator>>(std::istream&, SingleLine&);
528 
531  bool bad=true;
532  bool selfbroadening=false;
533  bool bathbroadening=false;
539  Numeric T0=0;
540  Numeric cutofffreq=0;
541  Numeric linemixinglimit=-1;
545 };
546 
547 class Lines {
548 private:
551 
554 
557 
560 
563 
566 
569 
572 
575 
578 
581 
583  std::vector<QuantumNumberType> mlocalquanta;
584 
587 
589  std::vector<SingleLine> mlines;
590 
591 public:
609  Lines(bool selfbroadening=false,
610  bool bathbroadening=false,
615  LineShape::Type lineshapetype=LineShape::Type::DP,
616  Numeric T0=296,
617  Numeric cutofffreq=-1,
618  Numeric linemixinglimit=-1,
619  const QuantumIdentifier& quantumidentity=QuantumIdentifier(),
620  const std::vector<QuantumNumberType>& localquanta={},
621  const ArrayOfSpeciesTag& broadeningspecies={},
622  const std::vector<SingleLine>& lines={}) :
623  mselfbroadening(selfbroadening),
624  mbathbroadening(bathbroadening),
625  mcutoff(cutoff),
626  mmirroring(mirroring),
627  mpopulation(population),
628  mnormalization(normalization),
629  mlineshapetype(lineshapetype),
630  mT0(T0),
631  mcutofffreq(cutofffreq),
632  mlinemixinglimit(linemixinglimit),
633  mquantumidentity(quantumidentity),
634  mlocalquanta(localquanta),
635  mbroadeningspecies(broadeningspecies),
636  mlines(lines) {};
637 
656  Lines(bool selfbroadening,
657  bool bathbroadening,
658  size_t nlines,
659  CutoffType cutoff,
660  MirroringType mirroring,
661  PopulationType population,
662  NormalizationType normalization,
663  LineShape::Type lineshapetype,
664  Numeric T0,
665  Numeric cutofffreq,
666  Numeric linemixinglimit,
667  const QuantumIdentifier& quantumidentity,
668  const std::vector<QuantumNumberType>& localquanta,
669  const ArrayOfSpeciesTag& broadeningspecies,
670  const LineShape::Model& metamodel) :
671  mselfbroadening(selfbroadening),
672  mbathbroadening(bathbroadening),
673  mcutoff(cutoff),
674  mmirroring(mirroring),
675  mpopulation(population),
676  mnormalization(normalization),
677  mlineshapetype(lineshapetype),
678  mT0(T0),
679  mcutofffreq(cutofffreq),
680  mlinemixinglimit(linemixinglimit),
681  mquantumidentity(quantumidentity),
682  mlocalquanta(localquanta),
683  mbroadeningspecies(broadeningspecies),
684  mlines(nlines,
685  SingleLine(broadeningspecies.size(),
686  localquanta.size(), metamodel)) {};
687 
701  if(NumLocalQuanta() not_eq sl.LowerQuantumElems() or
702  NumLocalQuanta() not_eq sl.UpperQuantumElems())
703  throw std::runtime_error("Error calling appending function, bad size of quantum numbers");
704 
705  if(NumLines() not_eq 0 and
706  sl.LineShapeElems() not_eq mlines[0].LineShapeElems())
707  throw std::runtime_error("Error calling appending function, bad size of broadening species");
708 
709  mlines.push_back(std::move(sl));
710  }
711 
724  void AppendSingleLine(const SingleLine& sl) {
725  if(NumLocalQuanta() not_eq sl.LowerQuantumElems() or
726  NumLocalQuanta() not_eq sl.UpperQuantumElems())
727  throw std::runtime_error("Error calling appending function, bad size of quantum numbers");
728 
729  if(NumLines() not_eq 0 and
730  sl.LineShapeElems() not_eq mlines[0].LineShapeElems())
731  throw std::runtime_error("Error calling appending function, bad size of broadening species");
732 
733  mlines.push_back(sl);
734  }
735 
741  bool MatchWithExternal(const SingleLineExternal& sle, const QuantumIdentifier& quantumidentity) const noexcept {
742  if(sle.bad)
743  return false;
744  else if(sle.selfbroadening not_eq mselfbroadening)
745  return false;
746  else if(sle.bathbroadening not_eq mbathbroadening)
747  return false;
748  else if(sle.cutoff not_eq mcutoff)
749  return false;
750  else if(sle.mirroring not_eq mmirroring)
751  return false;
752  else if(sle.population not_eq mpopulation)
753  return false;
754  else if(sle.normalization not_eq mnormalization)
755  return false;
756  else if(sle.lineshapetype not_eq mlineshapetype)
757  return false;
758  else if(sle.T0 not_eq mT0)
759  return false;
760  else if(sle.cutofffreq not_eq mcutofffreq)
761  return false;
762  else if(sle.linemixinglimit not_eq mlinemixinglimit)
763  return false;
764  else if(quantumidentity not_eq mquantumidentity)
765  return false;
766  else if(not std::equal(sle.species.cbegin(), sle.species.cend(), mbroadeningspecies.cbegin(), mbroadeningspecies.cend()))
767  return false;
768  else if(NumLines() not_eq 0 and not sle.line.LineShape().Match(mlines[0].LineShape()))
769  return false;
770  else
771  return true;
772  }
773 
779  bool Match(const Lines& l) const noexcept {
780  if(l.mselfbroadening not_eq mselfbroadening)
781  return false;
782  else if(l.mbathbroadening not_eq mbathbroadening)
783  return false;
784  else if(l.mcutoff not_eq mcutoff)
785  return false;
786  else if(l.mmirroring not_eq mmirroring)
787  return false;
788  else if(l.mpopulation not_eq mpopulation)
789  return false;
790  else if(l.mnormalization not_eq mnormalization)
791  return false;
792  else if(l.mlineshapetype not_eq mlineshapetype)
793  return false;
794  else if(l.mT0 not_eq mT0)
795  return false;
796  else if(l.mcutofffreq not_eq mcutofffreq)
797  return false;
798  else if(l.mlinemixinglimit not_eq mlinemixinglimit)
799  return false;
800  else if(l.mquantumidentity not_eq mquantumidentity)
801  return false;
802  else if(not std::equal(l.mbroadeningspecies.cbegin(), l.mbroadeningspecies.cend(), mbroadeningspecies.cbegin(), mbroadeningspecies.cend()))
803  return false;
804  else if(not std::equal(l.mlocalquanta.cbegin(), l.mlocalquanta.cend(), mlocalquanta.cbegin(), mlocalquanta.cend()))
805  return false;
806  else if(NumLines() not_eq 0 and l.NumLines() not_eq 0 and not l.mlines[0].LineShape().Match(mlines[0].LineShape()))
807  return false;
808  else
809  return true;
810  }
811 
814  std::sort(mlines.begin(), mlines.end(),
815  [](const SingleLine& a, const SingleLine& b){return a.F0() < b.F0();});
816  }
817 
820  std::sort(mlines.begin(), mlines.end(),
821  [](const SingleLine& a, const SingleLine& b){return a.A() < b.A();});
822  }
823 
826  mquantumidentity.SetTransition(QuantumNumbers(), QuantumNumbers());
827  }
828 
830  String SpeciesName() const noexcept;
831 
833  String UpperQuantumNumbers() const noexcept;
834 
836  String LowerQuantumNumbers() const noexcept;
837 
839  String LineShapeMetaData() const noexcept {
840  return NumLines() ?
842  "";
843  }
844 
846  Index Species() const noexcept {return mquantumidentity.Species();}
847 
849  Index Isotopologue() const noexcept {return mquantumidentity.Isotopologue();}
850 
852  Index NumLines() const noexcept {return Index(mlines.size());}
853 
855  const std::vector<SingleLine>& AllLines() const noexcept {return mlines;}
856 
858  std::vector<SingleLine>& AllLines() noexcept {return mlines;}
859 
861  Index NumBroadeners() const noexcept {return Index(mbroadeningspecies.nelem());}
862 
864  Index NumLocalQuanta() const noexcept {return Index(mlocalquanta.size());}
865 
868  void RemoveUnusedLocalQuantums();
869 
872  void RemoveLocalQuantum(size_t);
873 
880  Rational LowerQuantumNumber(size_t k, QuantumNumberType qnt) const noexcept;
881 
888  Rational UpperQuantumNumber(size_t k, QuantumNumberType qnt) const noexcept;
889 
896  Rational& LowerQuantumNumber(size_t k, QuantumNumberType qnt) noexcept;
897 
904  Rational& UpperQuantumNumber(size_t k, QuantumNumberType qnt) noexcept;
905 
911  Index ZeemanCount(size_t k, Zeeman::Polarization type) const noexcept {
912  if (UpperQuantumNumber(k, QuantumNumberType::F).isDefined() and LowerQuantumNumber(k, QuantumNumberType::F).isDefined()) {
913  return Zeeman::nelem(UpperQuantumNumber(k, QuantumNumberType::F),
914  LowerQuantumNumber(k, QuantumNumberType::F),
915  type);
916  } else {
917  return Zeeman::nelem(UpperQuantumNumber(k, QuantumNumberType::J),
918  LowerQuantumNumber(k, QuantumNumberType::J),
919  type);
920  }
921  }
922 
929  Numeric ZeemanStrength(size_t k, Zeeman::Polarization type, Index i) const noexcept {
930  if (UpperQuantumNumber(k, QuantumNumberType::F).isDefined() and LowerQuantumNumber(k, QuantumNumberType::F).isDefined()) {
931  return mlines[k].Zeeman().Strength(UpperQuantumNumber(k, QuantumNumberType::F),
932  LowerQuantumNumber(k, QuantumNumberType::F),
933  type, i);
934  } else {
935  return mlines[k].Zeeman().Strength(UpperQuantumNumber(k, QuantumNumberType::J),
936  LowerQuantumNumber(k, QuantumNumberType::J),
937  type, i);
938  }
939  }
940 
947  Numeric ZeemanSplitting(size_t k, Zeeman::Polarization type, Index i) const noexcept {
948  if (UpperQuantumNumber(k, QuantumNumberType::F).isDefined() and LowerQuantumNumber(k, QuantumNumberType::F).isDefined()) {
949  return mlines[k].Zeeman().Splitting(UpperQuantumNumber(k, QuantumNumberType::F),
950  LowerQuantumNumber(k, QuantumNumberType::F),
951  type, i);
952  } else {
953  return mlines[k].Zeeman().Splitting(UpperQuantumNumber(k, QuantumNumberType::J),
954  LowerQuantumNumber(k, QuantumNumberType::J),
955  type, i);
956  }
957  }
958 
960  void SetAutomaticZeeman() noexcept {
961  for(auto& line: mlines)
962  line.SetAutomaticZeeman(mquantumidentity, mlocalquanta);
963  }
964 
970  Numeric F0(size_t k) const noexcept {return mlines[k].F0();}
971 
977  Numeric& F0(size_t k) noexcept {return mlines[k].F0();}
978 
983  Numeric F_mean() const noexcept {
984  const Numeric val = std::inner_product(mlines.cbegin(), mlines.cend(),
985  mlines.cbegin(), 0.0, std::plus<Numeric>(),
986  [](const auto& a, const auto& b){return a.F0() * b.I0();});
987  const Numeric div = std::accumulate(mlines.cbegin(), mlines.cend(), 0.0,
988  [](const auto& a, const auto& b){return a + b.I0();});
989  return val / div;
990  }
991 
997  Numeric F_mean(const ConstVectorView wgts) const noexcept {
998  const Numeric val = std::inner_product(mlines.cbegin(), mlines.cend(),
999  wgts.begin(), 0.0, std::plus<Numeric>(),
1000  [](const auto& a, const auto& b){return a.F0() * b;});
1001  const Numeric div = wgts.sum();
1002  return val / div;
1003  }
1004 
1010  Numeric E0(size_t k) const noexcept {return mlines[k].E0();}
1011 
1017  Numeric& E0(size_t k) noexcept {return mlines[k].E0();}
1018 
1024  Numeric I0(size_t k) const noexcept {return mlines[k].I0();}
1025 
1031  Numeric& I0(size_t k) noexcept {return mlines[k].I0();}
1032 
1038  Numeric A(size_t k) const noexcept {return mlines[k].A();}
1039 
1045  Numeric& A(size_t k) noexcept {return mlines[k].A();}
1046 
1052  Numeric g_low(size_t k) const noexcept {return mlines[k].g_low();}
1053 
1059  Numeric& g_low(size_t k) noexcept {return mlines[k].g_low();}
1060 
1066  Numeric g_upp(size_t k) const noexcept {return mlines[k].g_upp();}
1067 
1073  Numeric& g_upp(size_t k) noexcept {return mlines[k].g_upp();}
1074 
1076  MirroringType Mirroring() const noexcept {return mmirroring;}
1077 
1079  void Mirroring(MirroringType x) noexcept {mmirroring = x;}
1080 
1082  static bool validIndexForMirroring(Index x) noexcept {
1084  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
1085  }
1086 
1088  static MirroringType string2Mirroring(const String& in) noexcept {
1089  if (in == "None")
1090  return MirroringType::None;
1091  else if (in == "Lorentz")
1092  return MirroringType::Lorentz;
1093  else if (in == "Same")
1095  else if (in == "Manual")
1096  return MirroringType::Manual;
1097  else
1098  return MirroringType(-1);
1099  }
1100 
1102  NormalizationType Normalization() const noexcept {return mnormalization;}
1103 
1105  void Normalization(NormalizationType x) noexcept {mnormalization = x;}
1106 
1108  static bool validIndexForNormalization(Index x) noexcept {
1110  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
1111  }
1112 
1114  static NormalizationType string2Normalization(const String& in) noexcept {
1115  if (in == "None")
1116  return NormalizationType::None;
1117  else if (in == "VVH")
1118  return NormalizationType::VVH;
1119  else if (in == "VVW")
1120  return NormalizationType::VVW;
1121  else if (in == "RQ")
1123  else
1124  return NormalizationType(-1);
1125  }
1126 
1128  CutoffType Cutoff() const noexcept {return mcutoff;}
1129 
1131  void Cutoff(CutoffType x) noexcept {mcutoff = x;}
1132 
1134  static bool validIndexForCutoff(Index x) noexcept {
1136  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
1137  }
1138 
1140  static CutoffType string2Cutoff(const String& in) noexcept {
1141  if (in == "None")
1142  return CutoffType::None;
1143  else if (in == "ByLine")
1145  else if (in == "ByBand")
1147  else
1148  return CutoffType(-1);
1149  }
1150 
1152  PopulationType Population() const noexcept {return mpopulation;}
1153 
1155  void Population(PopulationType x) noexcept {mpopulation = x;}
1156 
1158  static bool validIndexForPopulation(Index x) noexcept {
1160  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
1161  }
1162 
1164  static PopulationType string2Population(const String& in) noexcept {
1165  if (in == "LTE")
1166  return PopulationType::ByLTE;
1167  else if (in == "ByHITRANFullRelmat")
1169  else if (in == "ByHITRANRosenkranzRelmat")
1171  else if (in == "NLTE-VibrationalTemperatures")
1173  else if (in == "NLTE")
1175  else
1176  return PopulationType(-1);
1177  }
1178 
1180  LineShape::Type LineShapeType() const noexcept {return mlineshapetype;}
1181 
1183  void LineShapeType(LineShape::Type x) noexcept {mlineshapetype = x;}
1184 
1186  static bool validIndexForLineShapeType(Index x) noexcept {
1188  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
1189  }
1190 
1192  static LineShape::Type string2LineShapeType(const String& type) noexcept {
1193  if (type == "DP")
1194  return LineShape::Type::DP;
1195  else if (type == String("LP"))
1196  return LineShape::Type::LP;
1197  else if (type == String("VP"))
1198  return LineShape::Type::VP;
1199  else if (type == String("SDVP"))
1200  return LineShape::Type::SDVP;
1201  else if (type == String("HTP"))
1202  return LineShape::Type::HTP;
1203  else
1204  return LineShape::Type(-1);
1205  }
1206 
1212  bool DoLineMixing(Numeric P) const noexcept {
1213  return mlinemixinglimit < 0 ? true : mlinemixinglimit > P;
1214  }
1215 
1224  LineShape::Output ShapeParameters(size_t k, Numeric T, Numeric P, const Vector& vmrs) const noexcept;
1225 
1234  LineShape::Output ShapeParameters_dT(size_t k, Numeric T, Numeric P, const Vector& vmrs) const noexcept;
1235 
1241  Index LineShapePos(const Index& spec) const noexcept;
1242 
1248  Index LineShapePos(const QuantumIdentifier& qid) const noexcept {
1249  return LineShapePos(qid.Species());
1250  }
1251 
1260  LineShape::Output ShapeParameters_dVMR(size_t k, Numeric T, Numeric P,
1261  const QuantumIdentifier& vmr_qid) const noexcept;
1262 
1272  Numeric ShapeParameter_dInternal(size_t k, Numeric T, Numeric P,
1273  const Vector& vmrs,
1274  const RetrievalQuantity& derivative) const noexcept;
1275 
1281  Numeric CutoffFreq(size_t k) const noexcept {
1282  switch(mcutoff) {
1284  return F0(k) + mcutofffreq;
1286  return mcutofffreq;
1287  case CutoffType::None:
1289  }
1290  std::terminate();
1291  }
1292 
1298  Numeric CutoffFreqMinus(size_t k, Numeric fmean) const noexcept {
1299  switch(mcutoff) {
1301  return F0(k) - mcutofffreq;
1303  return mcutofffreq - 2*fmean;
1304  case CutoffType::None:
1305  return std::numeric_limits<Numeric>::lowest();
1306  }
1307  std::terminate();
1308  }
1309 
1311  Numeric T0() const noexcept {
1312  return mT0;
1313  }
1314 
1316  void T0(Numeric x) noexcept {
1317  mT0 = x;
1318  }
1319 
1321  Numeric CutoffFreqValue() const noexcept {
1322  return mcutofffreq;
1323  }
1324 
1326  void CutoffFreqValue(Numeric x) noexcept {
1327  mcutofffreq = x;
1328  }
1329 
1331  Numeric LinemixingLimit() const noexcept {
1332  return mlinemixinglimit;
1333  }
1334 
1336  void LinemixingLimit(Numeric x) noexcept {
1337  mlinemixinglimit = x;
1338  }
1339 
1341  const std::vector<QuantumNumberType>& LocalQuanta() const noexcept {
1342  return mlocalquanta;
1343  }
1344 
1346  std::vector<QuantumNumberType>& LocalQuanta() noexcept {
1347  return mlocalquanta;
1348  }
1349 
1351  const ArrayOfSpeciesTag& BroadeningSpecies() const noexcept {
1352  return mbroadeningspecies;
1353  }
1354 
1357  return mbroadeningspecies;
1358  }
1359 
1361  bool Self() const noexcept {
1362  return mselfbroadening;
1363  }
1364 
1366  void Self(bool x) noexcept {
1367  mselfbroadening = x;
1368  }
1369 
1371  bool Bath() const noexcept {
1372  return mbathbroadening;
1373  }
1374 
1376  void Bath(bool x) noexcept {
1377  mbathbroadening = x;
1378  }
1379 
1381  const QuantumIdentifier& QuantumIdentity() const noexcept {
1382  return mquantumidentity;
1383  }
1384 
1387  return mquantumidentity;
1388  }
1389 
1392  QuantumIdentifier qid_copy(mquantumidentity);
1393  for (size_t i=0; i<mlocalquanta.size(); i++) {
1394  qid_copy.UpperQuantumNumber(mlocalquanta[i]) = mlines[k].UpperQuantumNumber(i);
1395  qid_copy.LowerQuantumNumber(mlocalquanta[i]) = mlines[k].LowerQuantumNumber(i);
1396  }
1397  return qid_copy;
1398  }
1399 
1401  String MetaData() const;
1402 
1404  void RemoveLine(Index) noexcept;
1405 
1407  SingleLine PopLine(Index) noexcept;
1408 
1410  SingleLine& Line(Index) noexcept;
1411 
1413  const SingleLine& Line(Index) const noexcept;
1414 
1416  void ReverseLines() noexcept;
1417 
1419  Numeric SpeciesMass() const noexcept;
1420 
1427  Vector BroadeningSpeciesVMR(const ConstVectorView, const ArrayOfArrayOfSpeciesTag&) const;
1428 
1435  Numeric SelfVMR(const ConstVectorView, const ArrayOfArrayOfSpeciesTag&) const;
1436 
1439  for (auto& line: mlines)
1440  line.read(is);
1441  return is;
1442  }
1443 
1445  bofstream& write(bofstream& os) const {
1446  for (auto& line: mlines)
1447  line.write(os);
1448  return os;
1449  }
1450 
1451  bool OK() const noexcept;
1452 }; // Lines
1453 
1454 std::ostream& operator<<(std::ostream&, const Lines&);
1455 std::istream& operator>>(std::istream&, Lines&);
1456 
1463 
1470 
1477 
1535 
1591 
1606 
1615 
1676 
1722 
1733 std::vector<Lines> split_list_of_external_lines(std::vector<SingleLineExternal>& external_lines,
1734  const std::vector<QuantumNumberType>& localquantas={},
1735  const std::vector<QuantumNumberType>& globalquantas={});
1736 
1743 Lines createEmptyCopy(const Lines& al) noexcept;
1744 
1754 bool line_in_id(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1755 
1762 bool line_is_id(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1763 
1773 bool id_in_line(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1774 
1784 bool line_upper_in_id(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1785 
1795 bool line_lower_in_id(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1796 
1806 bool id_in_line_upper(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1807 
1817 bool id_in_line_lower(const Lines& band, const QuantumIdentifier& id, size_t line_index);
1818 
1820 inline Index nelem(const Lines& l) {return l.NumLines();}
1821 
1823 inline Index nelem(const Array<Lines>& l) {Index n=0; for (auto& x:l) n+=nelem(x); return n;}
1824 
1826 inline Index nelem(const Array<Array<Lines>>& l) {Index n=0; for (auto& x:l) n+=nelem(x); return n;}
1827 
1838 
1847 }; // Absorption
1848 
1853 
1854 std::ostream& operator<<(std::ostream&, const ArrayOfAbsorptionLines&);
1855 
1856 std::ostream& operator<<(std::ostream&, const ArrayOfArrayOfAbsorptionLines&);
1857 
1858 #endif // absorptionlines_h
std::vector< SingleLine > & AllLines() noexcept
Lines.
void A(Numeric x) noexcept
Einstein spontaneous emission.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
std::vector< SingleLine > mlines
A list of individual lines.
#define N
Definition: rng.cc:164
void AppendSingleLine(const SingleLine &sl)
Appends a single line to the absorption lines.
Computations and data for a single absorption line.
Numeric A(size_t k) const noexcept
Einstein spontaneous emission.
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model&#39;s main calculations.
void F0(Numeric x) noexcept
Central frequency.
LineShape::Type mlineshapetype
Type of line shape.
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
void g_low(Numeric x) noexcept
Lower level statistical weight.
Main Zeeman Model.
Definition: zeemandata.h:358
const ArrayOfSpeciesTag & BroadeningSpecies() const noexcept
Returns the broadening species.
Numeric mglow
Lower level statistical weight.
Numeric T0() const noexcept
Returns reference temperature.
Numeric E0(size_t k) const noexcept
Lower level energy.
MirroringType
Describes the type of mirroring line effects.
Index nelem() const
Number of elements.
Definition: array.h:195
void Isotopologue(Index iso)
Set the Isotopologue.
Definition: quantum.h:487
bool relaxationtype_relmat(PopulationType in)
bofstream & write(bofstream &os) const
Binary write for Lines.
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
Rational UpperQuantumNumber(size_t i) const noexcept
Upper quantum number.
Numeric mA
Einstein spontaneous emission coefficient.
Main output of Model.
NormalizationType
Describes the type of normalization line effects.
Numeric CutoffFreq(size_t k) const noexcept
Returns cutoff frequency or maximum value.
G0 G2 FVC Y DV Numeric E0
Numeric F0() const noexcept
Central frequency.
LineShape::Model & LineShape() noexcept
Line shape model.
MirroringType mmirroring
Mirroring type.
Numeric mgupp
Upper level statistical weight.
SingleLineExternal ReadFromMytran2Stream(istream &is)
Read from Mytran2 The MYTRAN2 format is as follows (directly taken from the abs_my.c documentation):
Index LineShapePos(const QuantumIdentifier &qid) const noexcept
Position among broadening species or -1.
void SetAutomaticZeeman() noexcept
Set Zeeman effect for all lines that have the correct quantum numbers.
static bool validIndexForPopulation(Index x) noexcept
Checks if index is a valid population.
Numeric & g_low(size_t k) noexcept
Lower level statistical weight.
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
QuantumIdentifier mquantumidentity
Catalog ID.
The Vector class.
Definition: matpackI.h:860
Model vector2modellm(Vector x, LegacyLineMixingData::TypeLM type)
LineShape::Model from legacy input vector.
Index Isotopologue() const noexcept
Isotopologue Index.
bool line_lower_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
Numeric LinemixingLimit() const noexcept
Returns line mixing limit.
Numeric reduced_magnetic_quadrapole(Rational Jf, Rational Ji, Rational N)
Compute the reduced magnetic quadrapole moment.
bofstream & write(bofstream &bof) const
Binary write for Model.
Main line shape model class.
Numeric F_mean() const noexcept
Mean frequency by weight of line strengt.
bifstream & read(bifstream &bif)
Binary read for Model.
Numeric & F0() noexcept
Central frequency.
Index NumLocalQuanta() const noexcept
Number of local quantum numbers.
String mirroringtype2string(MirroringType in)
MirroringType string2mirroringtype(const String &in)
void SetLineMixing2SecondOrderData(const Vector &d)
Set the line mixing model to 2nd order.
Index NumLines() const noexcept
Number of lines.
Numeric & F0(size_t k) noexcept
Central frequency.
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&#39;s identifier.
Numeric ZeemanSplitting(size_t k, Zeeman::Polarization type, Index i) const noexcept
Returns the splitting of a Zeeman split line.
Numeric & g_upp() noexcept
Upper level statistical weight.
void Population(PopulationType x) noexcept
Sets population style.
void SetAutomaticZeeman(QuantumIdentifier qid, const std::vector< QuantumNumberType > &keys)
Set Zeeman effect by automatic detection.
void CutoffFreqValue(Numeric x) noexcept
Sets internal cutoff frequency value.
const std::vector< SingleSpeciesModel > & Data() const noexcept
PopulationType Population() const noexcept
Returns population style.
std::vector< Rational > mlowerquanta
Lower level quantum numbers.
static NormalizationType string2Normalization(const String &in) noexcept
QuantumNumberType
Enum for Quantum Numbers used for indexing.
Definition: quantum.h:48
bool Self() const noexcept
Returns self broadening status.
PopulationType mpopulation
Line population distribution.
void Mirroring(MirroringType x) noexcept
Returns mirroring style.
CutoffType
Describes the type of cutoff calculations.
void T0(Numeric x) noexcept
Sets reference temperature.
SingleLine(Numeric F0=0, Numeric I0=0, Numeric E0=0, Numeric glow=0, Numeric gupp=0, Numeric A=0, Zeeman::Model zeeman=Zeeman::Model(), const LineShape::Model &lineshape=LineShape::Model(), const std::vector< Rational > &lowerquanta={}, const std::vector< Rational > &upperquanta={})
Default initialization.
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
void Self(bool x) noexcept
Returns self broadening status.
Numeric I0(size_t k) const noexcept
Reference line strength.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Definition: jacobian.h:120
Numeric ZeemanStrength(size_t k, Zeeman::Polarization type, Index i) const noexcept
Returns the strength of a Zeeman split line.
Numeric F_mean(const ConstVectorView wgts) const noexcept
Mean frequency by weight of line strengt.
LineShape::Model mlineshape
Line shape model.
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.
std::istream & operator>>(std::istream &, SingleLine &)
bool line_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
Numeric CutoffFreqMinus(size_t k, Numeric fmean) const noexcept
Returns negative cutoff frequency or lowest value.
Numeric & I0(size_t k) noexcept
Reference line strength.
Computations of line shape derived parameters.
void E0(Numeric x) noexcept
Lower level energy.
Array< AbsorptionLines > ArrayOfAbsorptionLines
void sort_by_einstein()
Sort inner line list by Einstein coefficient.
String normalizationtype2string(NormalizationType in)
Numeric mcutofffreq
cutoff frequency
Numeric & E0() noexcept
Lower level energy.
Numeric & A() noexcept
Einstein spontaneous emission.
bool line_upper_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
Numeric reduced_rovibrational_dipole(Rational Jf, Rational Ji, Rational lf, Rational li, Rational k=Rational(1))
Compute the reduced rovibrational dipole moment.
void I0(Numeric x) noexcept
Reference line strength.
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
CutoffType string2cutofftype(const String &in)
const std::vector< QuantumNumberType > & LocalQuanta() const noexcept
Returns local quantum numbers.
String cutofftype2string(CutoffType in)
static bool validIndexForCutoff(Index x) noexcept
Checks if index is a valid cutoff.
void Species(Index sp)
Set the Species.
Definition: quantum.h:481
CutoffType mcutoff
cutoff type, by band or by line
Binary output file stream class.
Definition: bifstream.h:42
Implements rational numbers to work with other ARTS types.
Definition: rational.h:54
This file contains the class declaration of bifstream.
bool Bath() const noexcept
Returns bath broadening status.
Lines(bool selfbroadening=false, bool bathbroadening=false, CutoffType cutoff=CutoffType::None, MirroringType mirroring=MirroringType::None, PopulationType population=PopulationType::ByLTE, NormalizationType normalization=NormalizationType::None, LineShape::Type lineshapetype=LineShape::Type::DP, Numeric T0=296, Numeric cutofffreq=-1, Numeric linemixinglimit=-1, const QuantumIdentifier &quantumidentity=QuantumIdentifier(), const std::vector< QuantumNumberType > &localquanta={}, const ArrayOfSpeciesTag &broadeningspecies={}, const std::vector< SingleLine > &lines={})
Default initialization.
bool id_in_line_upper(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
This file contains the class declaration of bofstream.
bool Match(const Lines &l) const noexcept
Checks if another line list matches this structure.
Numeric & A(size_t k) noexcept
Einstein spontaneous emission.
Numeric & g_low() noexcept
Lower level statistical weight.
Numeric g_low(size_t k) const noexcept
Lower level statistical weight.
Index Species() const noexcept
Species Index.
String populationtype2string(PopulationType in)
std::vector< QuantumNumberType > & LocalQuanta() noexcept
Returns local quantum numbers.
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
Lines(bool selfbroadening, bool bathbroadening, size_t nlines, CutoffType cutoff, MirroringType mirroring, PopulationType population, NormalizationType normalization, LineShape::Type lineshapetype, Numeric T0, Numeric cutofffreq, Numeric linemixinglimit, const QuantumIdentifier &quantumidentity, const std::vector< QuantumNumberType > &localquanta, const ArrayOfSpeciesTag &broadeningspecies, const LineShape::Model &metamodel)
XML-tag initialization.
Numeric mF0
Central frequency.
Coefficients and temperature model for SingleSpeciesModel.
bool DoLineMixing(Numeric P) const noexcept
Returns if the pressure should do line mixing.
void Cutoff(CutoffType x) noexcept
Sets cutoff style.
Numeric g_low() const noexcept
Lower level statistical weight.
void AppendSingleLine(SingleLine &&sl)
Appends a single line to the absorption lines.
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
QuantumIdentifier QuantumIdentityOfLine(Index k) const noexcept
Returns identity status.
void SetTransition(const QuantumNumbers &upper, const QuantumNumbers &lower)
Set to transition type identifier.
Definition: quantum.cc:229
constexpr Rational LowerQuantumNumber(QuantumNumberType X) const noexcept
Return a lower quantum number by copy.
Definition: quantum.h:602
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
Numeric mI0
Reference intensity.
Index UpperQuantumElems() const noexcept
Number of upper quantum numbers.
Numeric E0() const noexcept
Lower level energy.
bool mbathbroadening
Does the line broadening have bath broadening.
void SetLineMixingModel(SingleSpeciesModel x)
PopulationType string2populationtype(const String &in)
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
ArrayOfSpeciesTag mbroadeningspecies
A list of broadening species.
Numeric A() const noexcept
Einstein spontaneous emission.
Contains the line shape namespace.
Numeric mlinemixinglimit
linemixing limit
PopulationType
Describes the type of population level counter.
void g_upp(Numeric x) noexcept
Upper level statistical weight.
Numeric mE0
Lower state energy level.
QuantumIdentifier & QuantumIdentity() noexcept
Returns identity status.
std::ostream & operator<<(std::ostream &, const SingleLine &)
Numeric mT0
Reference temperature for all parameters of the lines.
Numeric CutoffFreqValue() const noexcept
Returns internal cutoff frequency value.
constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept
Return a upper quantum number by copy.
Definition: quantum.h:597
void SetLineMixing2AER(const Vector &d)
Set the line mixing model to AER kind.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
Definition: sstream.h:204
Container class for Quantum Numbers.
Definition: quantum.h:222
Headers and class definition of Zeeman modeling.
static bool validIndexForNormalization(Index x) noexcept
Checks if index is a valid normalization.
std::vector< Rational > & UpperQuantumNumbers() noexcept
Upper level quantum numbers.
constexpr Index nelem(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the number of elements of the polarization type of this transition.
Definition: zeemandata.h:135
std::vector< Rational > & LowerQuantumNumbers() noexcept
Lower level quantum numbers.
String cutofftype2metadatastring(CutoffType in, Numeric cutoff)
G0 G2 FVC Y DV F0
bool mselfbroadening
Does the line broadening have self broadening.
Polarization
Zeeman polarization selection.
Definition: zeemandata.h:43
SingleLine(size_t nbroadeners, size_t nquanta, const LineShape::Model &metamodel)
Initialization for constant sizes.
Numeric & E0(size_t k) noexcept
Lower level energy.
NormalizationType Normalization() const noexcept
Returns normalization style.
NormalizationType string2normalizationtype(const String &in)
ArrayOfSpeciesTag & BroadeningSpecies() noexcept
Returns the broadening species.
Numeric F0(size_t k) const noexcept
Central frequency.
Index LineShapeElems() const noexcept
Number of lineshape elements.
bool id_in_line(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
#define max(a, b)
const std::vector< Rational > & UpperQuantumNumbers() const noexcept
Upper level quantum numbers.
Absorption::Lines AbsorptionLines
std::vector< QuantumNumberType > mlocalquanta
List of local quantum numbers, these must be defined.
A constant view of a Vector.
Definition: matpackI.h:476
static LineShape::Type string2LineShapeType(const String &type) noexcept
#define nlines
const std::vector< Rational > & LowerQuantumNumbers() const noexcept
Lower level quantum numbers.
Numeric & g_upp(size_t k) noexcept
Upper level statistical weight.
Index nelem() const
Index nelem(const Lines &l)
Number of lines.
Absorption::SingleLine AbsorptionSingleLine
MirroringType Mirroring() const noexcept
Returns mirroring style.
void truncate_global_quantum_numbers()
Removes all global quantum numbers.
Lines createEmptyCopy(const Lines &al) noexcept
Creates a copy of the input lines structure.
Binary output file stream class.
Definition: bofstream.h:42
Index NumBroadeners() const noexcept
Number of broadening species.
const LineShape::Model & LineShape() const noexcept
Line shape model.
bool MatchWithExternal(const SingleLineExternal &sle, const QuantumIdentifier &quantumidentity) const noexcept
Checks if an external line matches this structure.
bifstream & read(bifstream &bif)
Binary read for AbsorptionLines.
Numeric g_upp(size_t k) const noexcept
Upper level statistical weight.
Rational & UpperQuantumNumber(size_t i) noexcept
Upper quantum number.
Single line reading output.
const QuantumIdentifier & QuantumIdentity() const noexcept
Returns identity status.
void LineShapeType(LineShape::Type x) noexcept
Sets lineshapetype style.
Zeeman::Model Zeeman() const noexcept
Zeeman model.
String populationtype2metadatastring(PopulationType in)
Index ZeemanCount(size_t k, Zeeman::Polarization type) const noexcept
Returns the number of Zeeman split lines.
String normalizationtype2metadatastring(NormalizationType in)
static CutoffType string2Cutoff(const String &in) noexcept
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
std::vector< Rational > mupperquanta
Upper level quantum numbers.
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify(const T &first, const Ts &... the_rest)
Make a std::array of a list of variables (must be 1-long at least)
Definition: array.h:374
static bool validIndexForLineShapeType(Index x) noexcept
Checks if index is a valid lineshapetype.
Rational LowerQuantumNumber(size_t i) const noexcept
Lower quantum number.
void LinemixingLimit(Numeric x) noexcept
Sets line mixing limit.
Numeric & I0() noexcept
Reference line strength.
Namespace to contain things required for absorption calculations.
String LineShapeMetaData() const noexcept
Meta data for the line shape if it exists.
static MirroringType string2Mirroring(const String &in) noexcept
bifstream & read(bifstream &is)
Binary read for Lines.
Array< ArrayOfAbsorptionLines > ArrayOfArrayOfAbsorptionLines
Rational & LowerQuantumNumber(size_t i) noexcept
Lower quantum number.
static PopulationType string2Population(const String &in) noexcept
CutoffType Cutoff() const noexcept
Returns cutoff style.
Index LowerQuantumElems() const noexcept
Number of lower quantum numbers.
void sort_by_frequency()
Sort inner line list by frequency.
Numeric g_upp() const noexcept
Upper level statistical weight.
Zeeman::Model mzeeman
Zeeman model.
bofstream & write(bofstream &bof) const
Binary write for AbsorptionLines.
LineShape::Type LineShapeType() const noexcept
Returns lineshapetype style.
String mirroringtype2metadatastring(MirroringType in)
String ModelShape2MetaData(const Model &m)
Zeeman::Model & Zeeman() noexcept
Zeeman model.
void Normalization(NormalizationType x) noexcept
Returns normalization style.
void Bath(bool x) noexcept
Returns bath broadening status.
static bool validIndexForMirroring(Index x) noexcept
Checks if index is a valid mirroring.
my_basic_string< char > String
The String type for ARTS.
Definition: mystring.h:280
NormalizationType mnormalization
Line normalization type.
Numeric I0() const noexcept
Reference line strength.
bool id_in_line_lower(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line&#39;s ID.
const std::vector< SingleLine > & AllLines() const noexcept
Lines.