How to use the vaex.utils.multisum function in vaex

To help you get started, we’ve selected a few vaex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vaexio / vaex / packages / vaex-ui / vaex / ui / layers.py View on Github external
#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)
github vaexio / vaex / packages / vaex-ui / vaex / ui / layers.py View on Github external
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
github vaexio / vaex / packages / vaex-ui / vaex / ui / layers.py View on Github external
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
github vaexio / vaex / packages / vaex-core / vaex / grids.py View on Github external
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
github vaexio / vaex / packages / vaex-ui / vaex / ui / layers.py View on Github external
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