find_pore_to_pore_distance¶
- openpnm.topotools.find_pore_to_pore_distance(network, pores1=None, pores2=None)[source]¶
Find the distance between all pores on set 1 to each pore in set 2
- Parameters
network (GenericNetwork) – The network object containing the pore coordinates
pores1 (array_like) – The pore indices of the first set
pores2 (array_Like) – The pore indices of the second set. It’s OK if these indices are partially or completely duplicating
pores
.
- Returns
dist – A distance matrix with
len(pores1)
rows andlen(pores2)
columns. The distance between pore i inpores1
and j inpores2
is located at (i, j) and (j, i) in the distance matrix.- Return type
array_like
Notes
This function computes and returns a distance matrix, which is a dense matrix of size Np_1 by Np_2, so can get large. For distances between larger sets a KD-tree approach would be better, which is available in
scipy.spatial
.