trim_disconnected_clusters#
- trim_disconnected_clusters(**kwargs)[source]#
Computes actual node and edge occupancy based on connectivity to the given inlets
- Parameters:
b_labels (ndarray) – An array of cluster labels assigned to each bond. -1 indicates unoccupied
s_labels (ndarray) – An array of cluster labels assigned to each site. -1 indicates unoccupied. Site cluster numbers must correspond to the bond clusters, such that if bond j has a cluster number N, then both sites on each end of j are also labeled N.
inlets (ndarray) – An array containing node indices that are to be treated as inlets. Any clusters labels not found in these nodes will be considered disconnected and set to -1.
- Returns:
occupancy – The returned tuple containing arrays of cluster numbers of
occupied_sites
andoccupied_bonds
, after accounting for connection to theinlets
.- Return type:
tuple of ndarrays
Notes
The
b_labels
ands_labels
arrays are returned from thebond_percolation
orsite_percolation
function.