porespy.tools.parse_steps#
- porespy.tools.parse_steps(steps, vals, mask=None, descending=True, log=False, pad=(0, 0))#
Generates an array of step sizes to iterate through for the displacement simulations
- Parameters:
steps (int, tuple, list or ndarray, or None) – If an int then steps is treated as the number of steps between minimum and maximum in vals. If a tuple is received then this is passed to np.arange. If None then all unique values in vals are used. If a list or ndarray is received they are used directly.
vals (ndarray) – An array containing the values to be scanned, such as a distance or capillary transform.
mask (ndarray) – A boolean mask of which values in vals to use when finding limits. If not provided then all values vals are used, but if provided, then vals is converted as vals = vals[mask] beforehand.
descending (bool, optional) – If True (default), then the returned list of sizes is in descending order
log (bool, default is False) – If True then the range of values generated is logarithmically spaced when steps is an int.
pad (tuple of ints) – This will extend the range of steps by the given number in each direction using the spacing of the adjacent points. For example, pad=(1, 1) will extend the range of the bins by 1 both up and down, so [1, 2, 3] will become [0, 1, 2, 3, 4]. This is applied after putting the values into ascending or descending order.
- Returns:
steps – Array of values spanning the desired start and stop limits
- Return type:
ndarray