MODIP.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 
26 //==============================================================================
27 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 
40 #include <math.h>
41 #include <iostream>
42 #include "MODIP.hpp"
43 #include "DebugTrace.hpp"
44 
49 {
50  LongPoints = 39,
51  LongMax = 180,
52  LongStep = 10,
53  LatPoints = 39,
54  LatMin = -90,
55  LatMax = 90,
56  LatStep = 5,
58 };
59 
60 
61 namespace gnsstk
62 {
63  MODIP ::
65  {
66  }
67 
68 
69  double MODIP ::
71  const
72  {
74  // awk script for generating this from
75  // NeQuickJRC/modip/modip2001_wrapped.asc :
76  // {
77  // printf(" {");
78  // for (i=1;i<=NF;i++)
79  // {
80  // printf(" %6s,", $i);
81  // if ((i % 8) == 0)
82  // {
83  // printf("\n ");
84  // }
85  // }
86  // printf(" },\n");
87  // }
88  static const double data[LatPoints][LongPoints] {
89  { -76.37, -76.34, -76.30, -76.25, -76.55, -76.47, -76.75, -76.65,
90  -76.90, -76.79, -77.04, -77.27, -77.19, -77.44, -77.37, -77.33,
91  -77.30, -77.30, -77.31, -77.34, -77.40, -77.13, -77.21, -76.96,
92  -77.06, -76.81, -76.91, -76.66, -76.76, -76.48, -76.56, -76.25,
93  -76.31, -76.34, -76.37, -76.37, -76.37, -76.34, -76.30, },
94  { -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00,
95  -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00,
96  -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00,
97  -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00,
98  -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, -90.00, },
99  { -77.31, -77.34, -77.40, -77.13, -77.21, -76.96, -77.06, -76.81,
100  -76.91, -76.66, -76.76, -76.48, -76.56, -76.25, -76.31, -76.34,
101  -76.37, -76.37, -76.37, -76.34, -76.30, -76.25, -76.55, -76.47,
102  -76.75, -76.65, -76.90, -76.79, -77.04, -77.27, -77.19, -77.44,
103  -77.37, -77.33, -77.30, -77.30, -77.31, -77.34, -77.40, },
104  { -72.98, -73.10, -72.84, -72.61, -72.40, -72.20, -72.00, -71.80,
105  -71.59, -71.36, -71.11, -70.82, -70.49, -70.64, -70.23, -70.31,
106  -70.35, -70.36, -70.34, -70.28, -70.18, -70.59, -70.42, -70.74,
107  -71.02, -71.26, -71.47, -71.66, -72.30, -72.47, -72.65, -72.86,
108  -73.10, -73.38, -73.32, -73.32, -72.98, -73.10, -72.84, },
109  { -70.32, -70.13, -69.97, -69.37, -69.25, -68.64, -67.99, -67.89,
110  -67.19, -67.04, -66.22, -65.96, -65.61, -65.84, -65.33, -65.41,
111  -65.43, -65.42, -65.35, -65.26, -65.78, -65.58, -65.97, -66.28,
112  -66.51, -67.28, -67.95, -68.01, -68.58, -69.12, -69.65, -70.20,
113  -70.34, -70.58, -70.51, -70.58, -70.32, -70.13, -69.97, },
114  { -67.88, -67.33, -66.76, -66.71, -66.11, -65.50, -64.87, -64.23,
115  -63.55, -62.82, -62.72, -61.76, -61.41, -60.88, -61.01, -61.01,
116  -60.95, -60.84, -61.51, -61.36, -61.95, -61.71, -62.13, -62.42,
117  -63.30, -64.03, -64.63, -65.15, -66.19, -66.60, -67.52, -67.93,
118  -68.39, -68.55, -68.58, -68.42, -67.88, -67.33, -66.76, },
119  { -65.43, -64.90, -64.33, -63.71, -63.06, -62.40, -61.75, -61.11,
120  -60.47, -59.79, -58.18, -58.04, -57.67, -57.02, -57.01, -57.72,
121  -57.46, -58.06, -57.84, -58.51, -58.32, -58.92, -59.38, -59.66,
122  -60.54, -61.22, -61.75, -62.83, -63.80, -64.68, -65.51, -66.31,
123  -66.61, -67.17, -66.81, -65.90, -65.43, -64.90, -64.33, },
124  { -63.10, -62.52, -61.89, -61.21, -60.49, -59.77, -59.08, -58.42,
125  -57.00, -56.36, -54.71, -53.70, -53.29, -53.45, -53.20, -53.67,
126  -55.00, -55.41, -55.94, -55.71, -55.57, -56.29, -55.98, -57.17,
127  -58.06, -58.70, -59.90, -60.92, -61.83, -62.70, -63.55, -64.45,
128  -64.56, -64.70, -64.14, -63.63, -63.10, -62.52, -61.89, },
129  { -60.55, -59.89, -59.18, -58.41, -57.60, -56.79, -56.00, -55.29,
130  -53.77, -53.17, -51.50, -50.51, -50.08, -50.08, -50.56, -51.68,
131  -52.65, -52.78, -54.07, -53.77, -53.68, -54.54, -54.38, -54.82,
132  -55.78, -56.42, -57.62, -58.65, -60.26, -61.19, -61.61, -62.29,
133  -62.19, -61.90, -61.80, -61.18, -60.55, -59.89, -59.18, },
134  { -57.52, -56.76, -56.72, -55.88, -54.99, -54.10, -53.23, -52.44,
135  -50.80, -49.16, -48.52, -46.43, -45.95, -45.73, -47.00, -48.82,
136  -50.45, -51.19, -52.26, -52.75, -52.68, -52.80, -52.84, -53.46,
137  -53.66, -54.34, -55.58, -57.41, -58.42, -58.87, -59.57, -59.97,
138  -60.07, -59.79, -58.99, -58.25, -57.52, -56.76, -56.72, },
139  { -55.35, -54.54, -53.68, -52.76, -51.79, -50.80, -49.83, -48.94,
140  -48.17, -46.46, -44.70, -42.50, -41.96, -42.75, -44.84, -46.20,
141  -48.49, -49.87, -51.57, -51.85, -51.71, -51.95, -51.34, -51.31,
142  -52.58, -53.34, -54.63, -55.78, -56.24, -57.62, -57.94, -57.92,
143  -57.47, -57.17, -56.26, -56.16, -55.35, -54.54, -53.68, },
144  { -52.61, -51.73, -50.81, -49.82, -48.79, -47.75, -46.73, -45.73,
145  -44.88, -43.03, -41.20, -38.94, -38.31, -38.86, -41.88, -43.95,
146  -46.94, -48.96, -50.32, -51.24, -51.85, -51.24, -50.87, -50.24,
147  -50.85, -51.80, -52.39, -53.74, -54.41, -55.38, -55.25, -55.40,
148  -54.97, -54.65, -53.63, -53.49, -52.61, -51.73, -50.81, },
149  { -50.08, -48.20, -47.20, -47.17, -46.12, -45.07, -42.87, -41.78,
150  -40.82, -38.82, -36.89, -34.51, -33.78, -35.48, -38.12, -41.01,
151  -44.83, -47.57, -49.58, -50.20, -50.62, -50.87, -49.77, -49.45,
152  -49.44, -49.72, -51.40, -52.11, -53.01, -52.69, -52.77, -53.07,
153  -52.64, -51.44, -51.17, -50.13, -50.08, -48.20, -47.20, },
154  { -46.90, -44.89, -43.84, -42.71, -41.57, -40.48, -39.39, -36.91,
155  -35.88, -33.72, -31.73, -29.23, -28.33, -29.76, -33.48, -38.67,
156  -42.12, -45.72, -47.53, -48.89, -50.02, -50.20, -49.21, -48.22,
157  -47.56, -48.11, -49.16, -50.11, -50.41, -50.29, -50.57, -50.12,
158  -49.68, -49.27, -48.03, -47.90, -46.90, -44.89, -43.84, },
159  { -42.94, -40.78, -39.69, -38.48, -37.26, -36.16, -33.63, -32.45,
160  -29.87, -27.64, -23.91, -21.22, -21.91, -22.92, -29.50, -34.27,
161  -40.00, -43.37, -46.09, -47.36, -48.44, -48.57, -47.60, -45.76,
162  -45.35, -46.19, -46.51, -46.76, -47.29, -47.35, -46.83, -46.42,
163  -45.93, -45.45, -45.13, -43.97, -42.94, -40.78, -39.69, },
164  { -38.00, -37.05, -34.60, -33.29, -32.00, -29.31, -28.16, -25.31,
165  -22.60, -20.39, -16.58, -13.78, -12.32, -16.69, -22.92, -30.45,
166  -35.94, -40.47, -43.26, -45.67, -45.82, -45.96, -44.97, -43.15,
167  -42.92, -42.92, -43.46, -43.88, -44.62, -43.76, -43.30, -42.89,
168  -42.33, -41.78, -40.28, -39.04, -38.00, -37.05, -34.60, },
169  { -33.30, -30.99, -28.38, -26.97, -25.53, -22.62, -19.66, -18.45,
170  -15.74, -11.72, -7.87, -4.92, -3.12, -7.12, -14.93, -24.08,
171  -32.47, -36.99, -40.00, -41.64, -43.06, -42.18, -41.13, -40.42,
172  -39.12, -38.01, -38.74, -39.34, -40.26, -39.38, -38.94, -38.49,
173  -37.82, -37.16, -35.51, -34.24, -33.30, -30.99, -28.38, },
174  { -25.81, -23.45, -20.73, -19.23, -15.79, -14.45, -11.27, -8.07,
175  -5.36, -1.38, 1.54, 4.46, 4.34, -0.15, -7.30, -18.17,
176  -26.70, -32.91, -36.30, -38.36, -38.91, -38.05, -36.96, -34.95,
177  -33.56, -32.35, -33.22, -33.93, -35.02, -34.07, -33.58, -33.04,
178  -32.18, -31.36, -29.52, -28.25, -25.81, -23.45, -20.73, },
179  { -18.21, -14.07, -11.29, -9.72, -7.95, -4.47, -1.12, -0.13,
180  3.20, 7.24, 11.16, 13.63, 13.20, 8.68, -0.02, -8.99,
181  -19.80, -26.62, -30.66, -31.94, -32.88, -32.04, -29.36, -27.06,
182  -25.49, -25.75, -26.72, -27.51, -27.17, -27.63, -25.41, -24.66,
183  -25.14, -24.09, -22.00, -20.69, -18.21, -14.07, -11.29, },
184  { -8.65, -4.46, -1.73, 0.13, 2.22, 4.54, 7.05, 9.67,
185  12.82, 16.46, 19.79, 21.67, 21.01, 16.82, 8.72, -0.07,
186  -11.56, -19.23, -22.42, -24.32, -24.10, -23.26, -20.19, -17.56,
187  -15.77, -16.03, -17.09, -17.97, -17.55, -17.99, -17.17, -16.10,
188  -16.39, -14.98, -14.45, -11.16, -8.65, -4.46, -1.73, },
189  { 0.78, 4.62, 7.90, 10.21, 12.09, 14.13, 16.34, 18.68,
190  21.42, 24.45, 27.06, 28.37, 27.58, 23.89, 16.91, 7.39,
191  -1.72, -8.45, -12.47, -13.20, -13.31, -12.51, -9.01, -7.96,
192  -5.94, -4.22, -5.36, -6.30, -7.78, -6.17, -5.05, -5.58,
193  -5.56, -5.74, -4.93, -1.35, 0.78, 4.62, 7.90, },
194  { 10.53, 14.10, 17.12, 19.21, 20.83, 22.54, 24.39, 26.39,
195  28.66, 31.06, 33.02, 33.86, 32.99, 29.88, 24.18, 16.35,
196  8.11, 1.73, -0.45, -1.65, -0.05, -0.74, 1.49, 4.17,
197  5.96, 6.21, 5.41, 4.44, 3.94, 4.19, 4.79, 4.99,
198  4.61, 4.42, 5.26, 7.37, 10.53, 14.10, 17.12, },
199  { 19.28, 22.29, 24.88, 26.70, 28.07, 29.49, 31.06, 32.75,
200  34.60, 36.47, 37.90, 38.39, 37.50, 34.90, 30.42, 24.42,
201  18.03, 12.98, 10.38, 9.92, 10.50, 11.69, 13.59, 15.77,
202  17.22, 17.43, 16.81, 16.02, 15.59, 15.74, 16.07, 15.96,
203  15.30, 14.76, 15.12, 16.69, 19.28, 22.29, 24.88, },
204  { 26.70, 29.05, 31.16, 32.70, 33.90, 35.12, 36.47, 37.92,
205  39.45, 40.91, 41.96, 42.19, 41.32, 39.16, 35.70, 31.30,
206  26.70, 23.08, 21.25, 21.01, 21.61, 22.63, 24.09, 25.69,
207  26.74, 26.93, 26.51, 25.95, 25.66, 25.72, 25.83, 25.49,
208  24.69, 23.90, 23.83, 24.79, 26.70, 29.05, 31.16, },
209  { 32.85, 34.58, 36.23, 37.53, 38.62, 39.71, 40.91, 42.19,
210  43.48, 44.66, 45.43, 45.49, 44.65, 42.86, 40.21, 37.04,
211  33.89, 31.44, 30.23, 30.14, 30.66, 31.45, 32.51, 33.62,
212  34.37, 34.53, 34.28, 33.93, 33.76, 33.79, 33.75, 33.31,
213  32.45, 31.54, 31.14, 31.57, 32.85, 34.58, 36.23, },
214  { 37.97, 39.18, 40.43, 41.54, 42.53, 43.56, 44.66, 45.80,
215  46.94, 47.90, 48.48, 48.44, 47.65, 46.16, 44.13, 41.87,
216  39.72, 38.12, 37.34, 37.33, 37.74, 38.35, 39.10, 39.85,
217  40.37, 40.53, 40.41, 40.25, 40.16, 40.17, 40.07, 39.59,
218  38.73, 37.78, 37.19, 37.23, 37.97, 39.18, 40.43, },
219  { 42.38, 43.15, 44.10, 45.03, 45.95, 46.92, 47.95, 49.00,
220  50.00, 50.82, 51.27, 51.16, 50.44, 49.18, 47.61, 45.97,
221  44.51, 43.46, 42.97, 42.99, 43.30, 43.76, 44.30, 44.81,
222  45.18, 45.33, 45.33, 45.29, 45.30, 45.31, 45.15, 44.67,
223  43.86, 42.93, 42.23, 42.02, 42.38, 43.15, 44.10, },
224  { 46.29, 46.76, 47.46, 48.25, 49.09, 50.00, 50.97, 51.93,
225  52.82, 53.52, 53.87, 53.73, 53.07, 52.02, 50.78, 49.57,
226  48.55, 47.84, 47.52, 47.55, 47.79, 48.13, 48.51, 48.87,
227  49.16, 49.32, 49.40, 49.46, 49.53, 49.55, 49.38, 48.91,
228  48.15, 47.29, 46.56, 46.20, 46.29, 46.76, 47.46, },
229  { 49.92, 50.19, 50.69, 51.34, 52.10, 52.95, 53.84, 54.71,
230  55.50, 56.10, 56.38, 56.21, 55.61, 54.73, 53.75, 52.83,
231  52.07, 51.57, 51.35, 51.37, 51.54, 51.80, 52.07, 52.34,
232  52.58, 52.76, 52.91, 53.05, 53.17, 53.19, 53.02, 52.58,
233  51.89, 51.10, 50.41, 49.98, 49.92, 50.19, 50.69, },
234  { 53.37, 53.50, 53.87, 54.42, 55.09, 55.84, 56.64, 57.42,
235  58.11, 58.62, 58.82, 58.64, 58.11, 57.37, 56.57, 55.85,
236  55.28, 54.90, 54.72, 54.72, 54.84, 55.02, 55.22, 55.44,
237  55.65, 55.86, 56.06, 56.26, 56.41, 56.45, 56.28, 55.87,
238  55.26, 54.56, 53.93, 53.52, 53.37, 53.50, 53.87, },
239  { 56.74, 56.80, 57.06, 57.50, 58.07, 58.72, 59.42, 60.10,
240  60.69, 61.11, 61.25, 61.05, 60.58, 59.96, 59.31, 58.73,
241  58.28, 57.98, 57.82, 57.79, 57.86, 57.98, 58.14, 58.33,
242  58.53, 58.75, 59.00, 59.23, 59.41, 59.46, 59.31, 58.95,
243  58.41, 57.82, 57.28, 56.90, 56.74, 56.80, 57.06, },
244  { 60.07, 60.09, 60.28, 60.62, 61.09, 61.63, 62.21, 62.78,
245  63.28, 63.61, 63.69, 63.48, 63.06, 62.54, 62.02, 61.56,
246  61.19, 60.93, 60.79, 60.74, 60.77, 60.85, 60.98, 61.14,
247  61.34, 61.58, 61.83, 62.09, 62.28, 62.34, 62.21, 61.91,
248  61.47, 60.98, 60.54, 60.22, 60.07, 60.09, 60.28, },
249  { 63.41, 63.42, 63.55, 63.81, 64.16, 64.59, 65.05, 65.50,
250  65.91, 66.17, 66.19, 65.97, 65.60, 65.17, 64.76, 64.39,
251  64.10, 63.88, 63.75, 63.69, 63.70, 63.75, 63.85, 64.00,
252  64.19, 64.42, 64.67, 64.92, 65.11, 65.17, 65.08, 64.84,
253  64.50, 64.13, 63.79, 63.54, 63.41, 63.42, 63.55, },
254  { 66.83, 66.83, 66.92, 67.10, 67.35, 67.65, 68.00, 68.34,
255  68.64, 68.83, 68.80, 68.57, 68.26, 67.93, 67.61, 67.34,
256  67.11, 66.94, 66.82, 66.77, 66.76, 66.80, 66.88, 67.01,
257  67.18, 67.38, 67.60, 67.82, 67.99, 68.07, 68.02, 67.85,
258  67.60, 67.34, 67.10, 66.93, 66.83, 66.83, 66.92, },
259  { 70.42, 70.42, 70.48, 70.58, 70.74, 70.94, 71.16, 71.40,
260  71.61, 71.72, 71.63, 71.42, 71.18, 70.94, 70.72, 70.53,
261  70.37, 70.25, 70.16, 70.12, 70.11, 70.14, 70.20, 70.30,
262  70.43, 70.58, 70.76, 70.93, 71.07, 71.15, 71.14, 71.04,
263  70.90, 70.74, 70.59, 70.48, 70.42, 70.42, 70.48, },
264  { 74.37, 74.37, 74.40, 74.46, 74.54, 74.65, 74.77, 74.90,
265  75.03, 75.03, 74.90, 74.75, 74.60, 74.46, 74.33, 74.21,
266  74.12, 74.05, 73.99, 73.97, 73.96, 73.98, 74.02, 74.08,
267  74.16, 74.26, 74.36, 74.47, 74.57, 74.64, 74.66, 74.64,
268  74.58, 74.52, 74.45, 74.40, 74.37, 74.37, 74.40, },
269  { 79.15, 79.15, 79.17, 79.19, 79.22, 79.25, 79.29, 79.31,
270  79.28, 79.23, 79.18, 79.12, 79.06, 79.01, 78.96, 78.92,
271  78.88, 78.85, 78.83, 78.82, 78.82, 78.83, 78.84, 78.87,
272  78.90, 78.93, 78.97, 79.02, 79.06, 79.10, 79.13, 79.15,
273  79.16, 79.16, 79.15, 79.15, 79.15, 79.15, 79.17, },
274  { 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00,
275  90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00,
276  90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00,
277  90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00,
278  90.00, 90.00, 90.00, 90.00, 90.00, 90.00, 90.00, },
279  { 78.83, 78.82, 78.82, 78.83, 78.84, 78.87, 78.90, 78.93,
280  78.97, 79.02, 79.06, 79.10, 79.13, 79.15, 79.16, 79.16,
281  79.15, 79.15, 79.15, 79.15, 79.17, 79.19, 79.22, 79.25,
282  79.29, 79.31, 79.28, 79.23, 79.18, 79.12, 79.06, 79.01,
283  78.96, 78.92, 78.88, 78.85, 78.83, 78.82, 78.82, },
284  };
285 
298  double phi = pos.geodeticLatitude();
299  double lambda = pos.longitude();
300  // Compute the grid longitude position
301  double longGridPos = (lambda + LongMax) / LongStep; // eq.14
302  // Truncate the grid longitude position to get the array index
303  int longGridIdx = longGridPos; // eq.6
304  GNSSTK_ASSERT((longGridPos - longGridIdx) < 1);
305  // Compute the longitude fractional offset from the array index
306  double longGridOffs = longGridPos - int(longGridPos); // eq.15
307  GNSSTK_ASSERT(longGridOffs < 1);
308  DEBUGTRACE("longitude index before adjust " << longGridIdx);
309  // check if index indicates lambda was < -180 degrees
310  // longitude and adjust
311  if (longGridIdx < 0)
312  {
313  longGridIdx += (360/LongStep); // eq.7
314  }
326  else if (longGridIdx >= (360/LongStep))
327  {
328  longGridIdx -= (360/LongStep); // eq.8
329  }
330  // Compute the grid latitude position
331  double latGridPos = ((phi + LatMax) / LatStep); // eq.9
332  // Compute the latitude fractional offset from the array index
333  double latGridOffs = latGridPos - int(latGridPos); // eq.10
334  // Truncate the grid latitude position to get the array index
335  int latGridIdx = int(latGridPos); // eq.11
336  GNSSTK_ASSERT(latGridOffs < 1);
337  GNSSTK_ASSERT((latGridPos - latGridIdx) < 1);
338  double z1[InterpCount], z[InterpCount];
339  DEBUGTRACE("longitude " << lambda << " idx " << longGridIdx << " offset "
340  << longGridOffs);
341  DEBUGTRACE("latitude " << phi << " idx " << latGridIdx << " offset "
342  << latGridOffs);
343  for (int k = 0; k < InterpCount; k++)
344  {
345  for (int j = 0; j < InterpCount; j++)
346  {
347  z1[j] = data[latGridIdx+j][longGridIdx+k]; // eq.12
348  }
349  z[k] = interpolate(z1, latGridOffs); // eq.13
350  }
351  double rv = interpolate(z, longGridOffs); // eq.16
352  DEBUGTRACE("return value = " << rv);
353  return rv;
354  }
355 
356 
357  double MODIP ::
358  interpolate(double z[4], double x)
359  const
360  {
361  if (fabs(2*x) < 1e-10)
362  {
363  // if x is really close to zero, just return the point at 0.
364  return z[1]; // eq.128
365  }
366  double sigma = 2*x - 1; // eq.129
367  double g1 = z[2] + z[1]; // eq.130
368  double g2 = z[2] - z[1]; // eq.131
369  double g3 = z[3] + z[0]; // eq.132
370  double g4 = (z[3] - z[0]) / 3.0; // eq.133
371  double a0 = 9.0*g1 - g3; // eq.134
372  double a1 = 9.0*g2 - g4; // eq.135
373  double a2 = g3 - g1; // eq.136
374  double a3 = g4 - g2; // eq.137
375  // eq.138
376  return (a0 + a1*sigma + a2*sigma*sigma + a3*sigma*sigma*sigma) / 16.0;
377  }
378 }
gnsstk::MODIP::MODIP
MODIP()
Definition: MODIP.cpp:64
LatMax
@ LatMax
Maximum latitude in degrees.
Definition: MODIP.cpp:55
LongStep
@ LongStep
Data grid step size in degrees.
Definition: MODIP.cpp:52
LatMin
@ LatMin
Minimum latitude in degrees.
Definition: MODIP.cpp:54
DEBUGTRACE
#define DEBUGTRACE(EXPR)
Definition: DebugTrace.hpp:119
gnsstk::MODIP::stModip
double stModip(const Position &pos) const
Definition: MODIP.cpp:70
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
LatStep
@ LatStep
Data grid step size in degrees.
Definition: MODIP.cpp:56
LatPoints
@ LatPoints
Data grid number of latitudinal points.
Definition: MODIP.cpp:53
example4.pos
pos
Definition: example4.py:125
gnsstk::MODIP::interpolate
double interpolate(double z[4], double x) const
Definition: MODIP.cpp:358
example3.data
data
Definition: example3.py:22
GNSSTK_ASSERT
#define GNSSTK_ASSERT(CONDITION)
Provide an "ASSERT" type macro.
Definition: Exception.hpp:373
DebugTrace.hpp
gnsstk::Position
Definition: Position.hpp:136
LongMax
@ LongMax
Maximum longitude in degrees.
Definition: MODIP.cpp:51
DEBUGTRACE_FUNCTION
#define DEBUGTRACE_FUNCTION()
Definition: DebugTrace.hpp:117
MODIP.hpp
InterpCount
@ InterpCount
Number of points used in interpolation.
Definition: MODIP.cpp:57
MODIPConsts
MODIPConsts
Definition: MODIP.cpp:48
LongPoints
@ LongPoints
Data grid number of longitudinal points.
Definition: MODIP.cpp:50


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40