compute_psds_pocketwise_rust
go-to Core Rust pocket-wise PSD sampler; used by segmentation helper and tutorials.
rust_fun.compute_psds_pocketwise_rust(
dgrid,
regions_pbc,
ase_atoms,
num_samples_per_region=1000,
bins=None,
return_fig=False,
material='Material',
probe_center_min_radius=None,
)Compute pore size distributions for each pocket/region.
This function creates separate pore size distributions for each identified pore region and optionally generates a visualization plot.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| dgrid | numpy.ndarray | 3D distance grid from dgrid_from_atoms_rust | required |
| regions_pbc | numpy.ndarray | 3D array of region labels from periodic segmentation | required |
| ase_atoms | ase.Atoms | ASE Atoms object of the material | required |
| num_samples_per_region | int | Number of sample points per region | 1000 |
| bins | numpy.ndarray | None | Bin edges for histogram. If None, uses np.linspace(0, 50, 200) | None |
| return_fig | bool | Whether to return a plotly figure along with the PSDs | False |
| material | str | Name of the material for plot title | 'Material' |
Returns
| Name | Type | Description |
|---|---|---|
| dict | tuple[dict, plotly.graph_objects.Figure] | If return_fig is False, returns pocket PSDs dictionary. If True, returns (pocket_psds, figure) |