16 #if !defined(GEOGRAPHICLIB_DATA) 18 # define GEOGRAPHICLIB_DATA "C:/ProgramData/GeographicLib" 20 # define GEOGRAPHICLIB_DATA "/usr/local/share/GeographicLib" 24 #if !defined(GEOGRAPHICLIB_MAGNETIC_DEFAULT_NAME) 25 # define GEOGRAPHICLIB_MAGNETIC_DEFAULT_NAME "wmm2015" 30 # pragma warning (disable: 4996) 41 , _description(
"NONE")
62 ifstream coeffstr(coeff.c_str(), ios::binary);
70 if (
_id !=
string(
id))
75 if (!(M < 0 ||
_G[i][0] == 0))
79 int pos =
int(coeffstr.tellg());
81 if (pos != coeffstr.tellg())
87 const char* spaces =
" \t\n\v\f\r";
93 getline(metastr, line);
94 if (!(line.size() >= 6 && line.substr(0,5) ==
"WMMF-"))
96 string::size_type
n = line.find_first_of(spaces, 5);
97 if (n != string::npos)
100 if (!(version ==
"1" || version ==
"2"))
103 while (getline(metastr, line)) {
109 else if (key ==
"Description")
111 else if (key ==
"ReleaseDate")
113 else if (key ==
"Radius")
114 _a = Utility::val<real>(val);
115 else if (key ==
"Type") {
116 if (!(val ==
"Linear" || val ==
"linear"))
118 }
else if (key ==
"Epoch")
119 _t0 = Utility::val<real>(val);
120 else if (key ==
"DeltaEpoch")
121 _dt0 = Utility::val<real>(val);
122 else if (key ==
"NumModels")
124 else if (key ==
"NumConstants")
126 else if (key ==
"MinTime")
127 _tmin = Utility::val<real>(val);
128 else if (key ==
"MaxTime")
129 _tmax = Utility::val<real>(val);
130 else if (key ==
"MinHeight")
131 _hmin = Utility::val<real>(val);
132 else if (key ==
"MaxHeight")
133 _hmax = Utility::val<real>(val);
134 else if (key ==
"Normalization") {
135 if (val ==
"FULL" || val ==
"Full" || val ==
"full")
137 else if (val ==
"SCHMIDT" || val ==
"Schmidt" || val ==
"schmidt")
141 }
else if (key ==
"ByteOrder") {
142 if (val ==
"Big" || val ==
"big")
143 throw GeographicErr(
"Only little-endian ordering is supported");
144 else if (!(val ==
"Little" || val ==
"little"))
146 }
else if (key ==
"ID")
185 real BX0 = 0, BY0 = 0, BZ0 = 0, BX1 = 0, BY1 = 0, BZ1 = 0;
186 real BXc = 0, BYc = 0, BZc = 0;
188 _harm[n + 1](
X,
Y,
Z, BX1, BY1, BZ1);
190 _harm[_Nmodels + 1](
X,
Y,
Z, BXc, BYc, BZc);
193 BX1 = (BX1 - BX0) / _dt0;
194 BY1 = (BY1 - BY0) / _dt0;
195 BZ1 = (BZ1 - BZ0) / _dt0;
197 BX0 += t * BX1 + BXc;
198 BY0 += t * BY1 + BYc;
199 BZ0 += t * BZ1 + BZc;
223 M[7], M[8], t1, _dt0, interpolate,
224 _harm[n].Circle(X, Z,
true),
225 _harm[n + 1].Circle(X, Z,
true)) :
227 M[7], M[8], t1, _dt0, interpolate,
228 _harm[n].Circle(X, Z,
true),
229 _harm[n + 1].Circle(X, Z,
true),
230 _harm[_Nmodels + 1].Circle(X, Z,
true)));
239 Ht = H != 0 ? (Bx * Bxt + By * Byt) / H :
Math::hypot(Bxt, Byt);
243 Ft = F != 0 ? (H * Ht + Bz * Bzt) / F :
Math::hypot(Ht, Bzt);
250 char* magneticpath = getenv(
"GEOGRAPHICLIB_MAGNETIC_PATH");
252 path = string(magneticpath);
255 char* datapath = getenv(
"GEOGRAPHICLIB_DATA");
257 path = string(datapath);
263 char* magneticname = getenv(
"GEOGRAPHICLIB_MAGNETIC_NAME");
265 name = string(magneticname);
const gtsam::Symbol key('X', 0)
Matrix< RealScalar, Dynamic, Dynamic > M
Header for GeographicLib::Utility class.
static bool isfinite(T x)
Header for GeographicLib::MagneticCircle class.
Mathematical functions needed by GeographicLib.
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
Geomagnetic field on a circle of latitude.
MagneticModel(const MagneticModel &)
static void FieldComponents(real Bx, real By, real Bz, real &H, real &F, real &D, real &I)
static void readcoeffs(std::istream &stream, int &N, int &M, std::vector< real > &C, std::vector< real > &S)
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
static T atan2d(T y, T x)
Namespace for GeographicLib.
void IntForward(real lat, real lon, real h, real &X, real &Y, real &Z, real M[dim2_]) const
void Field(real t, real lat, real lon, real h, bool diffp, real &Bx, real &By, real &Bz, real &Bxt, real &Byt, real &Bzt) const
void ReadMetadata(const std::string &name)
Header for GeographicLib::MagneticModel class.
static std::string DefaultMagneticName()
std::vector< SphericalHarmonic > _harm
static const size_t dim2_
static const int idlength_
Exception handling for GeographicLib.
static void Unrotate(real M[dim2_], real X, real Y, real Z, real &x, real &y, real &z)
static EIGEN_DEPRECATED const end_t end
static std::string DefaultMagneticPath()
#define GEOGRAPHICLIB_MAGNETIC_DEFAULT_NAME
Annotation for function names.
Spherical harmonic series.
T interpolate(const T &X, const T &Y, double t, typename MakeOptionalJacobian< T, T >::type Hx={}, typename MakeOptionalJacobian< T, T >::type Hy={})
static bool ParseLine(const std::string &line, std::string &key, std::string &val)
Header for GeographicLib::SphericalEngine class.
std::vector< std::vector< real > > _H
SphericalHarmonic::normalization _norm
MagneticCircle Circle(real t, real lat, real h) const
#define GEOGRAPHICLIB_DATA