Commands#
- nearl.commands.frame_voxelize(coords, weights, grid_dims, spacing, cutoff, sigma)[source]#
Voxelize a set of coordinates and weights (Single frame version of the density flow method)
- Parameters:
- coordsnp.ndarray
The coordinates of the points to be voxellized
- weightsnp.ndarray
The weights of the points to be voxellized
- grid_dimstuple
The dimensions of the grid
- spacingfloat
The spacing of the grid
- cutofffloat
The cutoff distance
- sigmafloat
The sigma value for the Gaussian kernel
- Returns:
- np.ndarray
The voxellized grid sized grid_dims
Examples
>>> import numpy as np >>> from nearl import commands >>> coords = np.random.normal(size=(100, 3), loc=5, scale=2) >>> weights = np.full(100, 1) >>> grid_dims = np.array([32, 32, 32]) >>> commands.frame_voxelize(coords, weights, grid_dims, 0.5, 5, 2)
- nearl.commands.frame_observation(coords, weights, grid_dims, spacing, cutoff, sigma, type_obs)[source]#
Perform marching observer on a single frame.
- Parameters:
- coordsnp.ndarray
The coordinates of the points to be voxellized
- weightsnp.ndarray
The weights of the points to be voxellized
- grid_dimstuple
The dimensions of the grid
- spacingfloat
The spacing of the grid
- cutofffloat
The cutoff distance
- sigmafloat
The sigma value for the Gaussian kernel
- type_obsint
The type of observer
- Returns:
- np.ndarray
The voxellized grid sized grid_dims
- nearl.commands.density_flow(traj, weights, grid_dims, spacing, cutoff, sigma, type_agg)[source]#
Voxelize a trajectory using the density flow method
- Parameters:
- trajnp.ndarray
The trajectory to be voxellized
- weightsnp.ndarray
The weights of the trajectory
- grid_dimstuple
The dimensions of the grid
- spacingfloat
The spacing of the grid
- cutofffloat
The cutoff distance
- sigmafloat
The sigma value for the Gaussian kernel
- type_aggint
The type of aggregation function
- Returns:
- retgridnp.ndarray
The voxellized grid sized grid_dims
Examples
>>> import numpy as np >>> from nearl import commands
- nearl.commands.marching_observer(coords, weights, grid_dims, spacing, cutoff, type_obs, type_agg)[source]#
Marching observers algorithm to create a grid from a slice of frames. The number of atoms in each frame should be the same.
- Parameters:
- coordsnp.ndarray
The coordinates of the points to calculate the marching observer
- weightsnp.ndarray
The weights of the corresponding points
- grid_dimstuple
The dimensions of the grid
- spacingfloat
The spacing of the grid
- cutofffloat
The cutoff distance
- type_obsint
The type of observer
- type_aggint
The type of aggregation function
- Returns:
- ret_arrnp.ndarray
The voxellized grid sized grid_dims