Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#print("total amplit")
self.plot_density(axes, amplitude, amplitude_selection, stack_image)
if len(all_axes) > 2:
other_axis = all_axes[0]
assert len(all_axes) == 1, ">3d not supported"
else:
other_axis = 2
if vector_grids:
#vector_grids[vector_grids==np.inf] = np.nan
U = vector_grids[axes.xaxis_index]
V = vector_grids[axes.yaxis_index]
W = vector_grids[other_axis]
vx = None if U is None else vaex.utils.multisum(U, all_axes)
vy = None if V is None else vaex.utils.multisum(V, all_axes)
vz = None if W is None else vaex.utils.multisum(W, all_axes)
vector_counts_2d = vaex.utils.multisum(vector_counts, all_axes)
if vx is not None and vy is not None:
count_max = vector_counts_2d.max()
mask = (vector_counts_2d > (self.vector_level_min * count_max)) & \
(vector_counts_2d <= (self.vector_level_max * count_max))
x = vector_positions[axes.xaxis_index]
y = vector_positions[axes.yaxis_index]
x2d, y2d = np.meshgrid(x, y)
#x2d, y2d = x2d.T, y2d.T
#mask = mask.T
colors, colormap = None, None
if True:
if self.vector_auto_scale:
length = np.nanmean(np.sqrt(vx[mask]**2 + vy[mask]**2))# / 1.5
logger.debug("auto scaling using length: %r", length)
self.plot_density(axes, amplitude, amplitude_selection, stack_image)
if len(all_axes) > 2:
other_axis = all_axes[0]
assert len(all_axes) == 1, ">3d not supported"
else:
other_axis = 2
if vector_grids:
#vector_grids[vector_grids==np.inf] = np.nan
U = vector_grids[axes.xaxis_index]
V = vector_grids[axes.yaxis_index]
W = vector_grids[other_axis]
vx = None if U is None else vaex.utils.multisum(U, all_axes)
vy = None if V is None else vaex.utils.multisum(V, all_axes)
vz = None if W is None else vaex.utils.multisum(W, all_axes)
vector_counts_2d = vaex.utils.multisum(vector_counts, all_axes)
if vx is not None and vy is not None:
count_max = vector_counts_2d.max()
mask = (vector_counts_2d > (self.vector_level_min * count_max)) & \
(vector_counts_2d <= (self.vector_level_max * count_max))
x = vector_positions[axes.xaxis_index]
y = vector_positions[axes.yaxis_index]
x2d, y2d = np.meshgrid(x, y)
#x2d, y2d = x2d.T, y2d.T
#mask = mask.T
colors, colormap = None, None
if True:
if self.vector_auto_scale:
length = np.nanmean(np.sqrt(vx[mask]**2 + vy[mask]**2))# / 1.5
logger.debug("auto scaling using length: %r", length)
vx[mask] /= length
if len(all_axes) > 2:
other_axis = all_axes[0]
assert len(all_axes) == 1, ">3d not supported"
else:
other_axis = 2
if vector_grids:
#vector_grids[vector_grids==np.inf] = np.nan
U = vector_grids[axes.xaxis_index]
V = vector_grids[axes.yaxis_index]
W = vector_grids[other_axis]
vx = None if U is None else vaex.utils.multisum(U, all_axes)
vy = None if V is None else vaex.utils.multisum(V, all_axes)
vz = None if W is None else vaex.utils.multisum(W, all_axes)
vector_counts_2d = vaex.utils.multisum(vector_counts, all_axes)
if vx is not None and vy is not None:
count_max = vector_counts_2d.max()
mask = (vector_counts_2d > (self.vector_level_min * count_max)) & \
(vector_counts_2d <= (self.vector_level_max * count_max))
x = vector_positions[axes.xaxis_index]
y = vector_positions[axes.yaxis_index]
x2d, y2d = np.meshgrid(x, y)
#x2d, y2d = x2d.T, y2d.T
#mask = mask.T
colors, colormap = None, None
if True:
if self.vector_auto_scale:
length = np.nanmean(np.sqrt(vx[mask]**2 + vy[mask]**2))# / 1.5
logger.debug("auto scaling using length: %r", length)
vx[mask] /= length
vy[mask] /= length
def marginal2d(self, i, j):
gridscope = GridScope(globals=self.globals)
for key in self.user_added:
value = self[key]
if isinstance(value, np.ndarray):
dimension = len(value.shape)
axes = list(range(dimension))
axes.remove(i)
axes.remove(j)
grid = vaex.utils.multisum(value, axes)
gridscope[key] = grid
else:
gridscope[key] = value
return gridscope
amplitude_selection = None
#print("total amplit")
self.plot_density(axes, amplitude, amplitude_selection, stack_image)
if len(all_axes) > 2:
other_axis = all_axes[0]
assert len(all_axes) == 1, ">3d not supported"
else:
other_axis = 2
if vector_grids:
#vector_grids[vector_grids==np.inf] = np.nan
U = vector_grids[axes.xaxis_index]
V = vector_grids[axes.yaxis_index]
W = vector_grids[other_axis]
vx = None if U is None else vaex.utils.multisum(U, all_axes)
vy = None if V is None else vaex.utils.multisum(V, all_axes)
vz = None if W is None else vaex.utils.multisum(W, all_axes)
vector_counts_2d = vaex.utils.multisum(vector_counts, all_axes)
if vx is not None and vy is not None:
count_max = vector_counts_2d.max()
mask = (vector_counts_2d > (self.vector_level_min * count_max)) & \
(vector_counts_2d <= (self.vector_level_max * count_max))
x = vector_positions[axes.xaxis_index]
y = vector_positions[axes.yaxis_index]
x2d, y2d = np.meshgrid(x, y)
#x2d, y2d = x2d.T, y2d.T
#mask = mask.T
colors, colormap = None, None
if True:
if self.vector_auto_scale:
length = np.nanmean(np.sqrt(vx[mask]**2 + vy[mask]**2))# / 1.5