32#ifndef absorptionlines_h
33#define absorptionlines_h
61#pragma GCC diagnostic push
62#pragma GCC diagnostic ignored "-Wreturn-type"
63constexpr std::string_view mirroringtype2metadatastring(MirroringType in)
noexcept {
65 case MirroringType::None:
66 return "These lines are not mirrored at 0 Hz.\n";
67 case MirroringType::Lorentz:
68 return "These lines are mirrored around 0 Hz using the Lorentz line shape.\n";
69 case MirroringType::SameAsLineShape:
70 return "These line are mirrored around 0 Hz using the original line shape.\n";
71 case MirroringType::Manual:
72 return "There are manual line entries in the catalog to mirror this line.\n";
73 case MirroringType::FINAL:
break;
76#pragma GCC diagnostic pop
90#pragma GCC diagnostic push
91#pragma GCC diagnostic ignored "-Wreturn-type"
92constexpr std::string_view normalizationtype2metadatastring(NormalizationType in) {
94 case NormalizationType::None:
95 return "No re-normalization in the far wing will be applied.\n";
96 case NormalizationType::VVH:
97 return "van Vleck and Huber far-wing renormalization will be applied, "
98 "i.e. F ~ (f tanh(hf/2kT))/(f0 tanh(hf0/2kT))\n";
99 case NormalizationType::VVW:
100 return "van Vleck and Weisskopf far-wing renormalization will be applied, "
101 "i.e. F ~ (f/f0)^2\n";
102 case NormalizationType::RQ:
103 return "Rosenkranz quadratic far-wing renormalization will be applied, "
104 "i.e. F ~ hf0/2kT sinh(hf0/2kT) (f/f0)^2\n";
105 case NormalizationType::SFS:
106 return "Simple frequency scaling of the far-wings will be applied, "
107 "i.e. F ~ (f / f0) * ((1 - exp(- hf / kT)) / (1 - exp(- hf0 / kT)))\n";
108 case NormalizationType::FINAL:
break;
111#pragma GCC diagnostic pop
121 ByHITRANRosenkranzRelmat,
124 ByRovibLinearDipoleLineMixing
127#pragma GCC diagnostic push
128#pragma GCC diagnostic ignored "-Wreturn-type"
129constexpr std::string_view populationtype2metadatastring(PopulationType in) {
131 case PopulationType::LTE:
132 return "The lines are considered as in pure LTE.\n";
133 case PopulationType::ByMakarovFullRelmat:
134 return "The lines requires relaxation matrix calculations in LTE - Makarov et al 2020 full method.\n";
135 case PopulationType::ByRovibLinearDipoleLineMixing:
136 return "The lines requires relaxation matrix calculations in LTE - Hartmann, Boulet, Robert, 2008, 1st edition method.\n";
137 case PopulationType::ByHITRANFullRelmat:
138 return "The lines requires relaxation matrix calculations in LTE - HITRAN full method.\n";
139 case PopulationType::ByHITRANRosenkranzRelmat:
140 return "The lines requires Relaxation matrix calculations in LTE - HITRAN Rosenkranz method.\n";
141 case PopulationType::VibTemps:
142 return "The lines are considered as in NLTE by vibrational temperatures.\n";
143 case PopulationType::NLTE:
144 return "The lines are considered as in pure NLTE.\n";
145 case PopulationType::FINAL:
return "There's an error";
148#pragma GCC diagnostic pop
151 return in == PopulationType::ByHITRANFullRelmat or
152 in == PopulationType::ByMakarovFullRelmat or
153 in == PopulationType::ByHITRANRosenkranzRelmat or
154 in == PopulationType::ByRovibLinearDipoleLineMixing;
222 lineshape(std::move(lineshape_)),
223 localquanta(std::move(localquanta_)) {}
231 lineshape(
std::move(metamodel)), localquanta(
std::move(metaquanta)) {}
259 void SetLineMixing2SecondOrderData(
const Vector&
d);
265 void SetLineMixing2AER(
const Vector&
d);
274std::ostream&
operator<<(std::ostream&,
const SingleLine&);
276std::istream&
operator>>(std::istream&, SingleLine&);
355 bool bathbroadening_=
false,
356 CutoffType cutoff_=CutoffType::None,
357 MirroringType mirroring_=MirroringType::None,
358 PopulationType population_=PopulationType::LTE,
359 NormalizationType normalization_=NormalizationType::None,
360 LineShape::Type lineshapetype_=LineShape::Type::DP,
379 lines(std::move(lines_)) {
403 bool bathbroadening_,
406 MirroringType mirroring_,
407 PopulationType population_,
408 NormalizationType normalization_,
409 LineShape::Type lineshapetype_,
475 [[nodiscard]] std::pair<bool, bool>
Match(
const Lines&
l)
const noexcept;
506 return lines.size() ?
lines.front().localquanta.val.nelem() : 0;}
550 return population == PopulationType::ByMakarovFullRelmat or
551 population == PopulationType::ByRovibLinearDipoleLineMixing;
560 return linemixinglimit < 0 ? true : linemixinglimit > P;
571 for (
auto& line :
lines) {
572 for (
auto& shape : line.lineshape.Data()) {
573 if (shape.Y().type not_eq LineShape::TemperatureModel::None or
574 shape.G().type not_eq LineShape::TemperatureModel::None or
575 shape.DV().type not_eq LineShape::TemperatureModel::None) {
721 [[nodiscard]]
bool OK() const noexcept;
728std::ostream& operator<<(
std::ostream&, const
Lines&);
948 const std::vector<QuantumNumberType>& globalquantas={});
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.
Index nelem() const ARTS_NOEXCEPT
Number of elements.
A constant view of a Vector.
Main line shape model class.
Implements rational numbers to work with other ARTS types.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Binary output file stream class.
Binary output file stream class.
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.
std::ostream & operator<<(std::ostream &, const SingleLine &)
constexpr bool relaxationtype_relmat(PopulationType in) noexcept
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
ENUMCLASS(MirroringType, char, None, Lorentz, SameAsLineShape, Manual) const expr std
Describes the type of mirroring line effects.
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::istream & operator>>(std::istream &, SingleLine &)
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
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.
constexpr Numeric l(const Index p0, const Index n, const Numeric x, const SortedVectorType &xi, const Index j, const std::pair< Numeric, Numeric > cycle={ -180, 180}) noexcept
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const ArrayOfSpecies &lineshape_species) ARTS_NOEXCEPT
Returns a VMR vector for this model's main calculations.
VectorView std(VectorView std, const Vector &y, const ArrayOfVector &ys, const Index start, const Index end_tmp)
Compute the standard deviation of the ranged ys.
Polarization
Zeeman polarization selection.
void read(HitranRelaxationMatrixData &hitran, ArrayOfAbsorptionLines &bands, const SpeciesIsotopologueRatios &isotopologue_ratio, const String &basedir, const Numeric linemixinglimit, const Numeric fmin, const Numeric fmax, const Numeric stot, const ModeOfLineMixing mode)
Read from HITRAN online line mixing file.
Quantum::Number::GlobalState QuantumIdentifier
Quantum::Number::Type QuantumNumberType
void sort_by_einstein()
Sort inner line list by Einstein coefficient.
void sort_by_frequency()
Sort inner line list by frequency.
Numeric ZeemanSplitting(size_t k, Zeeman::Polarization type, Index i) const noexcept
Returns the splitting of a Zeeman split line.
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.
LineShape::Output ShapeParameters_dT(size_t k, Numeric T, Numeric P, const Vector &vmrs) const noexcept
Line shape parameters temperature derivatives.
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.
LineShape::Output ShapeParameters_dVMR(size_t k, Numeric T, Numeric P, const QuantumIdentifier &vmr_qid) const noexcept
Line shape parameters vmr derivative.
Array< SingleLine > lines
A list of individual lines.
Numeric ShapeParameter_dInternal(size_t k, Numeric T, Numeric P, const Vector &vmrs, const RetrievalQuantity &derivative) const noexcept
Line shape parameter internal derivative.
Index NumLines() const noexcept
Number of lines.
bofstream & write(bofstream &os) const
Binary write for Lines.
Numeric linemixinglimit
linemixing limit
Index NumBroadeners() const noexcept
Number of broadening species.
Numeric DopplerConstant(Numeric T) const noexcept
bool OnTheFlyLineMixing() const noexcept
On-the-fly line mixing.
NormalizationType normalization
Line normalization type.
QuantumIdentifier QuantumIdentityOfLine(Index k) const noexcept
bifstream & read(bifstream &is)
Binary read for Lines.
LineShape::Output ShapeParameters(size_t k, Numeric T, Numeric P, const Vector &vmrs) const noexcept
Line shape parameters.
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
MirroringType mirroring
Mirroring type.
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.
Index ZeemanCount(size_t k, Zeeman::Polarization type) const noexcept
Returns the number of Zeeman split lines.
bool DoLineMixing(Numeric P) const noexcept
Returns if the pressure should do line mixing.
Index LineShapePos(const QuantumIdentifier &qid) const noexcept
Position among broadening species or -1.
bool selfbroadening
Does the line broadening have self broadening.
Numeric SpeciesMass() const noexcept
Mass of the molecule.
Index LineShapePos(const Species::Species spec) const noexcept
Position among broadening species or -1.
QuantumIdentifier quantumidentity
Catalog ID.
Numeric ZeemanStrength(size_t k, Zeeman::Polarization type, Index i) const noexcept
Returns the strength of a Zeeman split line.
bool DoVmrDerivative(const QuantumIdentifier &qid) const noexcept
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 LocalQuantumElems() const noexcept
Number of lower quantum numbers.
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.
A logical struct for global quantum numbers with species identifiers.
Species::Species Species() const noexcept
Species::IsotopeRecord Isotopologue() const noexcept
A logical struct for local quantum numbers.
Struct containing all information needed about one isotope.
Headers and class definition of Zeeman modeling.