- IdealGas.filter_by_label(pores=, throats=, labels=None, mode='or')#
Returns which of the supplied pores (or throats) has the specified label(s)
pores (array_like) – List of pores or throats to be filtered
throats (or) – List of pores or throats to be filtered
labels (list of strings) – The labels to apply as a filter
mode (str) –
Controls how the filter is applied. The default value is ‘or’. Options include:
Returns a list of the given locations where any of the given labels exist. Also accepts ‘union’ and ‘any’.
Only locations where all the given labels are found. Also accepts ‘intersection’ and ‘all’.
Only locations where exactly one of the given labels are found.
Only locations where none of the given labels are found. Also accepts ‘none’ and ‘not’
Only locations with some but not all of the given labels are returned
Only locations with more than one of the given labels are returned
A list of pores (or throats) that have been filtered according the
given criteria. The returned list is a subset of the received list of
pores (or throats).
>>> import openpnm as op >>> pn = op.network.Cubic(shape=[5, 5, 5]) >>> pn.filter_by_label(pores=[0, 1, 25, 32], labels='left') array([0, 1]) >>> Ps = pn.pores(['top', 'bottom', 'back'], mode='or') >>> pn.filter_by_label(pores=Ps, labels=['top', 'back'], ... mode='and') array([ 24, 49, 74, 99, 124])