forked from jlmaurer/Python-for-Earth-Science-Students
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkigrf.py
258 lines (236 loc) · 38.3 KB
/
mkigrf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
import numpy as np
def doigrf(long,lat,date):
"""
Calculates the interpolated (<2015) or extrapolated (>2015) main field and
secular variation coefficients and passes them to the Malin and Barraclough
routine (function pmag.magsyn) to calculate the field from the coefficients.
Parameters:
-----------
lon : east longitude in degrees (0 to 360 or -180 to 180)
lat : latitude in degrees (-90 to 90)
date : Required date in years and decimals of a year (A.D.)
Return
-----------
x : north component of the magnetic field in nT
y : east component of the magnetic field in nT
z : downward component of the magnetic field in nT
f : total magnetic field in nT
By default, igrf12 coefficients are used between 1900 and 2020
from http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html.
To check the results you can run the interactive program at the NGDC
www.ngdc.noaa.gov/geomag-web
"""
models,igrf12coeffs=get_igrf12()
model,alt = date-date%5,0
if date<2015:
gh=igrf12coeffs[models.index(model)]
sv=(igrf12coeffs[models.index(model+5)]-gh)/5.
else:
gh=igrf12coeffs[models.index(2015)]
sv=igrf12coeffs[models.index('2015.20')]
x,y,z,f=magsyn(gh,sv,model,date,1,alt,90.-lat,long%360)
return x,y,z,f
#
def get_igrf12():
"""
returns the available models (dates) and gauss coefficients (coeffs) for the desired field model.
These coefficients are the IGRF12 coefficients from the NOAA website.
"""
models= [1900, 1905, 1910, 1915, 1920, 1925, 1930, 1935, 1940, 1945, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, '2015.20']
coeffs=np.array([[-31543, -2298, 5922, -677, 2905, -1061, 924, 1121, 1022, -1469, -330, 1256, 3, 572, 523, 876, 628, 195, 660, -69, -361, -210, 134, -75, -184, 328, -210, 264, 53, 5, -33, -86, -124, -16, 3, 63, 61, -9, -11, 83, -217, 2, -58, -35, 59, 36, -90, -69, 70, -55, -45, 0, -13, 34, -10, -41, -1, -21, 28, 18, -12, 6, -22, 11, 8, 8, -4, -14, -9, 7, 1, -13, 2, 5, -9, 16, 5, -5, 8, -18, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 8, 2, 10, -1, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 2, 4, 2, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-31464, -2298, 5909, -728, 2928, -1086, 1041, 1065, 1037, -1494, -357, 1239, 34, 635, 480, 880, 643, 203, 653, -77, -380, -201, 146, -65, -192, 328, -193, 259, 56, -1, -32, -93, -125, -26, 11, 62, 60, -7, -11, 86, -221, 4, -57, -32, 57, 32, -92, -67, 70, -54, -46, 0, -14, 33, -11, -41, 0, -20, 28, 18, -12, 6, -22, 11, 8, 8, -4, -15, -9, 7, 1, -13, 2, 5, -8, 16, 5, -5, 8, -18, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 8, 2, 10, 0, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 2, 4, 2, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-31354, -2297, 5898, -769, 2948, -1128, 1176, 1000, 1058, -1524, -389, 1223, 62, 705, 425, 884, 660, 211, 644, -90, -400, -189, 160, -55, -201, 327, -172, 253, 57, -9, -33, -102, -126, -38, 21, 62, 58, -5, -11, 89, -224, 5, -54, -29, 54, 28, -95, -65, 71, -54, -47, 1, -14, 32, -12, -40, 1, -19, 28, 18, -13, 6, -22, 11, 8, 8, -4, -15, -9, 6, 1, -13, 2, 5, -8, 16, 5, -5, 8, -18, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 8, 2, 10, 0, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 2, 4, 2, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-31212, -2306, 5875, -802, 2956, -1191, 1309, 917, 1084, -1559, -421, 1212, 84, 778, 360, 887, 678, 218, 631, -109, -416, -173, 178, -51, -211, 327, -148, 245, 58, -16, -34, -111, -126, -51, 32, 61, 57, -2, -10, 93, -228, 8, -51, -26, 49, 23, -98, -62, 72, -54, -48, 2, -14, 31, -12, -38, 2, -18, 28, 19, -15, 6, -22, 11, 8, 8, -4, -15, -9, 6, 2, -13, 3, 5, -8, 16, 6, -5, 8, -18, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 8, 2, 10, 0, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 1, 4, 2, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-31060, -2317, 5845, -839, 2959, -1259, 1407, 823, 1111, -1600, -445, 1205, 103, 839, 293, 889, 695, 220, 616, -134, -424, -153, 199, -57, -221, 326, -122, 236, 58, -23, -38, -119, -125, -62, 43, 61, 55, 0, -10, 96, -233, 11, -46, -22, 44, 18, -101, -57, 73, -54, -49, 2, -14, 29, -13, -37, 4, -16, 28, 19, -16, 6, -22, 11, 7, 8, -3, -15, -9, 6, 2, -14, 4, 5, -7, 17, 6, -5, 8, -19, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 9, 2, 10, 0, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 1, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30926, -2318, 5817, -893, 2969, -1334, 1471, 728, 1140, -1645, -462, 1202, 119, 881, 229, 891, 711, 216, 601, -163, -426, -130, 217, -70, -230, 326, -96, 226, 58, -28, -44, -125, -122, -69, 51, 61, 54, 3, -9, 99, -238, 14, -40, -18, 39, 13, -103, -52, 73, -54, -50, 3, -14, 27, -14, -35, 5, -14, 29, 19, -17, 6, -21, 11, 7, 8, -3, -15, -9, 6, 2, -14, 4, 5, -7, 17, 7, -5, 8, -19, 8, 10, -20, 1, 14, -11, 5, 12, -3, 1, -2, -2, 9, 2, 10, 0, -2, -1, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 1, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30805, -2316, 5808, -951, 2980, -1424, 1517, 644, 1172, -1692, -480, 1205, 133, 907, 166, 896, 727, 205, 584, -195, -422, -109, 234, -90, -237, 327, -72, 218, 60, -32, -53, -131, -118, -74, 58, 60, 53, 4, -9, 102, -242, 19, -32, -16, 32, 8, -104, -46, 74, -54, -51, 4, -15, 25, -14, -34, 6, -12, 29, 18, -18, 6, -20, 11, 7, 8, -3, -15, -9, 5, 2, -14, 5, 5, -6, 18, 8, -5, 8, -19, 8, 10, -20, 1, 14, -12, 5, 12, -3, 1, -2, -2, 9, 3, 10, 0, -2, -2, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -2, 1, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30715, -2306, 5812, -1018, 2984, -1520, 1550, 586, 1206, -1740, -494, 1215, 146, 918, 101, 903, 744, 188, 565, -226, -415, -90, 249, -114, -241, 329, -51, 211, 64, -33, -64, -136, -115, -76, 64, 59, 53, 4, -8, 104, -246, 25, -25, -15, 25, 4, -106, -40, 74, -53, -52, 4, -17, 23, -14, -33, 7, -11, 29, 18, -19, 6, -19, 11, 7, 8, -3, -15, -9, 5, 1, -15, 6, 5, -6, 18, 8, -5, 7, -19, 8, 10, -20, 1, 15, -12, 5, 11, -3, 1, -3, -2, 9, 3, 11, 0, -2, -2, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -1, 2, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30654, -2292, 5821, -1106, 2981, -1614, 1566, 528, 1240, -1790, -499, 1232, 163, 916, 43, 914, 762, 169, 550, -252, -405, -72, 265, -141, -241, 334, -33, 208, 71, -33, -75, -141, -113, -76, 69, 57, 54, 4, -7, 105, -249, 33, -18, -15, 18, 0, -107, -33, 74, -53, -52, 4, -18, 20, -14, -31, 7, -9, 29, 17, -20, 5, -19, 11, 7, 8, -3, -14, -10, 5, 1, -15, 6, 5, -5, 19, 9, -5, 7, -19, 8, 10, -21, 1, 15, -12, 5, 11, -3, 1, -3, -2, 9, 3, 11, 1, -2, -2, 2, -3, -4, 2, 2, 1, -5, 2, -2, 6, 6, -4, 4, 0, 0, -1, 2, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30594, -2285, 5810, -1244, 2990, -1702, 1578, 477, 1282, -1834, -499, 1255, 186, 913, -11, 944, 776, 144, 544, -276, -421, -55, 304, -178, -253, 346, -12, 194, 95, -20, -67, -142, -119, -82, 82, 59, 57, 6, 6, 100, -246, 16, -25, -9, 21, -16, -104, -39, 70, -40, -45, 0, -18, 0, 2, -29, 6, -10, 28, 15, -17, 29, -22, 13, 7, 12, -8, -21, -5, -12, 9, -7, 7, 2, -10, 18, 7, 3, 2, -11, 5, -21, -27, 1, 17, -11, 29, 3, -9, 16, 4, -3, 9, -4, 6, -3, 1, -4, 8, -3, 11, 5, 1, 1, 2, -20, -5, -1, -1, -6, 8, 6, -1, -4, -3, -2, 5, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30554, -2250, 5815, -1341, 2998, -1810, 1576, 381, 1297, -1889, -476, 1274, 206, 896, -46, 954, 792, 136, 528, -278, -408, -37, 303, -210, -240, 349, 3, 211, 103, -20, -87, -147, -122, -76, 80, 54, 57, -1, 4, 99, -247, 33, -16, -12, 12, -12, -105, -30, 65, -55, -35, 2, -17, 1, 0, -40, 10, -7, 36, 5, -18, 19, -16, 22, 15, 5, -4, -22, -1, 0, 11, -21, 15, -8, -13, 17, 5, -4, -1, -17, 3, -7, -24, -1, 19, -25, 12, 10, 2, 5, 2, -5, 8, -2, 8, 3, -11, 8, -7, -8, 4, 13, -1, -2, 13, -10, -4, 2, 4, -3, 12, 6, 3, -3, 2, 6, 10, 11, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30500, -2215, 5820, -1440, 3003, -1898, 1581, 291, 1302, -1944, -462, 1288, 216, 882, -83, 958, 796, 133, 510, -274, -397, -23, 290, -230, -229, 360, 15, 230, 110, -23, -98, -152, -121, -69, 78, 47, 57, -9, 3, 96, -247, 48, -8, -16, 7, -12, -107, -24, 65, -56, -50, 2, -24, 10, -4, -32, 8, -11, 28, 9, -20, 18, -18, 11, 9, 10, -6, -15, -14, 5, 6, -23, 10, 3, -7, 23, 6, -4, 9, -13, 4, 9, -11, -4, 12, -5, 7, 2, 6, 4, -2, 1, 10, 2, 7, 2, -6, 5, 5, -3, -5, -4, -1, 0, 2, -8, -3, -2, 7, -4, 4, 1, -2, -3, 6, 7, -2, -1, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30421, -2169, 5791, -1555, 3002, -1967, 1590, 206, 1302, -1992, -414, 1289, 224, 878, -130, 957, 800, 135, 504, -278, -394, 3, 269, -255, -222, 362, 16, 242, 125, -26, -117, -156, -114, -63, 81, 46, 58, -10, 1, 99, -237, 60, -1, -20, -2, -11, -113, -17, 67, -56, -55, 5, -28, 15, -6, -32, 7, -7, 23, 17, -18, 8, -17, 15, 6, 11, -4, -14, -11, 7, 2, -18, 10, 4, -5, 23, 10, 1, 8, -20, 4, 6, -18, 0, 12, -9, 2, 1, 0, 4, -3, -1, 9, -2, 8, 3, 0, -1, 5, 1, -3, 4, 4, 1, 0, 0, -1, 2, 4, -5, 6, 1, 1, -1, -1, 6, 2, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30334, -2119, 5776, -1662, 2997, -2016, 1594, 114, 1297, -2038, -404, 1292, 240, 856, -165, 957, 804, 148, 479, -269, -390, 13, 252, -269, -219, 358, 19, 254, 128, -31, -126, -157, -97, -62, 81, 45, 61, -11, 8, 100, -228, 68, 4, -32, 1, -8, -111, -7, 75, -57, -61, 4, -27, 13, -2, -26, 6, -6, 26, 13, -23, 1, -12, 13, 5, 7, -4, -12, -14, 9, 0, -16, 8, 4, -1, 24, 11, -3, 4, -17, 8, 10, -22, 2, 15, -13, 7, 10, -4, -1, -5, -1, 10, 5, 10, 1, -4, -2, 1, -2, -3, 2, 2, 1, -5, 2, -2, 6, 4, -4, 4, 0, 0, -2, 2, 3, 2, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30220, -2068, 5737, -1781, 3000, -2047, 1611, 25, 1287, -2091, -366, 1278, 251, 838, -196, 952, 800, 167, 461, -266, -395, 26, 234, -279, -216, 359, 26, 262, 139, -42, -139, -160, -91, -56, 83, 43, 64, -12, 15, 100, -212, 72, 2, -37, 3, -6, -112, 1, 72, -57, -70, 1, -27, 14, -4, -22, 8, -2, 23, 13, -23, -2, -11, 14, 6, 7, -2, -15, -13, 6, -3, -17, 5, 6, 0, 21, 11, -6, 3, -16, 8, 10, -21, 2, 16, -12, 6, 10, -4, -1, -5, 0, 10, 3, 11, 1, -2, -1, 1, -3, -3, 1, 2, 1, -5, 3, -1, 4, 6, -4, 4, 0, 1, -1, 0, 3, 3, 1, -1, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-30100, -2013, 5675, -1902, 3010, -2067, 1632, -68, 1276, -2144, -333, 1260, 262, 830, -223, 946, 791, 191, 438, -265, -405, 39, 216, -288, -218, 356, 31, 264, 148, -59, -152, -159, -83, -49, 88, 45, 66, -13, 28, 99, -198, 75, 1, -41, 6, -4, -111, 11, 71, -56, -77, 1, -26, 16, -5, -14, 10, 0, 22, 12, -23, -5, -12, 14, 6, 6, -1, -16, -12, 4, -8, -19, 4, 6, 0, 18, 10, -10, 1, -17, 7, 10, -21, 2, 16, -12, 7, 10, -4, -1, -5, -1, 10, 4, 11, 1, -3, -2, 1, -3, -3, 1, 2, 1, -5, 3, -2, 4, 5, -4, 4, -1, 1, -1, 0, 3, 3, 1, -1, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-29992, -1956, 5604, -1997, 3027, -2129, 1663, -200, 1281, -2180, -336, 1251, 271, 833, -252, 938, 782, 212, 398, -257, -419, 53, 199, -297, -218, 357, 46, 261, 150, -74, -151, -162, -78, -48, 92, 48, 66, -15, 42, 93, -192, 71, 4, -43, 14, -2, -108, 17, 72, -59, -82, 2, -27, 21, -5, -12, 16, 1, 18, 11, -23, -2, -10, 18, 6, 7, 0, -18, -11, 4, -7, -22, 4, 9, 3, 16, 6, -13, -1, -15, 5, 10, -21, 1, 16, -12, 9, 9, -5, -3, -6, -1, 9, 7, 10, 2, -6, -5, 2, -4, -4, 1, 2, 0, -5, 3, -2, 6, 5, -4, 3, 0, 1, -1, 2, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-29873, -1905, 5500, -2072, 3044, -2197, 1687, -306, 1296, -2208, -310, 1247, 284, 829, -297, 936, 780, 232, 361, -249, -424, 69, 170, -297, -214, 355, 47, 253, 150, -93, -154, -164, -75, -46, 95, 53, 65, -16, 51, 88, -185, 69, 4, -48, 16, -1, -102, 21, 74, -62, -83, 3, -27, 24, -2, -6, 20, 4, 17, 10, -23, 0, -7, 21, 6, 8, 0, -19, -11, 5, -9, -23, 4, 11, 4, 14, 4, -15, -4, -11, 5, 10, -21, 1, 15, -12, 9, 9, -6, -3, -6, -1, 9, 7, 9, 1, -7, -5, 2, -4, -4, 1, 3, 0, -5, 3, -2, 6, 5, -4, 3, 0, 1, -1, 2, 4, 3, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-29775, -1848, 5406, -2131, 3059, -2279, 1686, -373, 1314, -2239, -284, 1248, 293, 802, -352, 939, 780, 247, 325, -240, -423, 84, 141, -299, -214, 353, 46, 245, 154, -109, -153, -165, -69, -36, 97, 61, 65, -16, 59, 82, -178, 69, 3, -52, 18, 1, -96, 24, 77, -64, -80, 2, -26, 26, 0, -1, 21, 5, 17, 9, -23, 0, -4, 23, 5, 10, -1, -19, -10, 6, -12, -22, 3, 12, 4, 12, 2, -16, -6, -10, 4, 9, -20, 1, 15, -12, 11, 9, -7, -4, -7, -2, 9, 7, 8, 1, -7, -6, 2, -3, -4, 2, 2, 1, -5, 3, -2, 6, 4, -4, 3, 0, 1, -2, 3, 3, 3, -1, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-29692, -1784, 5306, -2200, 3070, -2366, 1681, -413, 1335, -2267, -262, 1249, 302, 759, -427, 940, 780, 262, 290, -236, -418, 97, 122, -306, -214, 352, 46, 235, 165, -118, -143, -166, -55, -17, 107, 68, 67, -17, 68, 72, -170, 67, -1, -58, 19, 1, -93, 36, 77, -72, -69, 1, -25, 28, 4, 5, 24, 4, 17, 8, -24, -2, -6, 25, 6, 11, -6, -21, -9, 8, -14, -23, 9, 15, 6, 11, -5, -16, -7, -4, 4, 9, -20, 3, 15, -10, 12, 8, -6, -8, -8, -1, 8, 10, 5, -2, -8, -8, 3, -3, -6, 1, 2, 0, -4, 4, -1, 5, 4, -5, 2, -1, 2, -2, 5, 1, 1, -2, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-29619.400000000001, -1728.2, 5186.1000000000004, -2267.6999999999998, 3068.4000000000001, -2481.5999999999999, 1670.9000000000001, -458.0, 1339.5999999999999, -2288.0, -227.59999999999999, 1252.0999999999999, 293.39999999999998, 714.5, -491.10000000000002, 932.29999999999995, 786.79999999999995, 272.60000000000002, 250.0, -231.90000000000001, -403.0, 119.8, 111.3, -303.80000000000001, -218.80000000000001, 351.39999999999998, 43.799999999999997, 222.30000000000001, 171.90000000000001, -130.40000000000001, -133.09999999999999, -168.59999999999999, -39.299999999999997, -12.9, 106.3, 72.299999999999997, 68.200000000000003, -17.399999999999999, 74.200000000000003, 63.700000000000003, -160.90000000000001, 65.099999999999994, -5.9000000000000004, -61.200000000000003, 16.899999999999999, 0.69999999999999996, -90.400000000000006, 43.799999999999997, 79.0, -74.0, -64.599999999999994, 0.0, -24.199999999999999, 33.299999999999997, 6.2000000000000002, 9.0999999999999996, 24.0, 6.9000000000000004, 14.800000000000001, 7.2999999999999998, -25.399999999999999, -1.2, -5.7999999999999998, 24.399999999999999, 6.5999999999999996, 11.9, -9.1999999999999993, -21.5, -7.9000000000000004, 8.5, -16.600000000000001, -21.5, 9.0999999999999996, 15.5, 7.0, 8.9000000000000004, -7.9000000000000004, -14.9, -7.0, -2.1000000000000001, 5.0, 9.4000000000000004, -19.699999999999999, 3.0, 13.4, -8.4000000000000004, 12.5, 6.2999999999999998, -6.2000000000000002, -8.9000000000000004, -8.4000000000000004, -1.5, 8.4000000000000004, 9.3000000000000007, 3.7999999999999998, -4.2999999999999998, -8.1999999999999993, -8.1999999999999993, 4.7999999999999998, -2.6000000000000001, -6.0, 1.7, 1.7, 0.0, -3.1000000000000001, 4.0, -0.5, 4.9000000000000004, 3.7000000000000002, -5.9000000000000004, 1.0, -1.2, 2.0, -2.8999999999999999, 4.2000000000000002, 0.20000000000000001, 0.29999999999999999, -2.2000000000000002, -1.1000000000000001, -7.4000000000000004, 2.7000000000000002, -1.7, 0.10000000000000001, -1.8999999999999999, 1.3, 1.5, -0.90000000000000002, -0.10000000000000001, -2.6000000000000001, 0.10000000000000001, 0.90000000000000002, -0.69999999999999996, -0.69999999999999996, 0.69999999999999996, -2.7999999999999998, 1.7, -0.90000000000000002, 0.10000000000000001, -1.2, 1.2, -1.8999999999999999, 4.0, -0.90000000000000002, -2.2000000000000002, -0.29999999999999999, -0.40000000000000002, 0.20000000000000001, 0.29999999999999999, 0.90000000000000002, 2.5, -0.20000000000000001, -2.6000000000000001, 0.90000000000000002, 0.69999999999999996, -0.5, 0.29999999999999999, 0.29999999999999999, 0.0, -0.29999999999999999, 0.0, -0.40000000000000002, 0.29999999999999999, -0.10000000000000001, -0.90000000000000002, -0.20000000000000001, -0.40000000000000002, -0.40000000000000002, 0.80000000000000004, -0.20000000000000001, -0.90000000000000002, -0.90000000000000002, 0.29999999999999999, 0.20000000000000001, 0.10000000000000001, 1.8, -0.40000000000000002, -0.40000000000000002, 1.3, -1.0, -0.40000000000000002, -0.10000000000000001, 0.69999999999999996, 0.69999999999999996, -0.40000000000000002, 0.29999999999999999, 0.29999999999999999, 0.59999999999999998, -0.10000000000000001, 0.29999999999999999, 0.40000000000000002, -0.20000000000000001, 0.0, -0.5, 0.10000000000000001, -0.90000000000000002], [-29554.630000000001, -1669.05, 5077.9899999999998, -2337.2399999999998, 3047.6900000000001, -2594.5, 1657.76, -515.42999999999995, 1336.3, -2305.8299999999999, -198.86000000000001, 1246.3900000000001, 269.72000000000003, 672.50999999999999, -524.72000000000003, 920.54999999999995, 797.96000000000004, 282.06999999999999, 210.65000000000001, -225.22999999999999, -379.86000000000001, 145.15000000000001, 100.0, -305.36000000000001, -227.0, 354.41000000000003, 42.719999999999999, 208.94999999999999, 180.25, -136.53999999999999, -123.45, -168.05000000000001, -19.57, -13.550000000000001, 103.84999999999999, 73.599999999999994, 69.560000000000002, -20.329999999999998, 76.739999999999995, 54.75, -151.34, 63.630000000000003, -14.58, -63.530000000000001, 14.58, 0.23999999999999999, -86.359999999999999, 50.939999999999998, 79.879999999999995, -74.459999999999994, -61.140000000000001, -1.6499999999999999, -22.57, 38.729999999999997, 6.8200000000000003, 12.300000000000001, 25.350000000000001, 9.3699999999999992, 10.93, 5.4199999999999999, -26.32, 1.9399999999999999, -4.6399999999999997, 24.800000000000001, 7.6200000000000001, 11.199999999999999, -11.73, -20.879999999999999, -6.8799999999999999, 9.8300000000000001, -18.109999999999999, -19.710000000000001, 10.17, 16.219999999999999, 9.3599999999999994, 7.6100000000000003, -11.25, -12.76, -4.8700000000000001, -0.059999999999999998, 5.5800000000000001, 9.7599999999999998, -20.109999999999999, 3.5800000000000001, 12.69, -6.9400000000000004, 12.67, 5.0099999999999998, -6.7199999999999998, -10.76, -8.1600000000000001, -1.25, 8.0999999999999996, 8.7599999999999998, 2.9199999999999999, -6.6600000000000001, -7.7300000000000004, -9.2200000000000006, 6.0099999999999998, -2.1699999999999999, -6.1200000000000001, 2.1899999999999999, 1.4199999999999999, 0.10000000000000001, -2.3500000000000001, 4.46, -0.14999999999999999, 4.7599999999999998, 3.0600000000000001, -6.5800000000000001, 0.28999999999999998, -1.01, 2.0600000000000001, -3.4700000000000002, 3.77, -0.85999999999999999, -0.20999999999999999, -2.3100000000000001, -2.0899999999999999, -7.9299999999999997, 2.9500000000000002, -1.6000000000000001, 0.26000000000000001, -1.8799999999999999, 1.4399999999999999, 1.4399999999999999, -0.77000000000000002, -0.31, -2.27, 0.28999999999999998, 0.90000000000000002, -0.79000000000000004, -0.57999999999999996, 0.53000000000000003, -2.6899999999999999, 1.8, -1.0800000000000001, 0.16, -1.5800000000000001, 0.95999999999999996, -1.8999999999999999, 3.9900000000000002, -1.3899999999999999, -2.1499999999999999, -0.28999999999999998, -0.55000000000000004, 0.20999999999999999, 0.23000000000000001, 0.89000000000000001, 2.3799999999999999, -0.38, -2.6299999999999999, 0.95999999999999996, 0.60999999999999999, -0.29999999999999999, 0.40000000000000002, 0.46000000000000002, 0.01, -0.34999999999999998, 0.02, -0.35999999999999999, 0.28000000000000003, 0.080000000000000002, -0.87, -0.48999999999999999, -0.34000000000000002, -0.080000000000000002, 0.88, -0.16, -0.88, -0.76000000000000001, 0.29999999999999999, 0.33000000000000002, 0.28000000000000003, 1.72, -0.42999999999999999, -0.54000000000000004, 1.1799999999999999, -1.0700000000000001, -0.37, -0.040000000000000001, 0.75, 0.63, -0.26000000000000001, 0.20999999999999999, 0.34999999999999998, 0.53000000000000003, -0.050000000000000003, 0.38, 0.40999999999999998, -0.22, -0.10000000000000001, -0.56999999999999995, -0.17999999999999999, -0.81999999999999995], [-29496.57, -1586.4200000000001, 4944.2600000000002, -2396.0599999999999, 3026.3400000000001, -2708.54, 1668.1700000000001, -575.73000000000002, 1339.8499999999999, -2326.54, -160.40000000000001, 1232.0999999999999, 251.75, 633.73000000000002, -537.02999999999997, 912.65999999999997, 808.97000000000003, 286.48000000000002, 166.58000000000001, -211.03, -356.82999999999998, 164.46000000000001, 89.400000000000006, -309.72000000000003, -230.87, 357.29000000000002, 44.579999999999998, 200.25999999999999, 189.00999999999999, -141.05000000000001, -118.06, -163.16999999999999, -0.01, -8.0299999999999994, 101.04000000000001, 72.780000000000001, 68.689999999999998, -20.899999999999999, 75.920000000000002, 44.18, -141.40000000000001, 61.539999999999999, -22.829999999999998, -66.260000000000005, 13.1, 3.02, -78.090000000000003, 55.399999999999999, 80.439999999999998, -75.0, -57.799999999999997, -4.5499999999999998, -21.199999999999999, 45.240000000000002, 6.54, 14.0, 24.960000000000001, 10.460000000000001, 7.0300000000000002, 1.6399999999999999, -27.609999999999999, 4.9199999999999999, -3.2799999999999998, 24.41, 8.2100000000000009, 10.84, -14.5, -20.030000000000001, -5.5899999999999999, 11.83, -19.34, -17.41, 11.609999999999999, 16.710000000000001, 10.85, 6.96, -14.050000000000001, -10.74, -3.54, 1.6399999999999999, 5.5, 9.4499999999999993, -20.539999999999999, 3.4500000000000002, 11.51, -5.2699999999999996, 12.75, 3.1299999999999999, -7.1399999999999997, -12.380000000000001, -7.4199999999999999, -0.76000000000000001, 7.9699999999999998, 8.4299999999999997, 2.1400000000000001, -8.4199999999999999, -6.0800000000000001, -10.08, 7.0099999999999998, -1.9399999999999999, -6.2400000000000002, 2.73, 0.89000000000000001, -0.10000000000000001, -1.0700000000000001, 4.71, -0.16, 4.4400000000000004, 2.4500000000000002, -7.2199999999999998, -0.33000000000000002, -0.95999999999999996, 2.1299999999999999, -3.9500000000000002, 3.0899999999999999, -1.99, -1.03, -1.97, -2.7999999999999998, -8.3100000000000005, 3.0499999999999998, -1.48, 0.13, -2.0299999999999998, 1.6699999999999999, 1.6499999999999999, -0.66000000000000003, -0.51000000000000001, -1.76, 0.54000000000000004, 0.84999999999999998, -0.79000000000000004, -0.39000000000000001, 0.37, -2.5099999999999998, 1.79, -1.27, 0.12, -2.1099999999999999, 0.75, -1.9399999999999999, 3.75, -1.8600000000000001, -2.1200000000000001, -0.20999999999999999, -0.87, 0.29999999999999999, 0.27000000000000002, 1.04, 2.1299999999999999, -0.63, -2.4900000000000002, 0.94999999999999996, 0.48999999999999999, -0.11, 0.58999999999999997, 0.52000000000000002, 0.0, -0.39000000000000001, 0.13, -0.37, 0.27000000000000002, 0.20999999999999999, -0.85999999999999999, -0.77000000000000002, -0.23000000000000001, 0.040000000000000001, 0.87, -0.089999999999999997, -0.89000000000000001, -0.87, 0.31, 0.29999999999999999, 0.41999999999999998, 1.6599999999999999, -0.45000000000000001, -0.58999999999999997, 1.0800000000000001, -1.1399999999999999, -0.31, -0.070000000000000007, 0.78000000000000003, 0.54000000000000004, -0.17999999999999999, 0.10000000000000001, 0.38, 0.48999999999999999, 0.02, 0.44, 0.41999999999999998, -0.25, -0.26000000000000001, -0.53000000000000003, -0.26000000000000001, -0.79000000000000004], [-29442.0, -1501.0, 4797.1000000000004, -2445.0999999999999, 3012.9000000000001, -2845.5999999999999, 1676.7, -641.89999999999998, 1350.7, -2352.3000000000002, -115.3, 1225.5999999999999, 244.90000000000001, 582.0, -538.39999999999998, 907.60000000000002, 813.70000000000005, 283.30000000000001, 120.40000000000001, -188.69999999999999, -334.89999999999998, 180.90000000000001, 70.400000000000006, -329.5, -232.59999999999999, 360.10000000000002, 47.299999999999997, 192.40000000000001, 197.0, -140.90000000000001, -119.3, -157.5, 16.0, 4.0999999999999996, 100.2, 70.0, 67.700000000000003, -20.800000000000001, 72.700000000000003, 33.200000000000003, -129.90000000000001, 58.899999999999999, -28.899999999999999, -66.700000000000003, 13.199999999999999, 7.2999999999999998, -70.900000000000006, 62.600000000000001, 81.599999999999994, -76.099999999999994, -54.100000000000001, -6.7999999999999998, -19.5, 51.799999999999997, 5.7000000000000002, 15.0, 24.399999999999999, 9.4000000000000004, 3.3999999999999999, -2.7999999999999998, -27.399999999999999, 6.7999999999999998, -2.2000000000000002, 24.199999999999999, 8.8000000000000007, 10.1, -16.899999999999999, -18.300000000000001, -3.2000000000000002, 13.300000000000001, -20.600000000000001, -14.6, 13.4, 16.199999999999999, 11.699999999999999, 5.7000000000000002, -15.9, -9.0999999999999996, -2.0, 2.1000000000000001, 5.4000000000000004, 8.8000000000000007, -21.600000000000001, 3.1000000000000001, 10.800000000000001, -3.2999999999999998, 11.800000000000001, 0.69999999999999996, -6.7999999999999998, -13.300000000000001, -6.9000000000000004, -0.10000000000000001, 7.7999999999999998, 8.6999999999999993, 1.0, -9.0999999999999996, -4.0, -10.5, 8.4000000000000004, -1.8999999999999999, -6.2999999999999998, 3.2000000000000002, 0.10000000000000001, -0.40000000000000002, 0.5, 4.5999999999999996, -0.5, 4.4000000000000004, 1.8, -7.9000000000000004, -0.69999999999999996, -0.59999999999999998, 2.1000000000000001, -4.2000000000000002, 2.3999999999999999, -2.7999999999999998, -1.8, -1.2, -3.6000000000000001, -8.6999999999999993, 3.1000000000000001, -1.5, -0.10000000000000001, -2.2999999999999998, 2.0, 2.0, -0.69999999999999996, -0.80000000000000004, -1.1000000000000001, 0.59999999999999998, 0.80000000000000004, -0.69999999999999996, -0.20000000000000001, 0.20000000000000001, -2.2000000000000002, 1.7, -1.3999999999999999, -0.20000000000000001, -2.5, 0.40000000000000002, -2.0, 3.5, -2.3999999999999999, -1.8999999999999999, -0.20000000000000001, -1.1000000000000001, 0.40000000000000002, 0.40000000000000002, 1.2, 1.8999999999999999, -0.80000000000000004, -2.2000000000000002, 0.90000000000000002, 0.29999999999999999, 0.10000000000000001, 0.69999999999999996, 0.5, -0.10000000000000001, -0.29999999999999999, 0.29999999999999999, -0.40000000000000002, 0.20000000000000001, 0.20000000000000001, -0.90000000000000002, -0.90000000000000002, -0.10000000000000001, 0.0, 0.69999999999999996, 0.0, -0.90000000000000002, -0.90000000000000002, 0.40000000000000002, 0.40000000000000002, 0.5, 1.6000000000000001, -0.5, -0.5, 1.0, -1.2, -0.20000000000000001, -0.10000000000000001, 0.80000000000000004, 0.40000000000000002, -0.10000000000000001, -0.10000000000000001, 0.29999999999999999, 0.40000000000000002, 0.10000000000000001, 0.5, 0.5, -0.29999999999999999, -0.40000000000000002, -0.40000000000000002, -0.29999999999999999, -0.80000000000000004], [10.300000000000001, 18.100000000000001, -26.600000000000001, -8.6999999999999993, -3.2999999999999998, -27.399999999999999, 2.1000000000000001, -14.1, 3.3999999999999999, -5.5, 8.1999999999999993, -0.69999999999999996, -0.40000000000000002, -10.1, 1.8, -0.69999999999999996, 0.20000000000000001, -1.3, -9.0999999999999996, 5.2999999999999998, 4.0999999999999996, 2.8999999999999999, -4.2999999999999998, -5.2000000000000002, -0.20000000000000001, 0.5, 0.59999999999999998, -1.3, 1.7, -0.10000000000000001, -1.2, 1.3999999999999999, 3.3999999999999999, 3.8999999999999999, 0.0, -0.29999999999999999, -0.10000000000000001, 0.0, -0.69999999999999996, -2.1000000000000001, 2.1000000000000001, -0.69999999999999996, -1.2, 0.20000000000000001, 0.29999999999999999, 0.90000000000000002, 1.6000000000000001, 1.0, 0.29999999999999999, -0.20000000000000001, 0.80000000000000004, -0.5, 0.40000000000000002, 1.3, -0.20000000000000001, 0.10000000000000001, -0.29999999999999999, -0.59999999999999998, -0.59999999999999998, -0.80000000000000004, 0.10000000000000001, 0.20000000000000001, -0.20000000000000001, 0.20000000000000001, 0.0, -0.29999999999999999, -0.59999999999999998, 0.29999999999999999, 0.5, 0.10000000000000001, -0.20000000000000001, 0.5, 0.40000000000000002, -0.20000000000000001, 0.10000000000000001, -0.29999999999999999, -0.40000000000000002, 0.29999999999999999, 0.29999999999999999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]])
return models,coeffs
def magsyn(gh,sv,b,date,itype,alt,colat,elong):
"""
# Computes x, y, z, and f for a given date and position, from the
# spherical harmonic coefficients of the International Geomagnetic
# Reference Field (IGRF).
# From Malin and Barraclough (1981), Computers and Geosciences, V.7, 401-405.
#
# Input:
# date = Required date in years and decimals of a year (A.D.)
# itype = 1, if geodetic coordinates are used, 2 if geocentric
# alt = height above mean sea level in km (if itype = 1)
# alt = radial distance from the center of the earth (itype = 2)
# colat = colatitude in degrees (0 to 180)
# elong = east longitude in degrees (0 to 360)
# gh = main field values for date (calc. in igrf subroutine)
# sv = secular variation coefficients (calc. in igrf subroutine)
# begin = date of dgrf (or igrf) field prior to required date
#
# Output:
# x - north component of the magnetic force in nT
# y - east component of the magnetic force in nT
# z - downward component of the magnetic force in nT
# f - total magnetic force in nT
#
# NB: the coordinate system for x,y, and z is the same as that specified
# by itype.
#
# Modified 4/9/97 to use DGRFs from 1945 to 1990 IGRF
# Modified 10/13/06 to use 1995 DGRF, 2005 IGRF and sv coefficient
# for extrapolation beyond 2005. Coefficients from Barton et al. PEPI, 97: 23-26
# (1996), via web site for NOAA, World Data Center A. Modified to use
#degree and
# order 10 as per notes in Malin and Barraclough (1981).
# coefficients for DGRF 1995 and IGRF 2005 are from http://nssdcftp.gsfc.nasa.gov/models/geomagnetic/igrf/fortran_code/
# igrf subroutine calculates
# the proper main field and secular variation coefficients (interpolated between
# dgrf values or extrapolated from 1995 sv values as appropriate).
"""
#
# real gh(120),sv(120),p(66),q(66),cl(10),sl(10)
# real begin,dateq
p=np.zeros((66),'f')
q=np.zeros((66),'f')
cl=np.zeros((10),'f')
sl=np.zeros((10),'f')
begin=b
t = date - begin
r = alt
one = colat*0.0174532925
ct = np.cos(one)
st = np.sin(one)
one = elong*0.0174532925
cl[0] = np.cos(one)
sl[0] = np.sin(one)
x,y,z = 0.0,0.0,0.0
cd,sd = 1.0,0.0
l,ll,m,n = 1,0,1,0
if itype!=2:
#
# if required, convert from geodectic to geocentric
a2 = 40680925.0
b2 = 40408585.0
one = a2 * st * st
two = b2 * ct * ct
three = one + two
rho = np.sqrt(three)
r = np.sqrt(alt*(alt+2.0*rho) + (a2*one+b2*two)/three)
cd = (alt + rho) /r
sd = (a2 - b2) /rho * ct * st /r
one = ct
ct = ct*cd - st*sd
st = st*cd + one*sd
ratio = 6371.2 /r
rr = ratio * ratio
#
# compute Schmidt quasi-normal coefficients p and x(=q)
p[0] = 1.0
p[2] = st
q[0] = 0.0
q[2] = ct
for k in range(1,66):
if n < m: # else go to 2
m = 0
n = n + 1
rr = rr * ratio
fn = n
gn = n - 1
# 2
fm = m
if k != 2: # else go to 4
if m == n: # else go to 3
one = np.sqrt(1.0 - 0.5/fm)
j = k - n - 1
p[k] = one * st * p[j]
q[k] = one * (st*q[j] + ct*p[j])
cl[m-1] = cl[m-2]*cl[0] - sl[m-2]*sl[0]
sl[m-1] = sl[m-2]*cl[0] + cl[m-2]*sl[0]
else:
# 3
gm = m * m
one = np.sqrt(fn*fn - gm)
two = np.sqrt(gn*gn - gm) /one
three = (fn + gn) /one
i = k - n
j = i - n + 1
p[k] = three*ct*p[i] - two*p[j]
q[k] = three*(ct*q[i] - st*p[i]) - two*q[j]
#
# synthesize x, y, and z in geocentric coordinates.
# 4
one = (gh[l-1] + sv[ll+l-1]*t)*rr
if m != 0: # else go to 7
two = (gh[l] + sv[ll+l]*t)*rr
three = one*cl[m-1] + two*sl[m-1]
x = x + three*q[k]
z = z - (fn + 1.0)*three*p[k]
if st != 0.0: # else go to 5
y = y + (one*sl[m-1] - two*cl[m-1])*fm*p[k]/st
else:
# 5
y = y + (one*sl[m-1] - two*cl[m-1])*q[k]*ct
l = l + 2
else:
# 7
x = x + one*q[k]
z = z - (fn + 1.0)*one*p[k]
l = l + 1
m = m + 1
#
# convert to coordinate system specified by itype
one = x
x = x*cd + z*sd
z = z*cd - one*sd
f = np.sqrt(x*x + y*y + z*z)
#
return x,y,z,f
#
def cart2dir(x,y,z):
"""
Converts a direction in cartesian coordinates into declination, inclinations
Parameters
----------
cart : input list of [x,y,z] or list of lists [[x1,y1,z1],[x2,y2,z2]...]
Returns
-------
direction_array : returns an array of [declination, inclination, intensity]
Examples
--------
>>> pmag.cart2dir([0,1,0])
array([ 90., 0., 1.])
"""
B=np.sqrt(x**2+y**2+z**2) # calculate resultant vector length
Dec=np.degrees(np.arctan2(y,x))%360. # calculate declination taking care of correct quadrants (arctan2) and making modulo 360.
Inc=np.degrees(np.arcsin(z/B)) # calculate inclination (converting to degrees) #
return Dec,Inc,B
#
def magMap(date,**kwargs):
"""
generates the data for a map of the magnetic field.
Inputs:
required:
date = decimal year for evaluation (between 1900 and 2020)
optional:
lon_0 = desired zero longitude
Returns:
Bdec = declinations
Binc = inclinations
B = field strength (in microtesla)
lons = array of longitudes
lats = array of latitudes
"""
if 'lon_0' in kwargs.keys(): # check if there are keyword arguments
lon_0=kwargs['lon_0'] # if lon_0 is set, use that one
else: # otherwise.....
lon_0=0. # set the default lon_0 to 0.
incr=10 # we can vary to the resolution of the model
lonmax=(lon_0+180.)%360+incr # get some parameters for our arrays of lat/lon
lonmin=(lon_0-180.)
latmax=90+incr
lons=np.arange(lonmin,lonmax,incr) # make a 1D array of longitudes (like elons)
lats=np.arange(-90,latmax,incr)# make a 1D array of longitudes (like elats)
# set up some containers for the field elements
lenLats, lenLons = len(lats), len(lons)
B=np.zeros((lenLats,lenLons))
Binc=np.zeros((lenLats,lenLons))
Bdec=np.zeros((lenLats,lenLons))
Brad=np.zeros((lenLats,lenLons))
for j in range(lenLats): # step through the latitudes
for i in range(lenLons): # and the longitudes
x,y,z,f=doigrf(lons[i],lats[j],date) # get the field elements
Dec,Inc,Int=cart2dir(x,y,z) # turn them into polar coordites
B[j][i]=Int*1e-3 # convert the string to microtesla (from nT)
Binc[j][i]=Inc # store the inclination value
Bdec[j][i]=Dec # store the declination value
return Bdec,Binc,B,lons,lats # return the arrays.