ARTS  2.3.1285(git:92a29ea9-dirty)
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  ArrayOfPropagationMatrix& propmat_clearsky,
37  ArrayOfStokesVector& nlte_source,
38  ArrayOfPropagationMatrix& dpropmat_clearsky_dx,
39  ArrayOfStokesVector& dnlte_dx_source,
40  ArrayOfStokesVector& nlte_dsource_dx,
41  const ArrayOfArrayOfAbsorptionLines& abs_lines_per_species,
42  const Vector& f_grid,
43  const ArrayOfArrayOfSpeciesTag& abs_species,
44  const ArrayOfRetrievalQuantity& jacobian_quantities,
45  const SpeciesAuxData& isotopologue_ratios,
46  const SpeciesAuxData& partition_functions,
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
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_dx_source,
80  nlte_dsource_dx,
81  abs_species,
82  jacobian_quantities,
83  abs_lines_per_species,
84  isotopologue_ratios,
85  partition_functions,
86  f_grid,
87  rtp_vmr,
88  rtp_nlte,
89  rtp_mag,
90  rtp_los,
91  rtp_pressure,
92  rtp_temperature,
93  manual_zeeman_tag,
94  manual_zeeman_magnetic_field_strength,
95  manual_zeeman_theta,
96  manual_zeeman_eta);
97 } catch (const char* e) {
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) {
104  os << "Errors in calls by *propmat_clearskyAddZeeman*:\n";
105  os << e.what();
106  throw std::runtime_error(os.str());
107 }
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Index nelem() const
Number of elements.
Definition: array.h:195
The Vector class.
Definition: matpackI.h:860
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:51
Stuff related to the propagation matrix.
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
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
Definition: sstream.h:204
This can be used to make arrays out of anything.
Definition: array.h:40
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
Auxiliary data for isotopologues.
Definition: absorption.h:217
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