ARTS  2.4.0(git:4fb77825)
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 */
42  const Vector& f_grid,
47  const Numeric& rtp_pressure,
48  const Numeric& rtp_temperature,
49  const EnergyLevelMap& rtp_nlte,
50  const Vector& rtp_vmr,
51  const Vector& rtp_mag,
52  const Vector& ppath_los,
53  const Index& atmosphere_dim,
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&) try {
60  if (abs_lines_per_species.nelem() == 0) return;
61 
62  if ((atmosphere_dim not_eq 3) and (not manual_zeeman_tag))
63  throw "Only for 3D *atmosphere_dim* or a manual magnetic field";
64 
65  if ((ppath_los.nelem() not_eq 2) and (not manual_zeeman_tag))
66  throw "Only for 2D *ppath_los* or a manual magnetic field";
67 
68  if (not lbl_checked)
69  throw "Please set lbl_checked true to use this function";
70 
71  // Change to LOS by radiation
73  if (not manual_zeeman_tag) mirror_los(rtp_los, ppath_los, atmosphere_dim);
74 
75  // Main computations
86  f_grid,
87  rtp_vmr,
88  rtp_nlte,
89  rtp_mag,
90  rtp_los,
93  manual_zeeman_tag,
94  manual_zeeman_magnetic_field_strength,
95  manual_zeeman_theta,
96  manual_zeeman_eta);
97 } catch (const char* e) {
98  std::ostringstream os;
99  os << "Errors raised by *propmat_clearskyAddZeeman*:\n";
100  os << "\tError: " << e << '\n';
101  throw std::runtime_error(os.str());
102 } catch (const std::exception& e) {
103  std::ostringstream os;
104  os << "Errors in calls by *propmat_clearskyAddZeeman*:\n";
105  os << e.what();
106  throw std::runtime_error(os.str());
107 }
ARTS::Var::atmosphere_dim
Index atmosphere_dim(Workspace &ws) noexcept
Definition: autoarts.h:2510
ARTS::Var::rtp_mag
Vector rtp_mag(Workspace &ws) noexcept
Definition: autoarts.h:5736
ARTS::Var::rtp_los
Vector rtp_los(Workspace &ws) noexcept
Definition: autoarts.h:5715
ARTS::Var::jacobian_quantities
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Definition: autoarts.h:3924
ARTS::Var::dnlte_dx_source
ArrayOfStokesVector dnlte_dx_source(Workspace &ws) noexcept
Definition: autoarts.h:3021
ARTS::Var::abs_lines_per_species
ArrayOfArrayOfAbsorptionLines abs_lines_per_species(Workspace &ws) noexcept
Definition: autoarts.h:2022
ARTS::Var::rtp_vmr
Vector rtp_vmr(Workspace &ws) noexcept
Definition: autoarts.h:5826
SpeciesAuxData
Auxiliary data for isotopologues.
Definition: absorption.h:217
Array
This can be used to make arrays out of anything.
Definition: array.h:108
ARTS::Var::rtp_nlte
EnergyLevelMap rtp_nlte(Workspace &ws) noexcept
Definition: autoarts.h:5754
ARTS::Var::nlte_source
ArrayOfStokesVector nlte_source(Workspace &ws) noexcept
Definition: autoarts.h:4648
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:51
ARTS::Var::abs_species
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Definition: autoarts.h:2157
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:49
global_data.h
ARTS::Var::f_grid
Vector f_grid(Workspace &ws) noexcept
Definition: autoarts.h:3449
EnergyLevelMap
Definition: energylevelmap.h:60
propagationmatrix.h
Stuff related to the propagation matrix.
ARTS::Var::rtp_pressure
Numeric rtp_pressure(Workspace &ws) noexcept
Definition: autoarts.h:5790
ARTS::Var::lbl_checked
Index lbl_checked(Workspace &ws) noexcept
Definition: autoarts.h:3996
ARTS::Var::dpropmat_clearsky_dx
ArrayOfPropagationMatrix dpropmat_clearsky_dx(Workspace &ws) noexcept
Definition: autoarts.h:3269
ARTS::Var::rtp_temperature
Numeric rtp_temperature(Workspace &ws) noexcept
Definition: autoarts.h:5807
mirror_los
void mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
Definition: rte.cc:2290
zeeman_on_the_fly
void zeeman_on_the_fly(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const SpeciesAuxData &isotopologue_ratios, const SpeciesAuxData &partition_functions, 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 &manual_tag, const Numeric &H0, const Numeric &theta0, const Numeric &eta0)
Main and only way to compute Zeeman effect.
Definition: zeeman.cc:85
ARTS::Var::partition_functions
SpeciesAuxData partition_functions(Workspace &ws) noexcept
Definition: autoarts.h:4860
ARTS::Var::isotopologue_ratios
SpeciesAuxData isotopologue_ratios(Workspace &ws) noexcept
Definition: autoarts.h:3669
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
ARTS::Var::nlte_dsource_dx
ArrayOfStokesVector nlte_dsource_dx(Workspace &ws) noexcept
Definition: autoarts.h:4581
propmat_clearskyAddZeeman
void propmat_clearskyAddZeeman(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const SpeciesAuxData &isotopologue_ratios, const SpeciesAuxData &partition_functions, 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 &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
Vector
The Vector class.
Definition: matpackI.h:860
ARTS::Var::propmat_clearsky
ArrayOfPropagationMatrix propmat_clearsky(Workspace &ws) noexcept
Definition: autoarts.h:5398
zeeman.h