CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
GeomagneticModel.hpp
1 /*
2  * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
12 #include <corsika/framework/geometry/PhysicalGeometry.hpp>
14 
15 #include <boost/filesystem.hpp>
16 #include <fstream>
17 #include <string>
18 
19 namespace corsika {
20 
28 
33  struct ParameterLine {
34  int n;
35  int m;
36  double g;
37  double h;
38  double dg; //< time dependence of g in "per year"
39  double dh; //< time dependence of h in "per year"
40  };
41 
42  public:
49  GeomagneticModel(Point const& center, boost::filesystem::path const path =
50  corsika::corsika_data("GeoMag/WMM.COF"));
51 
66  MagneticFieldVector getField(double const year, LengthType const altitude,
67  double const latitude, double const longitude);
68 
69  private:
70  Point center_; //< Center of Earth.
71  std::map<int, std::vector<ParameterLine>> parameters_; //< epoch to Parameters map
72  };
73 } // namespace corsika
74 
75 #include <corsika/detail/media/GeomagneticModel.inl>
Import and extend the phys::units package.
GeomagneticModel(Point const &center, boost::filesystem::path const path=corsika::corsika_data("GeoMag/WMM.COF"))
Construct a new World Magnetic Model object.
MagneticFieldVector getField(double const year, LengthType const altitude, double const latitude, double const longitude)
Calculates the value of the magnetic field.
A magnetic field calculated with the WMM or IGRF model.
`, since they are used everywhere as integral part of the framework.
returns the full path of the file filename within the CORSIKA_DATA directory.