32#ifndef absorptionlines_h
33#define absorptionlines_h
62constexpr std::string_view mirroringtype2metadatastring(MirroringType in)
noexcept {
64 case MirroringType::None:
65 return "These lines are not mirrored at 0 Hz.\n";
66 case MirroringType::Lorentz:
67 return "These lines are mirrored around 0 Hz using the Lorentz line shape.\n";
68 case MirroringType::SameAsLineShape:
69 return "These line are mirrored around 0 Hz using the original line shape.\n";
70 case MirroringType::Manual:
71 return "There are manual line entries in the catalog to mirror this line.\n";
72 case MirroringType::FINAL:
break;
74 return "There's an error";
89constexpr std::string_view normalizationtype2metadatastring(NormalizationType in) {
91 case NormalizationType::None:
92 return "No re-normalization in the far wing will be applied.\n";
93 case NormalizationType::VVH:
94 return "van Vleck and Huber far-wing renormalization will be applied, "
95 "i.e. F ~ (f tanh(hf/2kT))/(f0 tanh(hf0/2kT))\n";
96 case NormalizationType::VVW:
97 return "van Vleck and Weisskopf far-wing renormalization will be applied, "
98 "i.e. F ~ (f/f0)^2\n";
99 case NormalizationType::RQ:
100 return "Rosenkranz quadratic far-wing renormalization will be applied, "
101 "i.e. F ~ hf0/2kT sinh(hf0/2kT) (f/f0)^2\n";
102 case NormalizationType::SFS:
103 return "Simple frequency scaling of the far-wings will be applied, "
104 "i.e. F ~ (f / f0) * ((1 - exp(- hf / kT)) / (1 - exp(- hf0 / kT)))\n";
105 case NormalizationType::FINAL:
break;
107 return "There's an error";
118 ByHITRANRosenkranzRelmat,
121 ByRovibLinearDipoleLineMixing
124constexpr std::string_view populationtype2metadatastring(PopulationType in) {
126 case PopulationType::LTE:
127 return "The lines are considered as in pure LTE.\n";
128 case PopulationType::ByMakarovFullRelmat:
129 return "The lines requires relaxation matrix calculations in LTE - Makarov et al 2020 full method.\n";
130 case PopulationType::ByRovibLinearDipoleLineMixing:
131 return "The lines requires relaxation matrix calculations in LTE - Hartmann, Boulet, Robert, 2008, 1st edition method.\n";
132 case PopulationType::ByHITRANFullRelmat:
133 return "The lines requires relaxation matrix calculations in LTE - HITRAN full method.\n";
134 case PopulationType::ByHITRANRosenkranzRelmat:
135 return "The lines requires Relaxation matrix calculations in LTE - HITRAN Rosenkranz method.\n";
136 case PopulationType::VibTemps:
137 return "The lines are considered as in NLTE by vibrational temperatures.\n";
138 case PopulationType::NLTE:
139 return "The lines are considered as in pure NLTE.\n";
140 case PopulationType::FINAL:
return "There's an error";
142 return "There's an error";
146 return in == PopulationType::ByHITRANFullRelmat or
147 in == PopulationType::ByMakarovFullRelmat or
148 in == PopulationType::ByHITRANRosenkranzRelmat or
149 in == PopulationType::ByRovibLinearDipoleLineMixing;
217 lineshape(std::move(lineshape_)),
218 localquanta(std::move(localquanta_)) {}
226 lineshape(std::move(metamodel)), localquanta(std::move(metaquanta)) {}
254 void SetLineMixing2SecondOrderData(
const Vector&
d);
260 void SetLineMixing2AER(
const Vector&
d);
350 bool bathbroadening_=
false,
351 CutoffType cutoff_=CutoffType::None,
352 MirroringType mirroring_=MirroringType::None,
353 PopulationType population_=PopulationType::LTE,
354 NormalizationType normalization_=NormalizationType::None,
355 LineShape::Type lineshapetype_=LineShape::Type::DP,
374 lines(std::move(lines_)) {
398 bool bathbroadening_,
401 MirroringType mirroring_,
402 PopulationType population_,
403 NormalizationType normalization_,
404 LineShape::Type lineshapetype_,
470 [[nodiscard]] std::pair<bool, bool>
Match(
const Lines& l)
const noexcept;
686 friend std::ostream& operator<<(std::ostream&, const
Lines&);
688 friend std::istream& operator>>(std::istream&,
Lines&);
908 const std::vector<QuantumNumberType>& globalquantas={});
959 bool None{
false}, Lorentz{
false}, SameAsLineShape{
false}, Manual{
false};
965 bool None{
false}, VVH{
false}, VVW{
false}, RQ{
false}, SFS{
false};
971 bool LTE{
false}, NLTE{
false}, VibTemps{
false},
972 ByHITRANRosenkranzRelmat{
false}, ByHITRANFullRelmat{
false},
973 ByMakarovFullRelmat{
false}, ByRovibLinearDipoleLineMixing{
false};
979 bool None{
false}, ByLine{
false};
985 bool DP{
false}, LP{
false}, VP{
false},
SDVP{
false}, HTP{
false}, SplitLP{
false},
986 SplitVP{
false}, SplitSDVP{
false}, SplitHTP{
false};
988 friend std::ostream &
operator<<(std::ostream &,
1001 normalization(lines),
1004 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.
A constant view of a Vector.
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.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
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.
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.
Implements rational numbers to work with other ARTS types.
Headers and class definition of Zeeman modeling.