geospacelab 0.10.0__py3-none-any.whl → 0.10.1__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/madrigal/isr/eiscat/__init__.py +17 -6
- geospacelab/datahub/sources/madrigal/isr/eiscat/downloader.py +2 -2
- geospacelab/datahub/sources/madrigal/isr/eiscat/loader.py +71 -36
- geospacelab/toolbox/utilities/numpyarray.py +137 -1
- geospacelab/visualization/mpl/panels.py +16 -0
- {geospacelab-0.10.0.dist-info → geospacelab-0.10.1.dist-info}/METADATA +1 -1
- {geospacelab-0.10.0.dist-info → geospacelab-0.10.1.dist-info}/RECORD +11 -11
- {geospacelab-0.10.0.dist-info → geospacelab-0.10.1.dist-info}/WHEEL +0 -0
- {geospacelab-0.10.0.dist-info → geospacelab-0.10.1.dist-info}/licenses/LICENSE +0 -0
- {geospacelab-0.10.0.dist-info → geospacelab-0.10.1.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.10.
|
|
9
|
+
__version__ = "0.10.1"
|
|
10
10
|
__maintainer__ = "Lei Cai"
|
|
11
11
|
__email__ = "lei.cai@oulu.fi"
|
|
12
12
|
__status__ = "Developing"
|
|
@@ -72,7 +72,8 @@ class Dataset(datahub.DatasetSourced):
|
|
|
72
72
|
self.data_file_type = kwargs.pop('data_file_type', '')
|
|
73
73
|
self.affiliation = kwargs.pop('affiliation', '')
|
|
74
74
|
self.allow_download = kwargs.pop('allow_download', True)
|
|
75
|
-
self.
|
|
75
|
+
self.gate_num = kwargs.pop('gate_num', None)
|
|
76
|
+
self.metadata = {}
|
|
76
77
|
self.add_AACGM = kwargs.pop('add_AACGM', True)
|
|
77
78
|
self.add_APEX = kwargs.pop('add_APEX', False)
|
|
78
79
|
|
|
@@ -116,7 +117,9 @@ class Dataset(datahub.DatasetSourced):
|
|
|
116
117
|
self.check_data_files(**kwargs)
|
|
117
118
|
|
|
118
119
|
for file_path in self.data_file_paths:
|
|
119
|
-
load_obj = self.loader(file_path, file_type=self.data_file_type)
|
|
120
|
+
load_obj = self.loader(file_path, file_type=self.data_file_type, gate_num=self.gate_num)
|
|
121
|
+
if self.gate_num is None:
|
|
122
|
+
self.gate_num = load_obj.gate_num
|
|
120
123
|
|
|
121
124
|
for var_name in self._variables.keys():
|
|
122
125
|
self._variables[var_name].join(load_obj.variables[var_name])
|
|
@@ -130,6 +133,12 @@ class Dataset(datahub.DatasetSourced):
|
|
|
130
133
|
self.experiment = rawdata_path.split('/')[-1].split('@')[0]
|
|
131
134
|
self.affiliation = load_obj.metadata['affiliation']
|
|
132
135
|
self.metadata = load_obj.metadata
|
|
136
|
+
|
|
137
|
+
inds_cmb = np.argsort(self['DATETIME'].flatten())
|
|
138
|
+
if any(np.diff(np.array(inds_cmb))<0):
|
|
139
|
+
for var_name in self.keys():
|
|
140
|
+
self[var_name].value = self[var_name].value[inds_cmb, :]
|
|
141
|
+
|
|
133
142
|
if self.add_AACGM or self.add_APEX:
|
|
134
143
|
self.calc_lat_lon()
|
|
135
144
|
# self.select_beams(field_aligned=True)
|
|
@@ -357,21 +366,23 @@ class Dataset(datahub.DatasetSourced):
|
|
|
357
366
|
fps_sub = []
|
|
358
367
|
for ii in inds_id:
|
|
359
368
|
fp = file_paths[ii]
|
|
360
|
-
rc = re.compile(r".*_([\d]{8}T[\d]{6}).*_([\d]{8}T[\d]{6}).*[\d]{4}\-[\d]{2}\-[\d]{2}_([\w]+)@.*")
|
|
369
|
+
rc = re.compile(r".*_([\d]{8}T[\d]{6}).*_([\d]{8}T[\d]{6}).*[\d]{4}\-[\d]{2}\-[\d]{2}_([\w.]+)@.*")
|
|
361
370
|
res = rc.search(str(fp))
|
|
362
371
|
dt_0 = datetime.datetime.strptime(res.groups()[0], '%Y%m%dT%H%M%S')
|
|
363
372
|
dt_1 = datetime.datetime.strptime(res.groups()[1], '%Y%m%dT%H%M%S')
|
|
364
373
|
if (dt_0 >= self.dt_to) or (dt_1<=self.dt_fr):
|
|
365
374
|
continue
|
|
366
375
|
if str(self.pulse_code):
|
|
367
|
-
if self.pulse_code not in res.groups()[2]:
|
|
376
|
+
if self.pulse_code not in res.groups()[2].lower():
|
|
368
377
|
continue
|
|
369
378
|
if str(self.modulation):
|
|
370
|
-
if self.modulation not in res.groups()[2]:
|
|
379
|
+
if self.modulation not in res.groups()[2].lower():
|
|
371
380
|
continue
|
|
381
|
+
if '_v' in res.groups()[2].lower():
|
|
382
|
+
continue
|
|
372
383
|
fps_sub.extend([fp])
|
|
373
384
|
if len(fps_sub) > 1:
|
|
374
|
-
mylog.StreamLogger.warning("Multiple data files for a single experiment detected!
|
|
385
|
+
mylog.StreamLogger.warning("Multiple data files for a single experiment detected!")
|
|
375
386
|
# for fp in fps_sub:
|
|
376
387
|
# mylog.simpleinfo.info(str(fp))
|
|
377
388
|
# fps_sub = fps_sub[0]
|
|
@@ -207,8 +207,8 @@ class Downloader(DownloaderBase):
|
|
|
207
207
|
dt_to_exp = datetime.datetime(
|
|
208
208
|
exp.endyear, exp.endmonth, exp.endday, exp.endhour, exp.endmin, exp.endsec
|
|
209
209
|
)
|
|
210
|
-
if (dt_fr_exp >= self.dt_to) or (dt_to_exp <= self.dt_fr):
|
|
211
|
-
|
|
210
|
+
# if (dt_fr_exp >= self.dt_to) or (dt_to_exp <= self.dt_fr):
|
|
211
|
+
# continue
|
|
212
212
|
for file in list(exp.files):
|
|
213
213
|
|
|
214
214
|
file_path_remote = pathlib.Path(file.name)
|
|
@@ -13,6 +13,7 @@ import h5py
|
|
|
13
13
|
import numpy as np
|
|
14
14
|
import pathlib
|
|
15
15
|
import re
|
|
16
|
+
import scipy.interpolate as si
|
|
16
17
|
|
|
17
18
|
from geospacelab.config import pref as prf
|
|
18
19
|
|
|
@@ -32,12 +33,12 @@ default_variable_names = [
|
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class Loader:
|
|
35
|
-
def __init__(self, file_path, file_type="eiscat-hdf5"):
|
|
36
|
+
def __init__(self, file_path, file_type="eiscat-hdf5", gate_num=None):
|
|
36
37
|
self.variables = {}
|
|
37
38
|
self.metadata = {}
|
|
38
39
|
self.file_path = file_path
|
|
39
40
|
self.file_type = file_type
|
|
40
|
-
|
|
41
|
+
self.gate_num = gate_num
|
|
41
42
|
self.load_data()
|
|
42
43
|
|
|
43
44
|
def load_data(self):
|
|
@@ -131,8 +132,19 @@ class Loader:
|
|
|
131
132
|
if num_col != nrec[0]:
|
|
132
133
|
print("Note: the number of range gates doesn't match nrec!")
|
|
133
134
|
var = var.reshape(num_row, num_col)
|
|
135
|
+
if self.gate_num is None:
|
|
136
|
+
self.gate_num = num_col
|
|
137
|
+
else:
|
|
138
|
+
var_array = np.empty((num_row, num_gates))
|
|
139
|
+
var_array[::] = np.nan
|
|
140
|
+
for i in range(num_row):
|
|
141
|
+
var_array[i, 0:num_col] = var[i, :]
|
|
142
|
+
var = var_array
|
|
134
143
|
elif nrec_group == 'par1d':
|
|
135
|
-
|
|
144
|
+
if self.gate_num is None:
|
|
145
|
+
self.gate_num = num_gates = int(np.max(nrec))
|
|
146
|
+
else:
|
|
147
|
+
num_gates = self.gate_num
|
|
136
148
|
var_array = np.empty((num_row, num_gates))
|
|
137
149
|
var_array[:, :] = np.nan
|
|
138
150
|
rec_ind_1 = 0
|
|
@@ -201,21 +213,30 @@ class Loader:
|
|
|
201
213
|
# check height and range
|
|
202
214
|
vars['HEIGHT'] = vars['HEIGHT'] / 1000.
|
|
203
215
|
vars['RANGE'] = vars['RANGE'] / 1000.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
|
|
217
|
+
inds_nan = np.where(np.isnan(vars['HEIGHT']))
|
|
218
|
+
if list(inds_nan):
|
|
219
|
+
m, n = vars['HEIGHT'].shape
|
|
220
|
+
for i in range(m):
|
|
221
|
+
yy = vars['HEIGHT'][i, :].flatten()
|
|
222
|
+
iii = np.where(~np.isfinite(yy))
|
|
223
|
+
if not list(iii):
|
|
224
|
+
continue
|
|
225
|
+
iii = np.where(np.isfinite(yy))[0]
|
|
226
|
+
xx = np.arange(0, n)
|
|
227
|
+
f = si.interp1d(xx[iii], yy[iii], kind='linear', bounds_error=False, fill_value='extrapolate')
|
|
228
|
+
yy_new = f(xx)
|
|
229
|
+
vars['HEIGHT'][i, :] = yy_new
|
|
230
|
+
|
|
231
|
+
yy = vars['RANGE'][i, :].flatten()
|
|
232
|
+
iii = np.where(~np.isfinite(yy))
|
|
233
|
+
if not list(iii):
|
|
234
|
+
continue
|
|
235
|
+
iii = np.where(np.isfinite(yy))[0]
|
|
236
|
+
xx = np.arange(0, n)
|
|
237
|
+
f = si.interp1d(xx[iii], yy[iii], kind='linear', bounds_error=False, fill_value='extrapolate')
|
|
238
|
+
yy_new = f(xx)
|
|
239
|
+
vars['RANGE'][i, :] = yy_new
|
|
219
240
|
|
|
220
241
|
if np.isscalar(vars['AZ']):
|
|
221
242
|
az = np.empty((vars['DATETIME_1'].shape[0], 1))
|
|
@@ -336,8 +357,12 @@ class Loader:
|
|
|
336
357
|
inds_ran_max = np.append(inds_ran_max, len(ran)-1)
|
|
337
358
|
inds_ran_max.sort()
|
|
338
359
|
|
|
339
|
-
|
|
340
|
-
|
|
360
|
+
if self.gate_num is None:
|
|
361
|
+
self.gate_num = ngates_max = np.max(np.diff(inds_ran_max))
|
|
362
|
+
else:
|
|
363
|
+
ngates_max = self.gate_num
|
|
364
|
+
num_row = inds_ran_min.shape[0]
|
|
365
|
+
data_array = np.empty((nvar_h5, num_row, ngates_max))
|
|
341
366
|
data_array[::] = np.nan
|
|
342
367
|
for ip in range(nvar_h5):
|
|
343
368
|
var_tmp = np.array(data[ip])
|
|
@@ -345,7 +370,7 @@ class Loader:
|
|
|
345
370
|
ind1 = inds_ran_min[i]
|
|
346
371
|
ind2 = inds_ran_max[i]
|
|
347
372
|
data_array[ip, i, 0: ind2-ind1+1] = var_tmp[ind1: ind2+1]
|
|
348
|
-
|
|
373
|
+
|
|
349
374
|
vars_h5 = {}
|
|
350
375
|
for ip in range(nvar_h5):
|
|
351
376
|
|
|
@@ -382,21 +407,31 @@ class Loader:
|
|
|
382
407
|
vars['T_e_err'] = vars['T_e'] * np.sqrt((vars['T_i_err'] / vars['T_i']) ** 2
|
|
383
408
|
+ (vars['T_r_err'] / vars['T_r']) ** 2)
|
|
384
409
|
vars['AZ'] = vars['AZ'] % 360.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
410
|
+
|
|
411
|
+
inds_nan = np.where(np.isnan(vars['HEIGHT']))
|
|
412
|
+
if list(inds_nan):
|
|
413
|
+
m, n = vars['HEIGHT'].shape
|
|
414
|
+
for i in range(m):
|
|
415
|
+
yy = vars['HEIGHT'][i, :].flatten()
|
|
416
|
+
iii = np.where(~np.isfinite(yy))
|
|
417
|
+
if not list(iii):
|
|
418
|
+
continue
|
|
419
|
+
iii = np.where(np.isfinite(yy))[0]
|
|
420
|
+
xx = np.arange(0, n)
|
|
421
|
+
f = si.interp1d(xx[iii], yy[iii], kind='linear', bounds_error=False, fill_value='extrapolate')
|
|
422
|
+
yy_new = f(xx)
|
|
423
|
+
vars['HEIGHT'][i, :] = yy_new
|
|
424
|
+
|
|
425
|
+
yy = vars['RANGE'][i, :].flatten()
|
|
426
|
+
iii = np.where(~np.isfinite(yy))
|
|
427
|
+
if not list(iii):
|
|
428
|
+
continue
|
|
429
|
+
iii = np.where(np.isfinite(yy))[0]
|
|
430
|
+
xx = np.arange(0, n)
|
|
431
|
+
f = si.interp1d(xx[iii], yy[iii], kind='linear', bounds_error=False, fill_value='extrapolate')
|
|
432
|
+
yy_new = f(xx)
|
|
433
|
+
vars['RANGE'][i, :] = yy_new
|
|
434
|
+
|
|
400
435
|
|
|
401
436
|
self.variables = vars
|
|
402
437
|
self.metadata = metadata
|
|
@@ -10,9 +10,11 @@ __docformat__ = "reStructureText"
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
import numpy
|
|
13
|
-
|
|
13
|
+
import numpy as np
|
|
14
|
+
from scipy.interpolate import interp1d, griddata
|
|
14
15
|
import geospacelab.toolbox.utilities.pydatetime as dttool
|
|
15
16
|
import geospacelab.toolbox.utilities.pybasic as basic
|
|
17
|
+
import geospacelab.toolbox.utilities.pylogging as mylog
|
|
16
18
|
import datetime
|
|
17
19
|
|
|
18
20
|
|
|
@@ -133,6 +135,140 @@ def data_resample(
|
|
|
133
135
|
|
|
134
136
|
return xnew, ynew
|
|
135
137
|
|
|
138
|
+
# def resample_2d(
|
|
139
|
+
# x_data, y_data, z_data,
|
|
140
|
+
# x_data_type=None,
|
|
141
|
+
# x_data_res=None,
|
|
142
|
+
# x_data_res_scale=1.,
|
|
143
|
+
# x_grid_res=None,
|
|
144
|
+
# x_grid_res_scale=1,
|
|
145
|
+
# x_grid_min=None,
|
|
146
|
+
# x_grid_max=None,
|
|
147
|
+
# along_x_interp=True,
|
|
148
|
+
# along_x_interp_method='nearest',
|
|
149
|
+
# along_x_binning=False,
|
|
150
|
+
# y_data_res=None,
|
|
151
|
+
# y_data_res_scale=1.,
|
|
152
|
+
# y_grid_res=None,
|
|
153
|
+
# y_grid_res_scale=1.,
|
|
154
|
+
# y_grid_min=None,
|
|
155
|
+
# y_grid_max=None,
|
|
156
|
+
# along_y_interp=True,
|
|
157
|
+
# along_y_interp_method='nearest',
|
|
158
|
+
# along_y_binning=False,
|
|
159
|
+
# ):
|
|
160
|
+
# if along_x_interp==True and along_x_binning==True:
|
|
161
|
+
# mylog.StreamLogger.error('The keywords "along_x_interp" and "along_x_binning" cannot be True at the same time!')
|
|
162
|
+
# raise ValueError
|
|
163
|
+
# if along_y_interp==True and along_y_binning==True:
|
|
164
|
+
# mylog.StreamLogger.error('The keywords "along_y_interp" and "along_y_binning" cannot be True at the same time!')
|
|
165
|
+
# raise ValueError
|
|
166
|
+
#
|
|
167
|
+
# num_x, num_y = z_data.shape
|
|
168
|
+
# if x_data_type == 'datetime':
|
|
169
|
+
# dt0 = dttool.get_start_of_the_day(numpy.nanmin(x_data.flatten()))
|
|
170
|
+
# sectime, dt0 = dttool.convert_datetime_to_sectime(x_data, dt0=dt0)
|
|
171
|
+
# x_data = sectime
|
|
172
|
+
#
|
|
173
|
+
# # check x dim:
|
|
174
|
+
# if len(x_data.shape) == 1:
|
|
175
|
+
# x_dim = 1
|
|
176
|
+
# elif len(x_data.shape) == 2:
|
|
177
|
+
# if x_data.shape[1] == num_y:
|
|
178
|
+
# x_dim = 2
|
|
179
|
+
# else:
|
|
180
|
+
# x_dim = 1
|
|
181
|
+
# else:
|
|
182
|
+
# raise ValueError
|
|
183
|
+
# if x_dim == 1:
|
|
184
|
+
# xd = np.tile(x_data.flatten(), (1, num_y))
|
|
185
|
+
# else:
|
|
186
|
+
# xd = x_data
|
|
187
|
+
# min_x = np.nanmin(xd.flatten())
|
|
188
|
+
# max_x = np.nanmax(xd.flatten())
|
|
189
|
+
# # check y dim:
|
|
190
|
+
# if len(y_data.shape) == 1:
|
|
191
|
+
# y_dim = 1
|
|
192
|
+
# elif len(y_data.shape) == 2:
|
|
193
|
+
# if y_data.shape[1] == num_y:
|
|
194
|
+
# y_dim = 2
|
|
195
|
+
# else:
|
|
196
|
+
# y_dim = 1
|
|
197
|
+
# else:
|
|
198
|
+
# raise ValueError
|
|
199
|
+
# if y_dim == 1:
|
|
200
|
+
# yd = np.tile(x_data.flatten(), (num_x, 1))
|
|
201
|
+
# else:
|
|
202
|
+
# yd = y_data
|
|
203
|
+
# min_y = np.nanmin(yd.flatten())
|
|
204
|
+
# max_y = np.nanmax(yd.flatten())
|
|
205
|
+
#
|
|
206
|
+
# if x_data_res is None:
|
|
207
|
+
# x_data_res_ = np.median(np.diff(xd[:, 0].flatten()))
|
|
208
|
+
# else:
|
|
209
|
+
# x_data_res_ = x_data_res
|
|
210
|
+
# if y_data_res is None:
|
|
211
|
+
# y_data_res_ = np.median(np.diff(yd[0, :].flatten()))
|
|
212
|
+
# else:
|
|
213
|
+
# y_data_res_ = y_data_res
|
|
214
|
+
#
|
|
215
|
+
# if x_grid_res is None:
|
|
216
|
+
# xx = xd[:, 0].flatten()
|
|
217
|
+
# # along_x_interp=False
|
|
218
|
+
# # along_x_binning=False
|
|
219
|
+
# # x_grid_res=x_data_res
|
|
220
|
+
# else:
|
|
221
|
+
# if x_grid_min is None:
|
|
222
|
+
# x_grid_min = np.floor((min_x / x_grid_res)) * x_grid_res
|
|
223
|
+
# if x_grid_max is None:
|
|
224
|
+
# x_grid_max = np.ceil((max_x / x_grid_res)) * x_grid_res
|
|
225
|
+
# xx = np.arange(x_grid_min, x_grid_max+x_grid_res, x_grid_res)
|
|
226
|
+
# if y_grid_res is None:
|
|
227
|
+
# yy = yd[0, :].flatten()
|
|
228
|
+
# # along_y_interp=False
|
|
229
|
+
# # along_y_binning=False
|
|
230
|
+
# # y_grid_res=y_data_res
|
|
231
|
+
# else:
|
|
232
|
+
# if y_grid_min is None:
|
|
233
|
+
# y_grid_min = np.floor((min_y / y_grid_res)) * y_grid_res
|
|
234
|
+
# if y_grid_max is None:
|
|
235
|
+
# y_grid_max = np.ceil((max_y / y_grid_res)) * y_grid_res
|
|
236
|
+
# yy = np.arange(y_grid_min, y_grid_max+y_grid_res, y_grid_res)
|
|
237
|
+
#
|
|
238
|
+
# grid_x, grid_y = numpy.meshgrid(xx,yy)
|
|
239
|
+
# grid_z = np.empty_like(grid_x)
|
|
240
|
+
# grid_z[::] = np.nan
|
|
241
|
+
#
|
|
242
|
+
# if along_y_interp:
|
|
243
|
+
# grid_x_1 = np.empty_like((num_x, grid_z.shape[1])) * np.nan
|
|
244
|
+
# grid_y_1 = np.empty_like((num_x, grid_z.shape[1])) * np.nan
|
|
245
|
+
# grid_z_1 = np.empty_like((num_x, grid_z.shape[1])) * np.nan
|
|
246
|
+
# for i in range(num_x):
|
|
247
|
+
# x1 = xd[i, :].flatten()
|
|
248
|
+
# y1 = yd[i, :].flatten()
|
|
249
|
+
# z1 = z_data[i, :].flatten()
|
|
250
|
+
#
|
|
251
|
+
# inds_finite = np.where(np.isfinite(x1) & np.isfinite(y1) & np.isfinite(z1))[0]
|
|
252
|
+
# if not list(inds_finite):
|
|
253
|
+
# continue
|
|
254
|
+
#
|
|
255
|
+
# f = interp1d(y1[inds_finite], x1[inds_finite],
|
|
256
|
+
# kind='nearest', bounds_error=False, fill_value=np.nan)
|
|
257
|
+
# x_i = f(grid_y[i, :].flatten())
|
|
258
|
+
# grid_x_1[i, :] = x_i
|
|
259
|
+
#
|
|
260
|
+
# f = interp1d(y1[inds_finite], y1[inds_finite],
|
|
261
|
+
# kind='nearest', bounds_error=False, fill_value=np.nan)
|
|
262
|
+
# y_i = f(grid_y[i, :].flatten())
|
|
263
|
+
# grid_y_1[i, :] = y_i
|
|
264
|
+
#
|
|
265
|
+
# f = interp1d(
|
|
266
|
+
# y1[inds_finite], z1[inds_finite],
|
|
267
|
+
# kind=along_y_interp_method, bounds_error=False, fill_value=np.nan)
|
|
268
|
+
# z_i = f(grid_y[i, :].flatten())
|
|
269
|
+
#
|
|
270
|
+
# grid_z_1[i, :] = z_i
|
|
271
|
+
|
|
136
272
|
|
|
137
273
|
def regridding_2d_xgaps(
|
|
138
274
|
x, y, z,
|
|
@@ -736,6 +736,7 @@ class TSPanel(Panel):
|
|
|
736
736
|
time_gap = var.visual.axis[0].mask_gap
|
|
737
737
|
if time_gap is None:
|
|
738
738
|
time_gap = self.time_gap
|
|
739
|
+
y_data = self._check_ydata(y_data)
|
|
739
740
|
if time_gap:
|
|
740
741
|
# x, y, z = arraytool.data_resample_2d(
|
|
741
742
|
# x=x_data, y=y_data, z=z_data, xtype='datetime', xres=x_data_res, method='Null', axis=0)
|
|
@@ -748,6 +749,21 @@ class TSPanel(Panel):
|
|
|
748
749
|
data = {'x': x, 'y': y, 'z': z}
|
|
749
750
|
return data
|
|
750
751
|
|
|
752
|
+
def _check_ydata(self, ydata):
|
|
753
|
+
inds_infinite = np.where(~np.isfinite(ydata))
|
|
754
|
+
if list(inds_infinite):
|
|
755
|
+
m, n = ydata.shape
|
|
756
|
+
for i in range(m):
|
|
757
|
+
yy = ydata[i, :].flatten()
|
|
758
|
+
iii = np.where(~np.isfinite(yy))
|
|
759
|
+
if not list(iii):
|
|
760
|
+
continue
|
|
761
|
+
iii = np.where(np.isfinite(yy))[0]
|
|
762
|
+
xx = np.arange(0, n)
|
|
763
|
+
f = interp1d(xx[iii], yy[iii], kind='linear', bounds_error=False, fill_value='extrapolate')
|
|
764
|
+
yy_new = f(xx)
|
|
765
|
+
ydata[i, :] = yy_new
|
|
766
|
+
return ydata
|
|
751
767
|
@staticmethod
|
|
752
768
|
def generate_label(label: str, unit: str='', style: str='double'):
|
|
753
769
|
label = label
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
geospacelab/__init__.py,sha256=
|
|
1
|
+
geospacelab/__init__.py,sha256=WJ8ufBQkkLmA82dBWYhytuVhAn5QyilSUAqrx2Jm2p8,801
|
|
2
2
|
geospacelab/config/__init__.py,sha256=D5A0ORTubSaLEXGqPmg-mLH_KNqINicOeeNFqkGpXrk,641
|
|
3
3
|
geospacelab/config/_preferences.py,sha256=DakPjKJQ0VRe2Mgc8bakw585u4N8qVqYYvqnoLdyvH4,4726
|
|
4
4
|
geospacelab/coords/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -154,9 +154,9 @@ geospacelab/datahub/sources/madrigal/gnss/tecmap/downloader.py,sha256=9Z4zZm-xNS
|
|
|
154
154
|
geospacelab/datahub/sources/madrigal/gnss/tecmap/loader.py,sha256=JytJZfzUp2ijn0w1ADoA5-aRP1c674T4wz0mRSFSvPg,2895
|
|
155
155
|
geospacelab/datahub/sources/madrigal/gnss/tecmap/variable_config.py,sha256=d-1XeMMZOyYFQAOYjPwIS2USBY9B8YjRfIww1TowVqE,1517
|
|
156
156
|
geospacelab/datahub/sources/madrigal/isr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
157
|
-
geospacelab/datahub/sources/madrigal/isr/eiscat/__init__.py,sha256=
|
|
158
|
-
geospacelab/datahub/sources/madrigal/isr/eiscat/downloader.py,sha256=
|
|
159
|
-
geospacelab/datahub/sources/madrigal/isr/eiscat/loader.py,sha256=
|
|
157
|
+
geospacelab/datahub/sources/madrigal/isr/eiscat/__init__.py,sha256=sxHcvgMy_Kjnl9TppU-jVw7yPoPtUZwxsieuCOBr2aY,20413
|
|
158
|
+
geospacelab/datahub/sources/madrigal/isr/eiscat/downloader.py,sha256=d-oUtCh8NHbkmEKfbe1oGb0-DzZsQH0CQXAedncMfTU,26144
|
|
159
|
+
geospacelab/datahub/sources/madrigal/isr/eiscat/loader.py,sha256=GHcEDY7YuEb0LfofdEk6_WhQ7qdpV_DvsTIk-6LZyTk,17909
|
|
160
160
|
geospacelab/datahub/sources/madrigal/isr/eiscat/utilities.py,sha256=TImaJSVDyqvXezSCTAzMgAQ7CmrgD5YjyUiRl-K_dWk,2514
|
|
161
161
|
geospacelab/datahub/sources/madrigal/isr/eiscat/variable_config.py,sha256=Lny8eVbtE7wxcYtRcfUrVDY6vkzfxD5hb29mc3ytENI,9153
|
|
162
162
|
geospacelab/datahub/sources/madrigal/isr/eiscat/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -320,7 +320,7 @@ geospacelab/toolbox/io/__init__.py,sha256=YcFkmOGWXNiOXWsMFxFPhn32UnbxmeSrluTp6O
|
|
|
320
320
|
geospacelab/toolbox/io/dialog.py,sha256=y87PKCXQS5_axbrNuVrcYN2uIfr-ZHICr7yMQ0yH1M4,1067
|
|
321
321
|
geospacelab/toolbox/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
322
322
|
geospacelab/toolbox/utilities/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
323
|
-
geospacelab/toolbox/utilities/numpyarray.py,sha256=
|
|
323
|
+
geospacelab/toolbox/utilities/numpyarray.py,sha256=olclT06DRPFSYaEdiD1uqwHvM0vHNDFjkLstck6_clE,11862
|
|
324
324
|
geospacelab/toolbox/utilities/numpymath.py,sha256=xr-u9vsN5UMZ6pjomJ2O3A1n00Eg3yH5fN4lcY7rR_Q,3810
|
|
325
325
|
geospacelab/toolbox/utilities/pybasic.py,sha256=-wLWoQMTroJ49nn8H_-hsFxDSiHXMiea86U6u0W8_cM,3310
|
|
326
326
|
geospacelab/toolbox/utilities/pyclass.py,sha256=DnnzLH1ovlxArtqCpywZUfDoNzYi7HmMW2s17Xd30LI,2813
|
|
@@ -341,7 +341,7 @@ geospacelab/visualization/mpl/axis_ticks.py,sha256=vkS7eqSop5MNsxZ8l3EqdJEW7obF7
|
|
|
341
341
|
geospacelab/visualization/mpl/colormaps.py,sha256=o4NfZPZK29Lefc4Jw-9OAN5VveqLuEEHKbP3JjUFSFI,17685
|
|
342
342
|
geospacelab/visualization/mpl/dashboards.py,sha256=jk8W_j1SzCfUUYeTm5e7uA3xjlXpUIINdJPmBc53t-E,17232
|
|
343
343
|
geospacelab/visualization/mpl/figure.py,sha256=stHgAG_qH-b87-rIXBfFnG9p3cyD2oDnx3MA6kDgX3A,3335
|
|
344
|
-
geospacelab/visualization/mpl/panels.py,sha256=
|
|
344
|
+
geospacelab/visualization/mpl/panels.py,sha256=uYC18Nxk_WjAJmv827D89znY9sqSSsDRAE23wG8c6xc,35817
|
|
345
345
|
geospacelab/visualization/mpl/ts_viewer.py,sha256=4sOwXeWkdn5Z0BA6c-zxj4dAYxHP9tbuFwsbuJz4_ag,67416
|
|
346
346
|
geospacelab/visualization/mpl/geomap/__base__.py,sha256=v3lVV5NVQMi0csNxq1ioORyizULqGN92M0DrlGjjBRQ,2940
|
|
347
347
|
geospacelab/visualization/mpl/geomap/__init__.py,sha256=lsCyNIg5d5ZiMyRvE1zIuCnIhL47x8aYbOKZUX5E8fE,327
|
|
@@ -371,7 +371,7 @@ geospacelab/wrapper/geopack/geopack/t89.py,sha256=zDVNPrmtK1NnNHgohQEPqOOJDsm2Z-
|
|
|
371
371
|
geospacelab/wrapper/geopack/geopack/t96.py,sha256=ktcoo1R7Z3NtkWHENuseu48ub4-JfQGqFV0ZOtd0zH8,65292
|
|
372
372
|
geospacelab/wrapper/geopack/geopack/test_geopack1.md,sha256=dMUY0O1BgZsKpmJ6BLSQ80B6p6DZcB7OceFeyPOlFK0,15324
|
|
373
373
|
geospacelab/wrapper/geopack/geopack/test_geopack1.py,sha256=qjLz6O3BAk3H58IpmxXyftwZTkh3vPGp49C-al4hjf0,6669
|
|
374
|
-
geospacelab-0.10.
|
|
374
|
+
geospacelab-0.10.1.dist-info/licenses/LICENSE,sha256=2yRlwLt4o5Z6OZAGcyvBj-zfFX1Uw7E6CzqODg7khqs,1515
|
|
375
375
|
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
376
376
|
test/test_ampere.py,sha256=0-HZURubpv1mBK3bJ_qTqx39L1jezgRoU5neXMPYgZQ,2968
|
|
377
377
|
test/test_dmsp_s1.py,sha256=5m_7mjdDGja8ovshNPV3LKW_6q6mIwT9XKqoyRiH79A,3588
|
|
@@ -381,7 +381,7 @@ test/test_omni.py,sha256=Zk1LZozPiY5V0aSRmK6GTQuB01hHn_j2j3Brm6Ea_po,1632
|
|
|
381
381
|
test/test_superdarn.py,sha256=uP55muvXryPzNGHinWkiGv2PxvRs4f9M9h1WIBEBW7k,2846
|
|
382
382
|
test/test_swarm.py,sha256=PDDE9nUshhQpXZbV_ZwcsjbMhI73fRaojTZv9rtRzZE,15568
|
|
383
383
|
test/test_swarm_new.py,sha256=mzhMAx-M9W3Ue5noTyfBx4c3Vtc3b_ZUEvGgL9v8UE4,853
|
|
384
|
-
geospacelab-0.10.
|
|
385
|
-
geospacelab-0.10.
|
|
386
|
-
geospacelab-0.10.
|
|
387
|
-
geospacelab-0.10.
|
|
384
|
+
geospacelab-0.10.1.dist-info/METADATA,sha256=741bKhyehSFn8wPCQzWzhINXfDbMhR6dBEEn_rUxK6g,24337
|
|
385
|
+
geospacelab-0.10.1.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
|
|
386
|
+
geospacelab-0.10.1.dist-info/top_level.txt,sha256=98eDwrSNgyQFAtSA06QMP71gw9BzgIj0uvkTudpGly4,12
|
|
387
|
+
geospacelab-0.10.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|