ARTS 2.5.11 (git: 725533f0)
m_zeeman.cc
Go to the documentation of this file.
1
12#include "global_data.h"
13#include "propagationmatrix.h"
14#include "zeeman.h"
15
16/* Workspace method: Doxygen documentation will be auto-generated */
18 PropagationMatrix& propmat_clearsky,
19 StokesVector& nlte_source,
20 ArrayOfPropagationMatrix& dpropmat_clearsky_dx,
21 ArrayOfStokesVector& dnlte_source_dx,
22 const ArrayOfArrayOfAbsorptionLines& abs_lines_per_species,
23 const Vector& f_grid,
24 const ArrayOfArrayOfSpeciesTag& abs_species,
25 const ArrayOfSpeciesTag& select_abs_species,
26 const ArrayOfRetrievalQuantity& jacobian_quantities,
27 const SpeciesIsotopologueRatios& isotopologue_ratios,
28 const Numeric& rtp_pressure,
29 const Numeric& rtp_temperature,
30 const EnergyLevelMap& rtp_nlte,
31 const Vector& rtp_vmr,
32 const Vector& rtp_mag,
33 const Vector& ppath_los,
34 const Index& atmosphere_dim,
35 const Index& nlte_do,
36 const Index& lbl_checked,
37 const Index& manual_zeeman_tag,
38 const Numeric& manual_zeeman_magnetic_field_strength,
39 const Numeric& manual_zeeman_theta,
40 const Numeric& manual_zeeman_eta,
41 const Verbosity&) {
42 if (abs_lines_per_species.nelem() == 0) return;
43
44 ARTS_USER_ERROR_IF((atmosphere_dim not_eq 3) and (not manual_zeeman_tag),
45 "Only for 3D *atmosphere_dim* or a manual magnetic field")
46
47 ARTS_USER_ERROR_IF((ppath_los.nelem() not_eq 2) and (not manual_zeeman_tag),
48 "Only for 2D *ppath_los* or a manual magnetic field");
49
50 ARTS_USER_ERROR_IF(not lbl_checked,
51 "Please set lbl_checked true to use this function")
52
53 // Change to LOS by radiation
54 Vector rtp_los;
55 if (not manual_zeeman_tag) mirror_los(rtp_los, ppath_los, atmosphere_dim);
56
57 // Main computations
58 zeeman_on_the_fly(propmat_clearsky,
59 nlte_source,
60 dpropmat_clearsky_dx,
61 dnlte_source_dx,
62 abs_species,
63 select_abs_species,
64 jacobian_quantities,
65 abs_lines_per_species,
66 isotopologue_ratios,
67 f_grid,
68 rtp_vmr,
69 rtp_nlte,
70 rtp_mag,
71 rtp_los,
72 rtp_pressure,
73 rtp_temperature,
74 nlte_do,
75 manual_zeeman_tag,
76 manual_zeeman_magnetic_field_strength,
77 manual_zeeman_theta,
78 manual_zeeman_eta);
79}
80
82 const ArrayOfQuantumIdentifier& qid,
83 const Vector& gs,
84 const Verbosity&) {
85 ARTS_USER_ERROR_IF (qid.nelem() not_eq gs.nelem(), "Inputs not matching in size");
86 for (Index i=0; i<qid.nelem(); i++) {
87 const QuantumIdentifier& id = qid[i];
88 const Numeric g = gs[i];
89
90 for (AbsorptionLines& band: abs_lines) {
91 if (id.isotopologue_index not_eq band.quantumidentity.isotopologue_index) continue;
92
93 for (auto& line: band.lines) {
94 auto test = id.part_of(band.quantumidentity, line.localquanta);
95
96 if (test.upp) line.zeeman.gu(g);
97 if (test.low) line.zeeman.gl(g);
98 }
99 }
100 }
101}
102
104 const ArrayOfQuantumIdentifier& qid,
105 const Vector& gs,
106 const Verbosity& verbosity) {
107 for (auto& abs_lines: abs_lines_per_species) {
108 for (Index i=0; i<qid.nelem(); i++) {
109 abs_linesZeemanCoefficients(abs_lines, qid, gs, verbosity);
110 }
111 }
112}
This can be used to make arrays out of anything.
Definition array.h:31
Index nelem() const ARTS_NOEXCEPT
Definition array.h:75
#define ARTS_USER_ERROR_IF(condition,...)
Definition debug.h:137
void propmat_clearskyAddZeeman(PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const SpeciesIsotopologueRatios &isotopologue_ratios, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const EnergyLevelMap &rtp_nlte, const Vector &rtp_vmr, const Vector &rtp_mag, const Vector &ppath_los, const Index &atmosphere_dim, const Index &nlte_do, const Index &lbl_checked, const Index &manual_zeeman_tag, const Numeric &manual_zeeman_magnetic_field_strength, const Numeric &manual_zeeman_theta, const Numeric &manual_zeeman_eta, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyAddZeeman.
Definition m_zeeman.cc:17
void abs_lines_per_speciesZeemanCoefficients(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesZeemanCoefficients.
Definition m_zeeman.cc:103
void abs_linesZeemanCoefficients(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &)
WORKSPACE METHOD: abs_linesZeemanCoefficients.
Definition m_zeeman.cc:81
void mirror_los(Vector &los_mirrored, const ConstVectorView &los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
Definition rte.cc:1792
A logical struct for global quantum numbers with species identifiers.
void zeeman_on_the_fly(PropagationMatrix &propmat_clearsky, StokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_source_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfSpeciesTag &select_abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const SpeciesIsotopologueRatios &isotopologue_ratios, const Vector &f_grid, const Vector &rtp_vmr, const EnergyLevelMap &rtp_nlte, const Vector &rtp_mag, const Vector &rtp_los, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Index &nlte_do, const Index &manual_tag, const Numeric &H0, const Numeric &theta0, const Numeric &eta0)
Main and only way to compute Zeeman effect.
Definition zeeman.cc:20