geospacelab 0.12.1__py3-none-any.whl → 0.12.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geospacelab/__init__.py +1 -1
- geospacelab/datahub/sources/cdaweb/downloader.py +8 -2
- geospacelab/datahub/sources/madrigal/satellites/dmsp/e/__init__.py +4 -3
- geospacelab/datahub/sources/madrigal/satellites/dmsp/s1/__init__.py +4 -4
- geospacelab/datahub/sources/madrigal/satellites/dmsp/s4/__init__.py +3 -3
- geospacelab/datahub/sources/tud/downloader.py +4 -5
- geospacelab/observatory/orbit/utilities.py +281 -1
- {geospacelab-0.12.1.dist-info → geospacelab-0.12.3.dist-info}/METADATA +8 -2
- {geospacelab-0.12.1.dist-info → geospacelab-0.12.3.dist-info}/RECORD +12 -12
- {geospacelab-0.12.1.dist-info → geospacelab-0.12.3.dist-info}/WHEEL +0 -0
- {geospacelab-0.12.1.dist-info → geospacelab-0.12.3.dist-info}/licenses/LICENSE +0 -0
- {geospacelab-0.12.1.dist-info → geospacelab-0.12.3.dist-info}/top_level.txt +0 -0
geospacelab/__init__.py
CHANGED
|
@@ -6,7 +6,7 @@ __author__ = "Lei Cai"
|
|
|
6
6
|
__copyright__ = "Copyright 2021, GeospaceLAB"
|
|
7
7
|
__credits__ = ["Lei Cai"]
|
|
8
8
|
__license__ = "BSD-3-Clause License"
|
|
9
|
-
__version__ = "0.12.
|
|
9
|
+
__version__ = "0.12.3"
|
|
10
10
|
__maintainer__ = "Lei Cai"
|
|
11
11
|
__email__ = "lei.cai@oulu.fi"
|
|
12
12
|
__status__ = "Developing"
|
|
@@ -213,8 +213,11 @@ class DownloaderFromFTPBase(DownloaderBase):
|
|
|
213
213
|
if file_paths_local is None:
|
|
214
214
|
self.file_paths_local = []
|
|
215
215
|
for fp_remote in self.file_paths_remote:
|
|
216
|
+
fp_local = self.root_dir_local
|
|
217
|
+
for p in fp_remote.replace(root_dir_remote, '').split('/'):
|
|
218
|
+
fp_local = fp_local / p
|
|
216
219
|
self.file_paths_local.append(
|
|
217
|
-
|
|
220
|
+
fp_local
|
|
218
221
|
)
|
|
219
222
|
self.done = [False] * len(self.file_paths_remote)
|
|
220
223
|
|
|
@@ -347,8 +350,11 @@ class DownloaderFromHTTPBase(DownloaderBase):
|
|
|
347
350
|
if file_paths_local is None:
|
|
348
351
|
self.file_paths_local = []
|
|
349
352
|
for fp_remote in self.file_paths_remote:
|
|
353
|
+
fp_local = self.root_dir_local
|
|
354
|
+
for p in fp_remote.replace(root_url, '').split('/'):
|
|
355
|
+
fp_local = fp_local / p
|
|
350
356
|
self.file_paths_local.append(
|
|
351
|
-
|
|
357
|
+
fp_local
|
|
352
358
|
)
|
|
353
359
|
else:
|
|
354
360
|
self.file_paths_local = file_paths_local
|
|
@@ -200,11 +200,12 @@ class Dataset(datahub.DatasetSourced):
|
|
|
200
200
|
delta = np.sin(glon_2 * np.pi / 180.) - np.sin(glon_2 * np.pi / 180.)
|
|
201
201
|
|
|
202
202
|
if self.replace_orbit:
|
|
203
|
-
|
|
203
|
+
self['SC_GEO_LON'].value = glon_2[:, np.newaxis]
|
|
204
|
+
self['SC_GEO_LAT'].value = cs_new['lat'][:, np.newaxis]
|
|
204
205
|
else:
|
|
205
206
|
glon_1[np.abs(delta)>0.001] = glon_2[np.abs(delta)>0.001]
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
self['SC_GEO_LON'].value = glon_1[:, np.newaxis]
|
|
208
|
+
|
|
208
209
|
|
|
209
210
|
def search_data_files(self, **kwargs):
|
|
210
211
|
|
|
@@ -134,7 +134,7 @@ class Dataset(datahub.DatasetSourced):
|
|
|
134
134
|
self.time_filter_by_range(var_datetime_name='SC_DATETIME')
|
|
135
135
|
|
|
136
136
|
if self.calib_orbit:
|
|
137
|
-
|
|
137
|
+
self.fix_geo_lon()
|
|
138
138
|
|
|
139
139
|
if self.add_AACGM:
|
|
140
140
|
self.convert_to_AACGM()
|
|
@@ -220,11 +220,11 @@ class Dataset(datahub.DatasetSourced):
|
|
|
220
220
|
delta = np.sin(glon_2 * np.pi / 180.) - np.sin(glon_1 * np.pi / 180.)
|
|
221
221
|
|
|
222
222
|
if self.replace_orbit:
|
|
223
|
-
|
|
223
|
+
self['SC_GEO_LON'].value = glon_2[:, np.newaxis]
|
|
224
|
+
self['SC_GEO_LAT'].value = cs_new['lat'][:, np.newaxis]
|
|
224
225
|
else:
|
|
225
226
|
glon_1[np.abs(delta)>0.001] = glon_2[np.abs(delta)>0.001]
|
|
226
|
-
|
|
227
|
-
self['SC_GEO_LON'].value = glon_1[:, np.newaxis]
|
|
227
|
+
self['SC_GEO_LON'].value = glon_1[:, np.newaxis]
|
|
228
228
|
|
|
229
229
|
def search_data_files(self, **kwargs):
|
|
230
230
|
|
|
@@ -192,11 +192,11 @@ class Dataset(datahub.DatasetSourced):
|
|
|
192
192
|
delta = np.sin(glon_2 * np.pi / 180.) - np.sin(glon_2 * np.pi / 180.)
|
|
193
193
|
|
|
194
194
|
if self.replace_orbit:
|
|
195
|
-
|
|
195
|
+
self['SC_GEO_LON'].value = glon_2[:, np.newaxis]
|
|
196
|
+
self['SC_GEO_LAT'].value = cs_new['lat'][:, np.newaxis]
|
|
196
197
|
else:
|
|
197
198
|
glon_1[np.abs(delta)>0.001] = glon_2[np.abs(delta)>0.001]
|
|
198
|
-
|
|
199
|
-
self['SC_GEO_LON'].value = glon_1[:, np.newaxis]
|
|
199
|
+
self['SC_GEO_LON'].value = glon_1[:, np.newaxis]
|
|
200
200
|
|
|
201
201
|
# from geospacelab.observatory.orbit.sc_orbit import OrbitPosition_SSCWS
|
|
202
202
|
# from scipy.interpolate import interp1d
|
|
@@ -106,11 +106,10 @@ class TUDownloader(DownloaderBase):
|
|
|
106
106
|
version_dict[version_in_fn[:3]],
|
|
107
107
|
self.mission + '_data'
|
|
108
108
|
]]) + '/'
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
self.product.upper() / version_in_fn / fp_local)
|
|
109
|
+
fp_local = self.root_dir_local / self.mission.upper() / self.product.upper() / version_in_fn
|
|
110
|
+
for p in fp_remote.replace(replacement, '').split('/'):
|
|
111
|
+
fp_local = fp_local / p
|
|
112
|
+
file_paths_local.append(fp_local)
|
|
114
113
|
super().save_files_from_http(file_paths_local, root_dir_remote)
|
|
115
114
|
|
|
116
115
|
for i, (done, file_path) in enumerate(zip(self.done, self.file_paths_local)):
|
|
@@ -8,7 +8,7 @@ import scipy.signal as sig
|
|
|
8
8
|
from geospacelab.datahub import DatasetUser
|
|
9
9
|
from geospacelab.toolbox.utilities import pydatetime as dttool
|
|
10
10
|
import geospacelab.toolbox.utilities.numpymath as npmath
|
|
11
|
-
|
|
11
|
+
import geospacelab.cs as geo_cs
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class LEOToolbox(DatasetUser):
|
|
@@ -34,6 +34,27 @@ class LEOToolbox(DatasetUser):
|
|
|
34
34
|
self.sector_cs = 'GEO'
|
|
35
35
|
self.sectors = {}
|
|
36
36
|
|
|
37
|
+
def add_GEO_cartesian(self, cs_in='GEO', ):
|
|
38
|
+
|
|
39
|
+
if cs_in == 'GEO':
|
|
40
|
+
coords={
|
|
41
|
+
'lat': self['SC_GEO_LAT'].value.flatten(),
|
|
42
|
+
'lon': self['SC_GEO_LON'].value.flatten(),
|
|
43
|
+
'height': self['SC_GEO_ALT'].value.flatten(),
|
|
44
|
+
'lat_unit': 'deg', 'lon_unit': 'deg', 'height_unit': 'km'
|
|
45
|
+
}
|
|
46
|
+
else:
|
|
47
|
+
raise NotImplementedError
|
|
48
|
+
|
|
49
|
+
cs = geo_cs.GEOSpherical(
|
|
50
|
+
coords=coords
|
|
51
|
+
)
|
|
52
|
+
cs_new = cs.to_cartesian()
|
|
53
|
+
self.add_variable(var_name='SC_GEO_X', value=cs_new['x'].reshape((cs_new['x'].size, 1)))
|
|
54
|
+
self.add_variable(var_name='SC_GEO_Y', value=cs_new['y'].reshape((cs_new['y'].size, 1)))
|
|
55
|
+
self.add_variable(var_name='SC_GEO_Z', value=cs_new['z'].reshape((cs_new['z'].size, 1)))
|
|
56
|
+
return
|
|
57
|
+
|
|
37
58
|
def search_orbit_nodes(self, data_interval=1, t_res=None):
|
|
38
59
|
def check_nodes(nodes):
|
|
39
60
|
dts_nodes = nodes['DATETIME']
|
|
@@ -330,7 +351,266 @@ class LEOToolbox(DatasetUser):
|
|
|
330
351
|
}
|
|
331
352
|
else:
|
|
332
353
|
raise NotImplementedError
|
|
354
|
+
|
|
355
|
+
def griddata_by_sector_new(
|
|
356
|
+
self,
|
|
357
|
+
variable_names=None,
|
|
358
|
+
sector_name=None,
|
|
359
|
+
x_grid_res=20*60,
|
|
360
|
+
y_grid_res=0.5,
|
|
361
|
+
x_data_res=None,
|
|
362
|
+
y_data_res=None,
|
|
363
|
+
grid_method='linear',
|
|
364
|
+
along_x_interp_method='linear',
|
|
365
|
+
along_track_interp=True,
|
|
366
|
+
along_track_interp_method='linear',
|
|
367
|
+
along_track_binning=False,
|
|
368
|
+
along_track_binning_method='mean',
|
|
369
|
+
along_track_binning_size=None,
|
|
370
|
+
visual='on',
|
|
371
|
+
):
|
|
372
|
+
# Initialize parameters
|
|
373
|
+
if along_track_binning and along_track_interp:
|
|
374
|
+
raise ValueError('Only one of along_track_binning and along_track_interp can be True.')
|
|
375
|
+
if along_track_binning:
|
|
376
|
+
if along_track_binning_size is None:
|
|
377
|
+
along_track_binning_size = y_grid_res
|
|
378
|
+
|
|
379
|
+
self.visual = visual
|
|
380
|
+
dts_c = self['_'.join(('SECTOR', sector_name, 'DATETIME'))].value.flatten()
|
|
381
|
+
dts = self['SC_DATETIME'].value.flatten()
|
|
382
|
+
sector = self['SECTOR_' + sector_name].value.flatten()
|
|
383
|
+
pseudo_lat = self['_'.join(('SECTOR', sector_name, 'PSEUDO_LAT'))].value.flatten()
|
|
384
|
+
lat_range = self.sectors[sector_name]['PSEUDO_LAT_RANGE']
|
|
385
|
+
n_tracks = int(np.max(sector))
|
|
386
|
+
|
|
387
|
+
if along_track_interp:
|
|
388
|
+
x_data = dts[sector > 0]
|
|
389
|
+
else:
|
|
390
|
+
x_data = dts_c[sector > 0]
|
|
391
|
+
x_data_c = dts_c[sector>0]
|
|
392
|
+
x = np.array([(dt - dttool.get_start_of_the_day(self.dt_fr)).total_seconds() for dt in x_data])
|
|
393
|
+
x_c = np.array([(dt - dttool.get_start_of_the_day(self.dt_fr)).total_seconds() for dt in x_data_c])
|
|
394
|
+
x_unique_c = np.unique(x_c)
|
|
395
|
+
if x_data_res is None:
|
|
396
|
+
x_data_res = np.nanmedian(np.diff(x_unique_c))
|
|
397
|
+
|
|
398
|
+
y_data = pseudo_lat[sector > 0]
|
|
399
|
+
y= y_data
|
|
400
|
+
if y_data_res is None:
|
|
401
|
+
diff_ys = []
|
|
402
|
+
for i in range(n_tracks):
|
|
403
|
+
sector_i = sector[sector>0]
|
|
404
|
+
y_track = y_data[sector_i == i+1]
|
|
405
|
+
if len(y_track) > 3:
|
|
406
|
+
diff_ys.append(np.abs(y_track[len(y_track) // 2] - y_track[len(y_track) // 2 - 1]))
|
|
407
|
+
y_data_res = np.nanmedian(diff_ys)
|
|
408
|
+
if y_grid_res > y_data_res:
|
|
409
|
+
y_data_res = y_grid_res
|
|
410
|
+
|
|
411
|
+
# Set the grids
|
|
412
|
+
dt0 = dttool.get_start_of_the_day(self.dt_fr)
|
|
413
|
+
ny = int(np.ceil(np.diff(lat_range) / y_grid_res) + 1)
|
|
414
|
+
ys = np.linspace(lat_range[0], lat_range[1], ny)
|
|
415
|
+
if x_grid_res is None:
|
|
416
|
+
xs = x_unique_c
|
|
417
|
+
# ys = ys[:-1] + y_grid_res / 2
|
|
418
|
+
grid_x, grid_y = np.meshgrid(xs, ys)
|
|
419
|
+
x_interp = False
|
|
420
|
+
x_grid_res=x_data_res
|
|
421
|
+
else:
|
|
422
|
+
min_x = np.floor((self.dt_fr - dt0).total_seconds() / x_grid_res) * x_grid_res
|
|
423
|
+
max_x = np.ceil((self.dt_to - dt0).total_seconds() / x_grid_res) * x_grid_res
|
|
424
|
+
grid_x, grid_y = np.meshgrid(
|
|
425
|
+
np.arange(min_x, max_x, x_grid_res),
|
|
426
|
+
ys
|
|
427
|
+
)
|
|
428
|
+
x_interp = True
|
|
429
|
+
if along_track_binning:
|
|
430
|
+
y_bins = [
|
|
431
|
+
ys - along_track_binning_size / 2,
|
|
432
|
+
ys + along_track_binning_size / 2
|
|
433
|
+
]
|
|
434
|
+
|
|
435
|
+
grid_lat = griddata((x_c, y), y, (grid_x, grid_y), method='nearest')
|
|
436
|
+
|
|
437
|
+
if self.sector_cs == 'AACGM':
|
|
438
|
+
mask_y = np.abs(grid_y - grid_lat) > y_data_res * 2
|
|
439
|
+
which_lat = 'AACGM_LAT'
|
|
440
|
+
if self.sector_cs == 'APEX':
|
|
441
|
+
mask_y = np.abs(grid_y - grid_lat) > y_data_res * 2
|
|
442
|
+
which_lat = 'APEX_LAT'
|
|
443
|
+
else:
|
|
444
|
+
mask_y = np.abs(grid_y - grid_lat) > y_data_res * 1.2
|
|
445
|
+
which_lat = 'GEO_LAT'
|
|
446
|
+
|
|
447
|
+
grid_sectime = griddata((x_c, y), x_c, (grid_x, grid_y), method='nearest')
|
|
448
|
+
mask_x = np.abs(grid_x - grid_sectime) > x_data_res * 1.2
|
|
449
|
+
|
|
450
|
+
# remove gaps
|
|
451
|
+
# i_mask_x = np.where(mask_x)
|
|
452
|
+
# rec_bounds_ind = {}
|
|
453
|
+
# if list(i_mask_x[0]):
|
|
454
|
+
# for ii, jj in zip(*i_mask_x):
|
|
455
|
+
# xx = grid_x[ii, jj]
|
|
456
|
+
# x_ii = grid_x[ii, :].flatten()
|
|
457
|
+
# if xx in rec_bounds_ind.keys():
|
|
458
|
+
# bound_x_1 = rec_bounds_ind[xx][0]
|
|
459
|
+
# bound_x_2 = rec_bounds_ind[xx][1]
|
|
460
|
+
# else:
|
|
461
|
+
# iii = np.where(x_unique_c<xx)[0]
|
|
462
|
+
# if not list(iii):
|
|
463
|
+
# bound_x_1 = x_ii[0] - x_data_res
|
|
464
|
+
# else:
|
|
465
|
+
# bound_x_1 = x_unique_c[iii[-1]] - x_grid_res
|
|
466
|
+
# iii = np.where(x_unique_c > xx)[0]
|
|
467
|
+
# if not list(iii):
|
|
468
|
+
# bound_x_2 = x_ii[-1] + x_grid_res
|
|
469
|
+
# else:
|
|
470
|
+
# bound_x_2 = x_unique_c[iii[0]] + x_data_res
|
|
471
|
+
# rec_bounds_ind[xx] = [bound_x_1, bound_x_2]
|
|
472
|
+
# mask_x[ii, (x_ii >= bound_x_1) & (x_ii <= bound_x_2)] = True
|
|
473
|
+
# pass
|
|
474
|
+
|
|
475
|
+
#
|
|
476
|
+
|
|
477
|
+
for var_name in variable_names:
|
|
478
|
+
# print(var_name)
|
|
479
|
+
vrb = self[var_name].value.flatten()[sector>0]
|
|
480
|
+
if along_track_binning:
|
|
481
|
+
sector_1 = sector[sector>0]
|
|
482
|
+
n_lats = ny
|
|
483
|
+
xx_1 = np.full((n_tracks, n_lats), np.nan)
|
|
484
|
+
yy_1 = grid_y[:, 0].flatten()
|
|
485
|
+
zz_1 = np.full((n_tracks, n_lats), np.nan)
|
|
486
|
+
grid_z = np.ones_like(grid_x)*np.nan
|
|
333
487
|
|
|
488
|
+
for ii in np.arange(1, n_tracks+1):
|
|
489
|
+
xd = x[sector_1 == ii]
|
|
490
|
+
yd = y[sector_1 == ii]
|
|
491
|
+
zd = vrb[sector_1 == ii]
|
|
492
|
+
if (not list(xd)) or (not list(yd)):
|
|
493
|
+
continue
|
|
494
|
+
inds_sorted = np.argsort(yd)
|
|
495
|
+
yd_sorted = yd[inds_sorted]
|
|
496
|
+
inds_y_bin_0 = np.searchsorted(yd_sorted, y_bins[0])
|
|
497
|
+
inds_y_bin_1 = np.searchsorted(yd_sorted, y_bins[1])
|
|
498
|
+
for ib0, ib1 in zip(inds_y_bin_0, inds_y_bin_1):
|
|
499
|
+
if along_track_binning_method == 'mean':
|
|
500
|
+
z_i = np.nanmean(zd[inds_sorted[ib0:ib1]])
|
|
501
|
+
elif along_track_binning_method == 'median':
|
|
502
|
+
z_i = np.nanmedian(zd[inds_sorted[ib0:ib1]])
|
|
503
|
+
elif along_track_binning_method == 'max':
|
|
504
|
+
z_i = np.nanmax(zd[inds_sorted[ib0:ib1]])
|
|
505
|
+
elif along_track_binning_method == 'min':
|
|
506
|
+
z_i = np.nanmin(zd[inds_sorted[ib0:ib1]])
|
|
507
|
+
|
|
508
|
+
if list(z_i):
|
|
509
|
+
z_bin = np.nanmean(z_i)
|
|
510
|
+
else:
|
|
511
|
+
z_bin = np.nan
|
|
512
|
+
f = interp1d(yd, xd, bounds_error=False, fill_value= 'extrapolate')
|
|
513
|
+
x_i = f(yy_1)
|
|
514
|
+
xx_1[ii-1, :] = x_i
|
|
515
|
+
|
|
516
|
+
if 'LON' in var_name:
|
|
517
|
+
z_i = npmath.interp_period_data(yd, zd, yy_1, period=360., method='linear', bounds_error=False)
|
|
518
|
+
elif 'LST' in var_name:
|
|
519
|
+
z_i = npmath.interp_period_data(yd, zd, yy_1, period=24., method='linear', bounds_error=False)
|
|
520
|
+
else:
|
|
521
|
+
# f = interp1d(yd, zd, bounds_error=False, fill_value='extrapolate')
|
|
522
|
+
# z_i = f(yy_1)
|
|
523
|
+
z_i = np.ones_like(yy_1) * np.nan
|
|
524
|
+
for j, yyy in enumerate(yy_1):
|
|
525
|
+
inds_y = np.where((yd >= yyy-y_grid_res/2) & (yd < yyy+y_grid_res/2))[0]
|
|
526
|
+
if list(inds_y):
|
|
527
|
+
z_i[j] = np.nanmean(zd[inds_y])
|
|
528
|
+
zz_1[ii-1, :] = z_i
|
|
529
|
+
for ii in range(grid_x.shape[0]):
|
|
530
|
+
xd = xx_1[:, ii].flatten()
|
|
531
|
+
zd = zz_1[:, ii].flatten()
|
|
532
|
+
if x_interp:
|
|
533
|
+
if 'LON' in var_name:
|
|
534
|
+
z_i = npmath.interp_period_data(xd, zd, grid_x[0], period=360., method='linear', bounds_error=False)
|
|
535
|
+
elif 'LST' in var_name:
|
|
536
|
+
z_i = npmath.interp_period_data(xd, zd, grid_x[0], period=24., method='linear', bounds_error=False)
|
|
537
|
+
else:
|
|
538
|
+
f = interp1d(xd, zd, bounds_error=False, fill_value='extrapolate')
|
|
539
|
+
z_i = f(grid_x[0])
|
|
540
|
+
grid_z[ii, :] = z_i
|
|
541
|
+
else:
|
|
542
|
+
grid_z[ii, :] = zd
|
|
543
|
+
elif along_track_interp:
|
|
544
|
+
sector_1 = sector[sector>0]
|
|
545
|
+
n_tracks = int(np.max(sector))
|
|
546
|
+
n_lats = ny
|
|
547
|
+
xx_1 = np.empty((n_tracks, n_lats))
|
|
548
|
+
zz_1 = np.empty((n_tracks, n_lats))
|
|
549
|
+
yy_1 = grid_y[:, 0].flatten()
|
|
550
|
+
grid_z = np.ones_like(grid_x) * np.nan
|
|
551
|
+
for ii in np.arange(1, n_tracks+1):
|
|
552
|
+
xd = x[sector_1 == ii]
|
|
553
|
+
yd = y[sector_1 == ii]
|
|
554
|
+
zd = vrb[sector_1 == ii]
|
|
555
|
+
|
|
556
|
+
if (not list(xd)) or (not list(yd)):
|
|
557
|
+
continue
|
|
558
|
+
|
|
559
|
+
f = interp1d(yd, xd, bounds_error=False, fill_value= 'extrapolate')
|
|
560
|
+
x_i = f(yy_1)
|
|
561
|
+
xx_1[ii-1, :] = x_i
|
|
562
|
+
|
|
563
|
+
if 'LON' in var_name:
|
|
564
|
+
z_i = npmath.interp_period_data(yd, zd, yy_1, period=360., method='linear', bounds_error=False)
|
|
565
|
+
elif 'LST' in var_name:
|
|
566
|
+
z_i = npmath.interp_period_data(yd, zd, yy_1, period=24., method='linear', bounds_error=False)
|
|
567
|
+
else:
|
|
568
|
+
f = interp1d(yd, zd, bounds_error=False, fill_value='extrapolate')
|
|
569
|
+
z_i = f(yy_1)
|
|
570
|
+
zz_1[ii-1, :] = z_i
|
|
571
|
+
for ii in range(grid_x.shape[0]):
|
|
572
|
+
xd = xx_1[:, ii].flatten()
|
|
573
|
+
zd = zz_1[:, ii].flatten()
|
|
574
|
+
if x_interp:
|
|
575
|
+
if 'LON' in var_name:
|
|
576
|
+
z_i = npmath.interp_period_data(xd, zd, grid_x[0], period=360., method='linear', bounds_error=False)
|
|
577
|
+
elif 'LST' in var_name:
|
|
578
|
+
z_i = npmath.interp_period_data(xd, zd, grid_x[0], period=24., method='linear', bounds_error=False)
|
|
579
|
+
else:
|
|
580
|
+
f = interp1d(xd, zd, bounds_error=False, fill_value='extrapolate')
|
|
581
|
+
z_i = f(grid_x[0])
|
|
582
|
+
grid_z[ii, :] = z_i
|
|
583
|
+
else:
|
|
584
|
+
grid_z[ii, :] = zd
|
|
585
|
+
else:
|
|
586
|
+
grid_z = griddata((x, y), vrb, (grid_x, grid_y), method=method)
|
|
587
|
+
grid_z[mask_y] = np.nan
|
|
588
|
+
grid_z[mask_x] = np.nan
|
|
589
|
+
var_name_in = '_'.join(('SECTOR', sector_name, 'GRID', var_name))
|
|
590
|
+
self.sectors[sector_name]['VARIABLE_NAMES'].append(var_name_in)
|
|
591
|
+
|
|
592
|
+
# self.add_variable(var_name=var_name_in, value=grid_z.T)
|
|
593
|
+
self[var_name_in] = self[var_name].clone(omit_attrs='visual')
|
|
594
|
+
self[var_name_in].visual = 'new'
|
|
595
|
+
var = self[var_name_in]
|
|
596
|
+
var.value = grid_z.T
|
|
597
|
+
var.set_depend(0, {'UT': '_'.join(('SECTOR', sector_name, 'GRID_DATETIME'))})
|
|
598
|
+
var.set_depend(1, {which_lat: '_'.join(('SECTOR', sector_name, 'GRID_LAT'))})
|
|
599
|
+
var.visual.axis[0].data = '@d.' + '_'.join(('SECTOR', sector_name, 'GRID_DATETIME'))
|
|
600
|
+
var.visual.axis[1].data = '@d.' + '_'.join(('SECTOR', sector_name, 'GRID_LAT'))
|
|
601
|
+
var.visual.axis[1].label = 'GLAT' if self.sector_cs == 'GEO' else 'MLAT'
|
|
602
|
+
var.visual.axis[1].unit = r'$^\circ$'
|
|
603
|
+
var.visual.axis[1].lim = lat_range
|
|
604
|
+
var.visual.axis[2].data = '@v.value'
|
|
605
|
+
var.visual.axis[2].data_scale = self[var_name].visual.axis[1].data_scale
|
|
606
|
+
var.visual.axis[2].label = '@v.label'
|
|
607
|
+
var.visual.axis[2].unit = '@v.unit'
|
|
608
|
+
var.visual.plot_config.style = '2P'
|
|
609
|
+
var.visual.plot_config.pcolormesh.update(cmap='jet')
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
return
|
|
613
|
+
|
|
334
614
|
def griddata_by_sector(
|
|
335
615
|
self, sector_name=None, variable_names=None, x_grid_res=20*60, y_grid_res=0.5, along_track_interp=True,
|
|
336
616
|
x_data_res=None, y_data_res=None, along_track_binning=False,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: geospacelab
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.3
|
|
4
4
|
Summary: Collect, manage, and visualize geospace data.
|
|
5
5
|
Home-page: https://github.com/JouleCai/geospacelab
|
|
6
6
|
Author: Lei Cai
|
|
@@ -27,8 +27,8 @@ Requires-Dist: beautifulsoup4>=4.9.3
|
|
|
27
27
|
Requires-Dist: natsort>=7.1.1
|
|
28
28
|
Requires-Dist: numpy<2.4.0
|
|
29
29
|
Requires-Dist: scipy>=1.6.0
|
|
30
|
-
Requires-Dist: h5py>=3.2.1
|
|
31
30
|
Requires-Dist: netcdf4>=1.5.7
|
|
31
|
+
Requires-Dist: h5py>=3.2.1
|
|
32
32
|
Requires-Dist: matplotlib>=3.5
|
|
33
33
|
Requires-Dist: madrigalweb>=3.3
|
|
34
34
|
Requires-Dist: aacgmv2>=2.6.2
|
|
@@ -376,6 +376,12 @@ Output:
|
|
|
376
376
|
From then on, the data source has been switched from JHUAPL to CDAWeb.
|
|
377
377
|
|
|
378
378
|
```python
|
|
379
|
+
|
|
380
|
+
import datetime
|
|
381
|
+
import matplotlib.pyplot as plt
|
|
382
|
+
import geospacelab.visualization.mpl.geomap.geodashboards as geomap
|
|
383
|
+
|
|
384
|
+
|
|
379
385
|
dt_fr = datetime.datetime(2015, 9, 8, 8)
|
|
380
386
|
dt_to = datetime.datetime(2015, 9, 8, 23, 59)
|
|
381
387
|
time_c = datetime.datetime(2015, 9, 8, 20, 21)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
geospacelab/__init__.py,sha256=
|
|
1
|
+
geospacelab/__init__.py,sha256=k0D5pyAhRJ3aOpvHg8OpbijUV_a_Fx4BJzB7U1iCUMA,801
|
|
2
2
|
geospacelab/config/__init__.py,sha256=--F2bcKRCNIbPaFz4bySMkuxGg1ZxF1j1uyxMA0t3xA,660
|
|
3
3
|
geospacelab/config/__mpl__.py,sha256=bO10-mtYDF1EhnRFuXX4H8TUU3esxOZe-qfTrzRhBk0,4705
|
|
4
4
|
geospacelab/config/_preferences.py,sha256=VKXXWNvFzIMXGmvb7Udd900DoubMlqrcu-gLmzHmzMk,4754
|
|
@@ -23,7 +23,7 @@ geospacelab/datahub/_variable_base.py,sha256=dUm15Y012FQ0hAdeA48ky0tKEc9il59FHvO
|
|
|
23
23
|
geospacelab/datahub/test.py,sha256=ZXtv9nhZd3RKr8BPsKqSB_boCpB2P4SYF6hFKdo8aAg,682
|
|
24
24
|
geospacelab/datahub/sources/__init__.py,sha256=VZtk8qV_O3LQtUQOOwvBwbqmcI_labsWdml-iqpH8u4,327
|
|
25
25
|
geospacelab/datahub/sources/cdaweb/__init__.py,sha256=fP1ziTZFxTOz-HF07az67F5AfvKJsXdJluEK-NZi6yU,680
|
|
26
|
-
geospacelab/datahub/sources/cdaweb/downloader.py,sha256
|
|
26
|
+
geospacelab/datahub/sources/cdaweb/downloader.py,sha256=yR4clbgB69zzy0xcfUSKyYIzo_odD9Yu4aY9J8691ew,15287
|
|
27
27
|
geospacelab/datahub/sources/cdaweb/downloader_backup.py,sha256=LCn0tupzAkir9Z_280tBulHEPlqoX6DWe8HKFk1h4IE,3191
|
|
28
28
|
geospacelab/datahub/sources/cdaweb/dmsp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
geospacelab/datahub/sources/cdaweb/dmsp/ssusi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -202,13 +202,13 @@ geospacelab/datahub/sources/madrigal/isr/risr_n/vi/variable_config.py,sha256=dE-
|
|
|
202
202
|
geospacelab/datahub/sources/madrigal/satellites/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
203
203
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/__init__.py,sha256=YnuaB5J_ER8LrLUFghlty0YHYnmd9_2IHNW9TBQLaSI,487
|
|
204
204
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/downloader.py,sha256=WUtJN1OPF_CzH1ZxvM01TG1O71Vnr5sx1KcyfVWGPbE,4913
|
|
205
|
-
geospacelab/datahub/sources/madrigal/satellites/dmsp/e/__init__.py,sha256=
|
|
205
|
+
geospacelab/datahub/sources/madrigal/satellites/dmsp/e/__init__.py,sha256=fVcmj9Jyym_OiVG-aT-lawJMzmIEdykdzQK4KTwrXbc,10347
|
|
206
206
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/e/loader.py,sha256=kZ9AeI0LsNWS26Kwfp6azvDl2IutcWKBPDd6o0tKASc,4902
|
|
207
207
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/e/variable_config.py,sha256=exp1bYVmDBVlIbraeNgAuVEnjxg5IC2ED1cZIEiPj1U,10280
|
|
208
|
-
geospacelab/datahub/sources/madrigal/satellites/dmsp/s1/__init__.py,sha256=
|
|
208
|
+
geospacelab/datahub/sources/madrigal/satellites/dmsp/s1/__init__.py,sha256=otMfzaf9vTgultEXXMDnwVtXVO1HCPqNOrPYuFRLaPw,11264
|
|
209
209
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/s1/loader.py,sha256=o5zEkosq7LyNlBIjlefKUpYpePCDbyL_yd3HrrUrk5Q,3360
|
|
210
210
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/s1/variable_config.py,sha256=Amp90wHogRQOESLH2b4D0jfeBozIKvvOnwx-_waU0us,6745
|
|
211
|
-
geospacelab/datahub/sources/madrigal/satellites/dmsp/s4/__init__.py,sha256=
|
|
211
|
+
geospacelab/datahub/sources/madrigal/satellites/dmsp/s4/__init__.py,sha256=eqSbH10r6e650ShTwOLGcqXSYNGYDmiak2eZFKkSFeA,12169
|
|
212
212
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/s4/loader.py,sha256=LL8IAMwmgQX06lgVECh6Rx6TGXEoHmAkFDmouJ6kQOo,3229
|
|
213
213
|
geospacelab/datahub/sources/madrigal/satellites/dmsp/s4/variable_config.py,sha256=4DhvQxFonoYiU_3f9ObE2OkJOXDkHfw0RUMHa3FLTv4,4054
|
|
214
214
|
geospacelab/datahub/sources/ncei/__init__.py,sha256=MHpNJ-PJBjywheG5CZDgj89fsxVG5qSxi_vkTsxibd8,658
|
|
@@ -246,7 +246,7 @@ geospacelab/datahub/sources/supermag/magnetometer/downloader.py,sha256=P9o888vds
|
|
|
246
246
|
geospacelab/datahub/sources/supermag/magnetometer/loader.py,sha256=Jef9eydQDPNcCVHpji6nUWGdtBMR5Phbmd0i7PPEd3M,2002
|
|
247
247
|
geospacelab/datahub/sources/supermag/magnetometer/variable_config.py,sha256=DgXzDgrz8cLQj8tlxk_Fqmb5vvmHQdUfNrmkBaytgM8,5106
|
|
248
248
|
geospacelab/datahub/sources/tud/__init__.py,sha256=83o4oiR4K8ZYQdTZ8ZwvZyyYkEhEzXjIo44861XTMSg,2706
|
|
249
|
-
geospacelab/datahub/sources/tud/downloader.py,sha256=
|
|
249
|
+
geospacelab/datahub/sources/tud/downloader.py,sha256=FtX4ae3v-VEmMcIVwouW-xt6mPDbFPU3UOQ5p3QtdpU,12874
|
|
250
250
|
geospacelab/datahub/sources/tud/champ/__init__.py,sha256=iGqgkK3TM-vGgySrlQR_6ry1EGRqcTDXQTAewf-cgNU,559
|
|
251
251
|
geospacelab/datahub/sources/tud/champ/dns_acc/__init__.py,sha256=hEVXH7H7XtjgzBfu3HAvbkqRqrYMr0nUTCpAM6ll3V4,10276
|
|
252
252
|
geospacelab/datahub/sources/tud/champ/dns_acc/downloader.py,sha256=vjpKCZqa5-zTMAo7LHNUMqWCqRutnu-loRGZ-SfG1AU,1121
|
|
@@ -335,7 +335,7 @@ geospacelab/observatory/earth/geodesy.py,sha256=6ouOEgiqlTrDBHdPjhZ5p8BScfG8-NYr
|
|
|
335
335
|
geospacelab/observatory/earth/sun_position.py,sha256=gy-zPPoX_92r6Cz7BT7JQyiNO_tte3osCQFkNq9lWe0,1434
|
|
336
336
|
geospacelab/observatory/orbit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
337
337
|
geospacelab/observatory/orbit/sc_orbit.py,sha256=FgTAFnoL6HRNlP8C9o2IDE0TpfGwaAP_3_2_8x4Euxo,15588
|
|
338
|
-
geospacelab/observatory/orbit/utilities.py,sha256=
|
|
338
|
+
geospacelab/observatory/orbit/utilities.py,sha256=zhSBcSWAbfx_vD3Gd4zHS0AuZzfwPp-WYyjMEuajRZc,47245
|
|
339
339
|
geospacelab/observatory/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
340
340
|
geospacelab/observatory/site/mixins.py,sha256=rhMJngBVgv0wR1m8e5cvnPxHZQnntbcJIgp4bEyTMFE,457
|
|
341
341
|
geospacelab/quantity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -400,7 +400,7 @@ geospacelab/wrapper/geopack/geopack/t89.py,sha256=zDVNPrmtK1NnNHgohQEPqOOJDsm2Z-
|
|
|
400
400
|
geospacelab/wrapper/geopack/geopack/t96.py,sha256=ktcoo1R7Z3NtkWHENuseu48ub4-JfQGqFV0ZOtd0zH8,65292
|
|
401
401
|
geospacelab/wrapper/geopack/geopack/test_geopack1.md,sha256=dMUY0O1BgZsKpmJ6BLSQ80B6p6DZcB7OceFeyPOlFK0,15324
|
|
402
402
|
geospacelab/wrapper/geopack/geopack/test_geopack1.py,sha256=qjLz6O3BAk3H58IpmxXyftwZTkh3vPGp49C-al4hjf0,6669
|
|
403
|
-
geospacelab-0.12.
|
|
403
|
+
geospacelab-0.12.3.dist-info/licenses/LICENSE,sha256=2yRlwLt4o5Z6OZAGcyvBj-zfFX1Uw7E6CzqODg7khqs,1515
|
|
404
404
|
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
405
405
|
test/test_ampere.py,sha256=0-HZURubpv1mBK3bJ_qTqx39L1jezgRoU5neXMPYgZQ,2968
|
|
406
406
|
test/test_dmsp_s1.py,sha256=5m_7mjdDGja8ovshNPV3LKW_6q6mIwT9XKqoyRiH79A,3588
|
|
@@ -410,7 +410,7 @@ test/test_omni.py,sha256=Zk1LZozPiY5V0aSRmK6GTQuB01hHn_j2j3Brm6Ea_po,1632
|
|
|
410
410
|
test/test_superdarn.py,sha256=uP55muvXryPzNGHinWkiGv2PxvRs4f9M9h1WIBEBW7k,2846
|
|
411
411
|
test/test_swarm.py,sha256=PDDE9nUshhQpXZbV_ZwcsjbMhI73fRaojTZv9rtRzZE,15568
|
|
412
412
|
test/test_swarm_new.py,sha256=mzhMAx-M9W3Ue5noTyfBx4c3Vtc3b_ZUEvGgL9v8UE4,853
|
|
413
|
-
geospacelab-0.12.
|
|
414
|
-
geospacelab-0.12.
|
|
415
|
-
geospacelab-0.12.
|
|
416
|
-
geospacelab-0.12.
|
|
413
|
+
geospacelab-0.12.3.dist-info/METADATA,sha256=woYG0JznX74bBp-IBp_dGuKltHt5cdAzfEn0fYK9Fys,24309
|
|
414
|
+
geospacelab-0.12.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
415
|
+
geospacelab-0.12.3.dist-info/top_level.txt,sha256=98eDwrSNgyQFAtSA06QMP71gw9BzgIj0uvkTudpGly4,12
|
|
416
|
+
geospacelab-0.12.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|