11#ifndef absorptionlines_h
12#define absorptionlines_h
19#include "matpack_concepts.h"
41constexpr std::string_view mirroringtype2metadatastring(MirroringType in)
noexcept {
43 case MirroringType::None:
44 return "These lines are not mirrored at 0 Hz.\n";
45 case MirroringType::Lorentz:
46 return "These lines are mirrored around 0 Hz using the Lorentz line shape.\n";
47 case MirroringType::SameAsLineShape:
48 return "These line are mirrored around 0 Hz using the original line shape.\n";
49 case MirroringType::Manual:
50 return "There are manual line entries in the catalog to mirror this line.\n";
51 case MirroringType::FINAL:
break;
53 return "There's an error";
68constexpr std::string_view normalizationtype2metadatastring(NormalizationType in) {
70 case NormalizationType::None:
71 return "No re-normalization in the far wing will be applied.\n";
72 case NormalizationType::VVH:
73 return "van Vleck and Huber far-wing renormalization will be applied, "
74 "i.e. F ~ (f tanh(hf/2kT))/(f0 tanh(hf0/2kT))\n";
75 case NormalizationType::VVW:
76 return "van Vleck and Weisskopf far-wing renormalization will be applied, "
77 "i.e. F ~ (f/f0)^2\n";
78 case NormalizationType::RQ:
79 return "Rosenkranz quadratic far-wing renormalization will be applied, "
80 "i.e. F ~ hf0/2kT sinh(hf0/2kT) (f/f0)^2\n";
81 case NormalizationType::SFS:
82 return "Simple frequency scaling of the far-wings will be applied, "
83 "i.e. F ~ (f / f0) * ((1 - exp(- hf / kT)) / (1 - exp(- hf0 / kT)))\n";
84 case NormalizationType::FINAL:
break;
86 return "There's an error";
97 ByHITRANRosenkranzRelmat,
100 ByRovibLinearDipoleLineMixing
103constexpr std::string_view populationtype2metadatastring(PopulationType in) {
105 case PopulationType::LTE:
106 return "The lines are considered as in pure LTE.\n";
107 case PopulationType::ByMakarovFullRelmat:
108 return "The lines requires relaxation matrix calculations in LTE - Makarov et al 2020 full method.\n";
109 case PopulationType::ByRovibLinearDipoleLineMixing:
110 return "The lines requires relaxation matrix calculations in LTE - Hartmann, Boulet, Robert, 2008, 1st edition method.\n";
111 case PopulationType::ByHITRANFullRelmat:
112 return "The lines requires relaxation matrix calculations in LTE - HITRAN full method.\n";
113 case PopulationType::ByHITRANRosenkranzRelmat:
114 return "The lines requires Relaxation matrix calculations in LTE - HITRAN Rosenkranz method.\n";
115 case PopulationType::VibTemps:
116 return "The lines are considered as in NLTE by vibrational temperatures.\n";
117 case PopulationType::NLTE:
118 return "The lines are considered as in pure NLTE.\n";
119 case PopulationType::FINAL:
return "There's an error";
121 return "There's an error";
125 return in == PopulationType::ByHITRANFullRelmat or
126 in == PopulationType::ByMakarovFullRelmat or
127 in == PopulationType::ByHITRANRosenkranzRelmat or
128 in == PopulationType::ByRovibLinearDipoleLineMixing;
196 lineshape(std::move(lineshape_)),
197 localquanta(std::move(localquanta_)) {}
205 lineshape(
std::move(metamodel)), localquanta(
std::move(metaquanta)) {}
233 void SetLineMixing2SecondOrderData(
const Vector&
d);
239 void SetLineMixing2AER(
const Vector&
d);
329 bool bathbroadening_=
false,
330 CutoffType cutoff_=CutoffType::None,
331 MirroringType mirroring_=MirroringType::None,
332 PopulationType population_=PopulationType::LTE,
333 NormalizationType normalization_=NormalizationType::None,
334 LineShape::Type lineshapetype_=LineShape::Type::DP,
336 Numeric cutofffreq_=-1,
337 Numeric linemixinglimit_=-1,
353 lines(std::move(lines_)) {
377 bool bathbroadening_,
380 MirroringType mirroring_,
381 PopulationType population_,
382 NormalizationType normalization_,
383 LineShape::Type lineshapetype_,
386 Numeric linemixinglimit_,
449 [[nodiscard]] std::pair<bool, bool>
Match(
const Lines& l)
const noexcept;
470 [[nodiscard]] Index
NumLines() const noexcept;
512 [[nodiscard]] Numeric
F_mean(Numeric T=0) const noexcept;
519 [[nodiscard]] Numeric
F_mean(const ConstVectorView& wgts) const noexcept;
529 [[nodiscard]]
bool DoLineMixing(Numeric P) const noexcept;
599 [[nodiscard]] Numeric
CutoffFreq(
size_t k, Numeric shift=0) const noexcept;
606 [[nodiscard]] Numeric
CutoffFreqMinus(
size_t k, Numeric shift=0) const noexcept;
624 [[nodiscard]] Numeric
SpeciesMass() const noexcept;
665 friend
std::ostream& operator<<(
std::ostream&, const
Lines&);
667 friend
std::istream& operator>>(
std::istream&,
Lines&);
887 const std::vector<QuantumNumberType>& globalquantas={});
890Index
nelem(
const Lines& l);
938 bool None{
false}, Lorentz{
false}, SameAsLineShape{
false}, Manual{
false};
944 bool None{
false}, VVH{
false}, VVW{
false}, RQ{
false}, SFS{
false};
950 bool LTE{
false}, NLTE{
false}, VibTemps{
false},
951 ByHITRANRosenkranzRelmat{
false}, ByHITRANFullRelmat{
false},
952 ByMakarovFullRelmat{
false}, ByRovibLinearDipoleLineMixing{
false};
958 bool None{
false}, ByLine{
false};
964 bool DP{
false}, LP{
false}, VP{
false},
SDVP{
false}, HTP{
false}, SplitLP{
false},
965 SplitVP{
false}, SplitSDVP{
false}, SplitHTP{
false};
967 friend std::ostream &
operator<<(std::ostream &,
980 normalization(lines),
983 lineshapetype(lines) {}
std::ostream & operator<<(std::ostream &os, AbsorptionCutoffTagTypeStatus val)
AbsorptionSpeciesBandIndex flat_index(Index i, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species)
Get a flat index pair for species and band.
Absorption::CutoffType AbsorptionCutoffType
Absorption::NormalizationType AbsorptionNormalizationType
Absorption::PopulationType AbsorptionPopulationType
Absorption::MirroringType AbsorptionMirroringType
This file contains the class declaration of bifstream.
This file contains the class declaration of bofstream.
Main line shape model class.
Binary output file stream class.
Binary output file stream class.
#define ENUMCLASS(ENUMTYPE, TYPE,...)
Routines for setting up the jacobian.
Contains the line shape namespace.
Namespace to contain things required for absorption calculations.
constexpr bool relaxationtype_relmat(PopulationType in) noexcept
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
String cutofftype2metadatastring(CutoffType in, Numeric cutoff)
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
Numeric reduced_rovibrational_dipole(Rational Jf, Rational Ji, Rational lf, Rational li, Rational k=Rational(1))
Compute the reduced rovibrational dipole moment.
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
Index nelem(const Lines &l)
Number of lines.
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
std::ostream & operator<<(std::ostream &os, const Absorption::Lines &lines)
std::istream & operator>>(std::istream &is, Lines &lines)
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
bool any_cutoff(const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species)
Numeric reduced_magnetic_quadrapole(Rational Jf, Rational Ji, Rational N)
Compute the reduced magnetic quadrapole moment.
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
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.
Computations of line shape derived parameters.
Implements Zeeman modeling.
Quantum::Number::GlobalState QuantumIdentifier
Quantum::Number::Type QuantumNumberType
Helper struct for flat_index.
Index iband
The band index in abs_lines_per_species[ispecies].
Index ispecies
The species index in abs_species/abs_lines_per_species.
AbsorptionNormalizationTagTypeStatus normalization
AbsorptionPopulationTagTypeStatus population
AbsorptionLineShapeTagTypeStatus lineshapetype
AbsorptionCutoffTagTypeStatus cutoff
AbsorptionMirroringTagTypeStatus mirroring
AbsorptionTagTypesStatus(const ArrayOfArrayOfAbsorptionLines &lines)
void sort_by_einstein()
Sort inner line list by Einstein coefficient.
void sort_by_frequency()
Sort inner line list by frequency.
Index NumBroadeners() const ARTS_NOEXCEPT
Number of broadening species.
SingleLine PopLine(Index) noexcept
Pops a single line.
Index BroadeningSpeciesPosition(Species::Species spec) const noexcept
Position of species if available or -1 else.
Numeric T0
Reference temperature for all parameters of the lines.
PopulationType population
Line population distribution.
Index NumLocalQuanta() const noexcept
Number of broadening species.
static constexpr Index version
void RemoveLine(Index) noexcept
Removes a single line.
Numeric F_mean(Numeric T=0) const noexcept
Mean frequency by weight of line strength.
void SetAutomaticZeeman() noexcept
Set Zeeman effect for all lines that have the correct quantum numbers.
Vector BroadeningSpeciesVMR(const ConstVectorView &, const ArrayOfArrayOfSpeciesTag &) const
Returns the VMRs of the broadening species.
bool bathbroadening
Does the line broadening have bath broadening.
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_, QuantumIdentifier quantumidentity_, ArrayOfSpecies broadeningspecies_, const Quantum::Number::LocalState &metalocalquanta, const LineShape::Model &metamodel)
XML-tag initialization.
Numeric ZeemanSplitting(size_t k, Zeeman::Polarization type, Index i) const ARTS_NOEXCEPT
Returns the splitting of a Zeeman split line.
Array< SingleLine > lines
A list of individual lines.
Index NumLines() const noexcept
Number of lines.
bofstream & write(bofstream &os) const
Binary write for Lines.
Numeric linemixinglimit
linemixing limit
Numeric DopplerConstant(Numeric T) const noexcept
bool OnTheFlyLineMixing() const noexcept
On-the-fly line mixing.
Numeric ZeemanStrength(size_t k, Zeeman::Polarization type, Index i) const ARTS_NOEXCEPT
Returns the strength of a Zeeman split line.
NormalizationType normalization
Line normalization type.
QuantumIdentifier QuantumIdentityOfLine(Index k) const noexcept
bool OK() const ARTS_NOEXCEPT
bifstream & read(bifstream &is)
Binary read for Lines.
bool MatchWithExternal(const SingleLineExternal &sle, const QuantumIdentifier &quantumidentity) const ARTS_NOEXCEPT
Checks if an external line matches this structure.
Species::IsotopeRecord Isotopologue() const noexcept
Isotopologue Index.
String LineShapeMetaData() const noexcept
Meta data for the line shape if it exists.
LineShape::Type lineshapetype
Type of line shape.
void MakeLineShapeModelCommon()
Make a common line shape if possible.
String SpeciesName() const noexcept
Species Name.
Numeric cutofffreq
cutoff frequency
Index LineShapePos(const Species::Species spec) const ARTS_NOEXCEPT
Position among broadening species or -1.
MirroringType mirroring
Mirroring type.
LineShape::Output ShapeParameters(size_t k, Numeric T, Numeric P, const Vector &vmrs) const ARTS_NOEXCEPT
Line shape parameters.
Index ZeemanCount(size_t k, Zeeman::Polarization type) const ARTS_NOEXCEPT
Returns the number of Zeeman split lines.
CutoffType cutoff
cutoff type, by band or by line
Numeric CutoffFreq(size_t k, Numeric shift=0) const noexcept
Returns cutoff frequency or maximum value.
void ReverseLines() noexcept
Reverses the order of the internal lines.
std::pair< bool, bool > Match(const Lines &l) const noexcept
Checks if another line list matches this structure.
void AppendSingleLine(SingleLine &&sl)
Appends a single line to the absorption lines.
ArrayOfSpecies broadeningspecies
A list of broadening species.
Numeric SelfVMR(const ConstVectorView &, const ArrayOfArrayOfSpeciesTag &) const
Returns the VMR of the species.
Numeric CutoffFreqMinus(size_t k, Numeric shift=0) const noexcept
Returns negative cutoff frequency or lowest value.
bool AnyLinemixing() const noexcept
Lines(bool selfbroadening_=false, bool bathbroadening_=false, CutoffType cutoff_=CutoffType::None, MirroringType mirroring_=MirroringType::None, PopulationType population_=PopulationType::LTE, NormalizationType normalization_=NormalizationType::None, LineShape::Type lineshapetype_=LineShape::Type::DP, Numeric T0_=296, Numeric cutofffreq_=-1, Numeric linemixinglimit_=-1, QuantumIdentifier quantumidentity_=QuantumIdentifier(), ArrayOfSpecies broadeningspecies_={}, Array< SingleLine > lines_={})
Default initialization.
String MetaData() const
Returns a printable statement about the lines.
bool DoLineMixing(Numeric P) const noexcept
Returns if the pressure should do line mixing.
bool selfbroadening
Does the line broadening have self broadening.
Rational max(QuantumNumberType) const
Numeric SpeciesMass() const noexcept
Mass of the molecule.
QuantumIdentifier quantumidentity
Catalog ID.
bool DoVmrDerivative(const QuantumIdentifier &qid) const noexcept
LineShape::Output ShapeParameters_dVMR(size_t k, Numeric T, Numeric P, const QuantumIdentifier &vmr_qid) const ARTS_NOEXCEPT
Line shape parameters vmr derivative.
LineShape::Output ShapeParameters_dT(size_t k, Numeric T, Numeric P, const Vector &vmrs) const ARTS_NOEXCEPT
Line shape parameters temperature derivatives.
Vector BroadeningSpeciesMass(const ConstVectorView &, const ArrayOfArrayOfSpeciesTag &, const SpeciesIsotopologueRatios &, const Numeric &bath_mass=0) const
Returns the mass of the broadening species.
Single line reading output.
QuantumIdentifier quantumidentity
PopulationType population
NormalizationType normalization
LineShape::Type lineshapetype
Computations and data for a single absorption line.
SingleLine(Quantum::Number::LocalState metaquanta, LineShape::Model metamodel)
Initialization for constant sizes.
Index LineShapeElems() const noexcept
Number of lineshape elements.
SingleLine(Numeric F0_=0, Numeric I0_=0, Numeric E0_=0, Numeric glow_=0, Numeric gupp_=0, Numeric A_=0, Zeeman::Model zeeman_=Zeeman::Model(), LineShape::Model lineshape_=LineShape::Model(), Quantum::Number::LocalState localquanta_={})
Default initialization.
Index LocalQuantumElems() const ARTS_NOEXCEPT
Number of lower quantum numbers.
A logical struct for global quantum numbers with species identifiers.
Species::Species Species() const noexcept
A logical struct for local quantum numbers.
Headers and class definition of Zeeman modeling.