ARTS 2.5.4 (git: 31ce4f0e)
m_zeeman.cc
Go to the documentation of this file.
1/* Copyright (C) 2012
2 Richard Larsson <ric.larsson@gmail.com>
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 USA. */
18
30#include "global_data.h"
31#include "propagationmatrix.h"
32#include "zeeman.h"
33
34/* Workspace method: Doxygen documentation will be auto-generated */
36 PropagationMatrix& propmat_clearsky,
37 StokesVector& nlte_source,
38 ArrayOfPropagationMatrix& dpropmat_clearsky_dx,
39 ArrayOfStokesVector& dnlte_source_dx,
40 const ArrayOfArrayOfAbsorptionLines& abs_lines_per_species,
41 const Vector& f_grid,
42 const ArrayOfArrayOfSpeciesTag& abs_species,
43 const ArrayOfSpeciesTag& select_abs_species,
44 const ArrayOfRetrievalQuantity& jacobian_quantities,
46 const Numeric& rtp_pressure,
47 const Numeric& rtp_temperature,
48 const EnergyLevelMap& rtp_nlte,
49 const Vector& rtp_vmr,
50 const Vector& rtp_mag,
51 const Vector& ppath_los,
52 const Index& atmosphere_dim,
53 const Index& nlte_do,
54 const Index& lbl_checked,
55 const Index& manual_zeeman_tag,
56 const Numeric& manual_zeeman_magnetic_field_strength,
57 const Numeric& manual_zeeman_theta,
58 const Numeric& manual_zeeman_eta,
59 const Verbosity&) {
60 if (abs_lines_per_species.nelem() == 0) return;
61
62 ARTS_USER_ERROR_IF((atmosphere_dim not_eq 3) and (not manual_zeeman_tag),
63 "Only for 3D *atmosphere_dim* or a manual magnetic field")
64
65 ARTS_USER_ERROR_IF((ppath_los.nelem() not_eq 2) and (not manual_zeeman_tag),
66 "Only for 2D *ppath_los* or a manual magnetic field");
67
68 ARTS_USER_ERROR_IF(not lbl_checked,
69 "Please set lbl_checked true to use this function")
70
71 // Change to LOS by radiation
72 Vector rtp_los;
73 if (not manual_zeeman_tag) mirror_los(rtp_los, ppath_los, atmosphere_dim);
74
75 // Main computations
76 zeeman_on_the_fly(propmat_clearsky,
77 nlte_source,
78 dpropmat_clearsky_dx,
79 dnlte_source_dx,
80 abs_species,
81 select_abs_species,
82 jacobian_quantities,
83 abs_lines_per_species,
85 f_grid,
86 rtp_vmr,
87 rtp_nlte,
88 rtp_mag,
89 rtp_los,
90 rtp_pressure,
91 rtp_temperature,
92 nlte_do,
93 manual_zeeman_tag,
94 manual_zeeman_magnetic_field_strength,
95 manual_zeeman_theta,
96 manual_zeeman_eta);
97}
98
100 const ArrayOfQuantumIdentifier& qid,
101 const Vector& gs,
102 const Verbosity&) {
103 ARTS_USER_ERROR_IF (qid.nelem() not_eq gs.nelem(), "Inputs not matching in size");
104 for (Index i=0; i<qid.nelem(); i++) {
105 const QuantumIdentifier& id = qid[i];
106 const Numeric g = gs[i];
107
108 for (AbsorptionLines& band: abs_lines) {
109 if (id.isotopologue_index not_eq band.quantumidentity.isotopologue_index) continue;
110
111 for (auto& line: band.lines) {
112 auto test = id.part_of(band.quantumidentity, line.localquanta);
113
114 if (test.upp) line.zeeman.gu(g);
115 if (test.low) line.zeeman.gl(g);
116 }
117 }
118 }
119}
120
122 const ArrayOfQuantumIdentifier& qid,
123 const Vector& gs,
124 const Verbosity& verbosity) {
125 for (auto& abs_lines: abs_lines_per_species) {
126 for (Index i=0; i<qid.nelem(); i++) {
127 abs_linesZeemanCoefficients(abs_lines, qid, gs, verbosity);
128 }
129 }
130}
This can be used to make arrays out of anything.
Definition: array.h:48
Index nelem() const ARTS_NOEXCEPT
Definition: array.h:92
Index nelem() const noexcept
Returns the number of elements.
Definition: matpackI.h:536
Stokes vector is as Propagation matrix but only has 4 possible values.
The Vector class.
Definition: matpackI.h:899
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
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:35
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:121
void abs_linesZeemanCoefficients(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &)
WORKSPACE METHOD: abs_linesZeemanCoefficients.
Definition: m_zeeman.cc:99
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
SpeciesIsotopologueRatios isotopologue_ratios()
Stuff related to the propagation matrix.
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:1812
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:37