vidavis 0.1.4__tar.gz → 0.1.5__tar.gz
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.
- {vidavis-0.1.4 → vidavis-0.1.5}/PKG-INFO +1 -1
- {vidavis-0.1.4 → vidavis-0.1.5}/pyproject.toml +1 -1
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/apps/_ms_raster.py +7 -6
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_ms_plot.py +19 -14
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_ms_plot_selectors.py +2 -1
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_raster_plot.py +47 -47
- {vidavis-0.1.4 → vidavis-0.1.5}/LICENSE +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/readme.rst +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/LICENSE.rst +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/apps/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/bokeh/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/bokeh/_palette.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/_ms_data.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_concat.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_coords.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_data.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_io.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_raster_data.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_select.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_stats.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_xds_data.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_check_raster_inputs.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_locate_points.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_ms_plot_constants.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_plot_inputs.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_raster_plot_gui.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_raster_plot_inputs.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_time_ticks.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/plot/ms_plot/_xds_plot_axes.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/toolbox/__init__.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/toolbox/_app_context.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/toolbox/_logging.py +0 -0
- {vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/toolbox/_static.py +0 -0
|
@@ -579,17 +579,18 @@ class MsRaster(MsPlot):
|
|
|
579
579
|
return self._empty_plot
|
|
580
580
|
|
|
581
581
|
def _create_empty_plot(self):
|
|
582
|
-
''' Create empty Overlay plot for DynamicMap with colormap params
|
|
582
|
+
''' Create empty Overlay plot for DynamicMap with colormap params enabled '''
|
|
583
583
|
plot_params = self._raster_plot.get_plot_params()
|
|
584
584
|
self._empty_plot = hv.Overlay(
|
|
585
585
|
hv.QuadMesh([]).opts(
|
|
586
|
-
colorbar=plot_params['style']['show_flagged_colorbar'],
|
|
587
|
-
cmap=plot_params['style']['flagged_cmap'],
|
|
588
|
-
responsive=True,
|
|
589
|
-
) * hv.QuadMesh([]).opts(
|
|
590
586
|
colorbar=plot_params['style']['show_colorbar'],
|
|
591
|
-
colorbar_position='left',
|
|
592
587
|
cmap=plot_params['style']['unflagged_cmap'],
|
|
588
|
+
colorbar_position='left',
|
|
589
|
+
responsive=True,
|
|
590
|
+
) * hv.QuadMesh([]).opts(
|
|
591
|
+
colorbar=plot_params['style']['show_flagged_colorbar'],
|
|
592
|
+
colorbar_position='right',
|
|
593
|
+
cmap=plot_params['style']['flagged_cmap'],
|
|
593
594
|
responsive=True,
|
|
594
595
|
)
|
|
595
596
|
)
|
|
@@ -75,7 +75,6 @@ class MsPlot:
|
|
|
75
75
|
self._last_points = None
|
|
76
76
|
self._last_boxes = None
|
|
77
77
|
self._locate_plot_options = {
|
|
78
|
-
'tools': ['hover'],
|
|
79
78
|
'muted_alpha': 0,
|
|
80
79
|
'selection_fill_alpha': 0.2, # dim selected areas of plot
|
|
81
80
|
'nonselection_fill_alpha': 1.0, # do not dim unselected areas of plot
|
|
@@ -463,12 +462,14 @@ class MsPlot:
|
|
|
463
462
|
x = get_locate_value(plot_data, plot_axes[0], x)
|
|
464
463
|
y = get_locate_value(plot_data, plot_axes[1], y)
|
|
465
464
|
cursor = (x, y)
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
465
|
+
|
|
466
|
+
if not data_changed(cursor, self._last_cursor):
|
|
467
|
+
return False
|
|
468
|
+
|
|
469
|
+
# new cursor position - update cursor location box
|
|
470
|
+
update_cursor_location(cursor, plot_axes, plot_data, cursor_box)
|
|
471
|
+
self._last_cursor = cursor
|
|
472
|
+
return True
|
|
472
473
|
|
|
473
474
|
def _locate_points(self, point_data, plot_data, points_tab):
|
|
474
475
|
''' Show points locations from point_draw tool '''
|
|
@@ -489,12 +490,14 @@ class MsPlot:
|
|
|
489
490
|
points_to_locate = get_new_data(data_points, self._last_points)
|
|
490
491
|
self._last_points = data_points
|
|
491
492
|
|
|
493
|
+
if not points_to_locate: # point deleted
|
|
494
|
+
return False
|
|
495
|
+
|
|
492
496
|
if len(points_to_locate) == len(data_points):
|
|
493
497
|
points_tab.clear() # clear for locating all points
|
|
494
498
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
self._log_to_file_only(location_info)
|
|
499
|
+
location_info = update_points_location(points_to_locate, self._get_plot_axes(), plot_data, points_tab)
|
|
500
|
+
self._log_to_file_only(location_info)
|
|
498
501
|
return True
|
|
499
502
|
|
|
500
503
|
def _locate_boxes(self, boxes, plot_data, box_tab):
|
|
@@ -520,10 +523,12 @@ class MsPlot:
|
|
|
520
523
|
boxes_to_locate = get_new_data(box_list, self._last_boxes)
|
|
521
524
|
self._last_boxes = box_list
|
|
522
525
|
|
|
523
|
-
if boxes_to_locate:
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
if not boxes_to_locate: # box deleted
|
|
527
|
+
return False
|
|
528
|
+
|
|
529
|
+
box_tab.clear()
|
|
530
|
+
location_info = update_boxes_location(boxes_to_locate, self._get_plot_axes(), plot_data, box_tab)
|
|
531
|
+
self._log_to_file_only(location_info)
|
|
527
532
|
return True
|
|
528
533
|
|
|
529
534
|
def _log_to_file_only(self, messages):
|
|
@@ -80,7 +80,8 @@ def style_selector(style_callback, color_range_callback):
|
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
color_range_slider = pn.widgets.RangeSlider(
|
|
83
|
-
name="
|
|
83
|
+
name="Set manual color range",
|
|
84
|
+
align=('start', 'end'), # (horizontal, vertical) to place left (h=start) and bottom (v=end)
|
|
84
85
|
)
|
|
85
86
|
|
|
86
87
|
select_color_range = pn.bind(color_range_callback, color_mode_selector, color_range_slider)
|
|
@@ -95,31 +95,31 @@ class RasterPlot:
|
|
|
95
95
|
return None
|
|
96
96
|
|
|
97
97
|
data_params = self._plot_params['data']
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
x_axis = plot_params['axis_labels']['x']['axis']
|
|
101
|
-
y_axis = plot_params['axis_labels']['y']['axis']
|
|
102
|
-
c_axis = plot_params['axis_labels']['c']['axis']
|
|
103
|
-
|
|
104
|
-
# Set plot axes to numeric coordinates if needed
|
|
105
|
-
xds = set_index_coordinates(data, (x_axis, y_axis))
|
|
98
|
+
axis_labels = self._plot_params['plot']['axis_labels']
|
|
106
99
|
|
|
107
100
|
# Prefix c_axis name with aggregator
|
|
108
|
-
xda_name =
|
|
101
|
+
xda_name = axis_labels['c']['axis']
|
|
109
102
|
if data_params['aggregator']:
|
|
110
103
|
xda_name = "_".join([data_params['aggregator'], xda_name])
|
|
111
104
|
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
# Set plot axes to numeric coordinates if needed
|
|
106
|
+
xds = set_index_coordinates(data, (axis_labels['x']['axis'], axis_labels['y']['axis']))
|
|
107
|
+
xda = xds[data_params['correlated_data']].rename(xda_name)
|
|
108
|
+
|
|
109
|
+
# Calculate data range for flagged and unflagged data for color limits
|
|
110
|
+
unflagged_xda = xda.where(xds.FLAG == 0.0)
|
|
111
|
+
flagged_xda = xda.where(xds.FLAG == 1.0).rename("flagged " + xda_name)
|
|
112
|
+
unflagged_data_range = (unflagged_xda.min().values.item(), unflagged_xda.max().values.item())
|
|
113
|
+
flagged_data_range = (flagged_xda.min().values.item(), flagged_xda.max().values.item())
|
|
118
114
|
if is_gui: # update data range for colorbar
|
|
119
|
-
self._plot_params['data']['data_range'] =
|
|
115
|
+
self._plot_params['data']['data_range'] = unflagged_data_range
|
|
116
|
+
|
|
117
|
+
# Plot all data as unflagged (with hover tool), then overlay flagged data
|
|
118
|
+
unflagged_plot = self._plot_xda(xda, False, unflagged_data_range)
|
|
119
|
+
flagged_plot = self._plot_xda(flagged_xda, True, flagged_data_range)
|
|
120
120
|
|
|
121
121
|
# Make Overlay plot
|
|
122
|
-
return
|
|
122
|
+
return unflagged_plot.opts(tools=['hover']) * flagged_plot.opts(tools=[])
|
|
123
123
|
|
|
124
124
|
def _get_plot_title(self, data, plot_inputs, ms_name):
|
|
125
125
|
''' Form string containing ms name and selected values using data (xArray Dataset) '''
|
|
@@ -172,34 +172,34 @@ class RasterPlot:
|
|
|
172
172
|
self._plot_params['plot']['axis_labels'][axis]['label'] = axis_labels[1]
|
|
173
173
|
self._plot_params['plot']['axis_labels'][axis]['ticks'] = axis_labels[2]
|
|
174
174
|
|
|
175
|
-
def _plot_xda(self, xda, is_flagged=False):
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
def _plot_xda(self, xda, is_flagged=False, data_range=None):
|
|
176
|
+
''' Return Quadmesh plot if raster 2D data, Scatter plot if raster 1D data, or None if no data '''
|
|
177
|
+
# Color limits
|
|
178
|
+
c_lim = self._plot_params['plot']['color_limits']
|
|
179
|
+
c_lim = data_range if c_lim is None else c_lim
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
axis_labels = self._plot_params['plot']['axis_labels']
|
|
182
|
+
x_axis = axis_labels['x']['axis']
|
|
183
|
+
y_axis = axis_labels['y']['axis']
|
|
184
|
+
c_label = axis_labels['c']['label']
|
|
184
185
|
|
|
186
|
+
# Set time formatter
|
|
185
187
|
x_formatter = get_time_formatter() if x_axis == 'time' else None
|
|
186
188
|
y_formatter = get_time_formatter() if y_axis == 'time' else None
|
|
187
189
|
|
|
190
|
+
# Show colorbar
|
|
191
|
+
show_colorbar = False
|
|
188
192
|
if xda.count().values > 0:
|
|
189
|
-
if is_flagged
|
|
190
|
-
show_colorbar = style_params['show_flagged_colorbar']
|
|
191
|
-
else :
|
|
192
|
-
show_colorbar = style_params['show_colorbar']
|
|
193
|
-
else:
|
|
194
|
-
show_colorbar = False
|
|
193
|
+
show_colorbar = self._plot_params['style']['show_flagged_colorbar'] if is_flagged else self._plot_params['style']['show_colorbar']
|
|
195
194
|
|
|
195
|
+
# Set colorbar label and map
|
|
196
196
|
if is_flagged:
|
|
197
197
|
c_label = "Flagged " + c_label
|
|
198
|
-
colormap =
|
|
199
|
-
|
|
198
|
+
colormap = self._plot_params['style']['flagged_cmap']
|
|
199
|
+
self._plot_params['plot']['flagged_colorbar'] = show_colorbar
|
|
200
200
|
else:
|
|
201
|
-
colormap =
|
|
202
|
-
|
|
201
|
+
colormap = self._plot_params['style']['unflagged_cmap']
|
|
202
|
+
self._plot_params['plot']['unflagged_colorbar'] = show_colorbar
|
|
203
203
|
|
|
204
204
|
if xda[x_axis].size > 1 and xda[y_axis].size > 1:
|
|
205
205
|
# Raster 2D data
|
|
@@ -209,16 +209,16 @@ class RasterPlot:
|
|
|
209
209
|
clim=c_lim,
|
|
210
210
|
cmap=colormap,
|
|
211
211
|
clabel=c_label,
|
|
212
|
-
title=
|
|
213
|
-
xlabel=
|
|
214
|
-
ylabel=
|
|
212
|
+
title=self._plot_params['plot']['title'],
|
|
213
|
+
xlabel=axis_labels['x']['label'],
|
|
214
|
+
ylabel=axis_labels['y']['label'],
|
|
215
215
|
xformatter=x_formatter,
|
|
216
216
|
yformatter=y_formatter,
|
|
217
|
-
xticks=
|
|
218
|
-
yticks=
|
|
217
|
+
xticks=axis_labels['x']['ticks'],
|
|
218
|
+
yticks=axis_labels['y']['ticks'],
|
|
219
219
|
rot=45, # angle for x axis labels
|
|
220
220
|
colorbar=show_colorbar,
|
|
221
|
-
responsive=True, # resize to fill browser window
|
|
221
|
+
responsive=True, # resize to fill browser window
|
|
222
222
|
)
|
|
223
223
|
else:
|
|
224
224
|
# Cannot raster 1D data, use scatter from pandas dataframe
|
|
@@ -227,16 +227,16 @@ class RasterPlot:
|
|
|
227
227
|
x=x_axis,
|
|
228
228
|
y=y_axis,
|
|
229
229
|
c=xda.name,
|
|
230
|
-
clim=
|
|
230
|
+
clim=c_lim,
|
|
231
231
|
cmap=colormap,
|
|
232
232
|
clabel=c_label,
|
|
233
|
-
title=
|
|
234
|
-
xlabel=
|
|
235
|
-
ylabel=
|
|
233
|
+
title=self._plot_params['plot']['title'],
|
|
234
|
+
xlabel=axis_labels['x']['label'],
|
|
235
|
+
ylabel=axis_labels['y']['label'],
|
|
236
236
|
xformatter=x_formatter,
|
|
237
237
|
yformatter=y_formatter,
|
|
238
|
-
xticks=
|
|
239
|
-
yticks=
|
|
238
|
+
xticks=axis_labels['x']['ticks'],
|
|
239
|
+
yticks=axis_labels['y']['ticks'],
|
|
240
240
|
rot=45,
|
|
241
241
|
marker='s', # square
|
|
242
242
|
responsive=True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_concat.py
RENAMED
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_coords.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_raster_data.py
RENAMED
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_select.py
RENAMED
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_ps_stats.py
RENAMED
|
File without changes
|
{vidavis-0.1.4 → vidavis-0.1.5}/src/vidavis/data/measurement_set/processing_set/_xds_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|