to_indices#

GenericSpecies.to_indices(mask)#

Converts a boolean mask to a list of pore or throat indices.

Parameters

mask (array_like of booleans) – A boolean array with True at locations where indices are desired. The appropriate indices are returned based an the length of mask, which must be either Np or Nt long.

Returns

A list of pore or throat indices corresponding the locations where the received mask was True.

Return type

ndarray

See also

to_mask

Notes

This behavior could just as easily be accomplished by using the mask in pn.pores()[mask] or pn.throats()[mask]. This method is just a convenience function and is a complement to to_mask.