MagneticModel.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP)
11 #define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1
12 
16 
17 #if defined(_MSC_VER)
18 // Squelch warnings about dll vs vector
19 # pragma warning (push)
20 # pragma warning (disable: 4251)
21 #endif
22 
23 namespace GeographicLib {
24 
25  class MagneticCircle;
26 
70  private:
71  typedef Math::real real;
72  static const int idlength_ = 8;
73  std::string _name, _dir, _description, _date, _filename, _id;
74  real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax;
75  int _Nmodels, _Nconstants;
78  std::vector< std::vector<real> > _G;
79  std::vector< std::vector<real> > _H;
80  std::vector<SphericalHarmonic> _harm;
81  void Field(real t, real lat, real lon, real h, bool diffp,
82  real& Bx, real& By, real& Bz,
83  real& Bxt, real& Byt, real& Bzt) const;
84  void ReadMetadata(const std::string& name);
85  MagneticModel(const MagneticModel&); // copy constructor not allowed
86  MagneticModel& operator=(const MagneticModel&); // nor copy assignment
87  public:
88 
91 
119  explicit MagneticModel(const std::string& name,
120  const std::string& path = "",
121  const Geocentric& earth = Geocentric::WGS84());
123 
126 
140  void operator()(real t, real lat, real lon, real h,
141  real& Bx, real& By, real& Bz) const {
142  real dummy;
143  Field(t, lat, lon, h, false, Bx, By, Bz, dummy, dummy, dummy);
144  }
145 
163  void operator()(real t, real lat, real lon, real h,
164  real& Bx, real& By, real& Bz,
165  real& Bxt, real& Byt, real& Bzt) const {
166  Field(t, lat, lon, h, true, Bx, By, Bz, Bxt, Byt, Bzt);
167  }
168 
187  MagneticCircle Circle(real t, real lat, real h) const;
188 
202  static void FieldComponents(real Bx, real By, real Bz,
203  real& H, real& F, real& D, real& I) {
204  real Ht, Ft, Dt, It;
205  FieldComponents(Bx, By, Bz, real(0), real(1), real(0),
206  H, F, D, I, Ht, Ft, Dt, It);
207  }
208 
230  static void FieldComponents(real Bx, real By, real Bz,
231  real Bxt, real Byt, real Bzt,
232  real& H, real& F, real& D, real& I,
233  real& Ht, real& Ft, real& Dt, real& It);
235 
238 
243  const std::string& Description() const { return _description; }
244 
249  const std::string& DateTime() const { return _date; }
250 
254  const std::string& MagneticFile() const { return _filename; }
255 
260  const std::string& MagneticModelName() const { return _name; }
261 
265  const std::string& MagneticModelDirectory() const { return _dir; }
266 
276  Math::real MinHeight() const { return _hmin; }
277 
287  Math::real MaxHeight() const { return _hmax; }
288 
298  Math::real MinTime() const { return _tmin; }
299 
309  Math::real MaxTime() const { return _tmax; }
310 
316  Math::real MajorRadius() const { return _earth.MajorRadius(); }
317 
322  Math::real Flattening() const { return _earth.Flattening(); }
324 
335  static std::string DefaultMagneticPath();
336 
346  static std::string DefaultMagneticName();
347  };
348 
349 } // namespace GeographicLib
350 
351 #if defined(_MSC_VER)
352 # pragma warning (pop)
353 #endif
354 
355 #endif // GEOGRAPHICLIB_MAGNETICMODEL_HPP
Math::real MinHeight() const
#define I
Definition: main.h:112
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
float real
Definition: datatypes.h:10
const std::string & Description() const
Math::real MajorRadius() const
Key F(std::uint64_t j)
static const double lat
std::vector< std::vector< real > > _G
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Model of the earth&#39;s magnetic field.
Geomagnetic field on a circle of latitude.
static void FieldComponents(real Bx, real By, real Bz, real &H, real &F, real &D, real &I)
void operator()(real t, real lat, real lon, real h, real &Bx, real &By, real &Bz, real &Bxt, real &Byt, real &Bzt) const
const std::string & MagneticModelDirectory() const
Geocentric coordinates
Definition: Geocentric.hpp:67
void operator()(real t, real lat, real lon, real h, real &Bx, real &By, real &Bz) const
static const Geocentric & WGS84()
Namespace for GeographicLib.
const std::string & MagneticModelName() const
Header for GeographicLib::Geocentric class.
Math::real Flattening() const
Math::real Flattening() const
Definition: Geocentric.hpp:254
std::vector< SphericalHarmonic > _harm
Header for GeographicLib::SphericalHarmonic class.
const double h
Math::real MaxHeight() const
Header for GeographicLib::Constants class.
const std::string & MagneticFile() const
static const double lon
Math::real MajorRadius() const
Definition: Geocentric.hpp:247
Annotation for function names.
Definition: attr.h:48
const std::string & DateTime() const
std::vector< std::vector< real > > _H
SphericalHarmonic::normalization _norm
Point2 t(10, 10)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:35