1 /*
2 * Copyright (C) 2020 Alberto Irurueta Carro (alberto@irurueta.com)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.irurueta.navigation.inertial.wmm;
17
18 /**
19 * Contains data defining the World Magnetic Model (WWM).
20 * <p>
21 * The WWM defines the Earth's magnetic field in geodetic coordinates
22 * (latitude, longitude and height) respect the WGS84 spheroid from
23 * the coefficients of the current official Department of Defense (DOD)
24 * spherical harmonic world magnetic model (WMM-2010).
25 * The WWM series of models is updated every 5 years on January 1st of
26 * those years, which are divisible by 5 (i.e. 1980, 1985, 1990, etc.)
27 * by the Naval Oceanographic Office in cooperation with the
28 * British Geological Survey (BGS).
29 * <p>
30 * The model is based on geomagnetic survey measurements from aircraft,
31 * satellite and geomagnetic observatories.
32 */
33 public class WorldMagneticModel {
34
35 /**
36 * The maximum number of degrees of the spherical harmonic model.
37 */
38 public static final int MAX_ORDER = 12;
39
40 /**
41 * The lifespan of a WMM is 5 years.
42 */
43 public static final double LIFESPAN = 5.0;
44
45 /**
46 * Number of coefficients.
47 */
48 static final int N = 13;
49
50 /**
51 * Squared number of coefficients.
52 */
53 private static final int N2 = N * N;
54
55 /**
56 * The Gauss coefficients of main geomagnetic model (nt)
57 */
58 final double[][] c = new double[N][N];
59
60 /**
61 * The Gauss coefficients of secular geomagnetic model (nt/yr).
62 */
63 final double[][] cd = new double[N][N];
64
65 /**
66 * The date in years, for the start of the valid time of the fit coefficients
67 */
68 double epoch;
69
70 /**
71 * The Schmidt normalization factors.
72 */
73 final double[] snorm = new double[N2];
74
75 /**
76 * The sine of (m*spherical coord. longitude).
77 */
78 final double[][] k = new double[N][N];
79
80 /**
81 * The cosine of (m*spherical coord. longitude).
82 */
83 final double[] fn = new double[N];
84
85 /**
86 * The sine of (m*spherical coord. latitude).
87 */
88 final double[] fm = new double[N];
89 }