def interpolate_data(self, propname, mode='mean'): r""" Determines a pore (or throat) property as the average of it's neighboring throats (or pores) Parameters ---------- propname: str The dictionary key to the values to be interpolated. mode : str The method used for interpolation. Options are 'mean' (default), 'min', and 'max'. Returns ------- vals : ndarray An array containing interpolated pore (or throat) data Examples -------- >>> import openpnm as op >>> pn = op.network.Cubic(shape=[3, 1, 1]) >>> pn['pore.value'] = [1, 2, 3] >>> pn.interpolate_data('pore.value') array([1.5, 2.5]) """ from openpnm.models.misc import from_neighbor_throats, from_neighbor_pores if propname.startswith('throat'): values = from_neighbor_throats(target=self, prop=propname, mode=mode) elif propname.startswith('pore'): values = from_neighbor_pores(target=self, prop=propname, mode=mode) if hasattr(self[propname], 'units'): values *= self[propname].units return values
def from_neighbor_pores(target, pore_prop='pore.seed', mode='min'): return _misc.from_neighbor_pores(target=target, pore_prop=pore_prop, mode=mode)
def from_neighbor_pores(target, prop='pore.diameter', mode='min'): return _misc.from_neighbor_pores(target=target, prop=prop, mode=mode)