iselect

function of dascore.proc.select source

iselect(
    patch: Patch ,
    copy = False,
    **kwargs ,
)-> ‘PatchType’

Return a subset of the patch using index-based query parameters.

Any dimension of the data can be passed as key, and the values should either be a Slice, a tuple of (min_ind, max_ind) or a single int.

Parameters

Parameter Description
patch The patch object.
copy If True, copy the resulting data. This is needed so the old array can get gc’ed and memory freed.
**kwargs Used to specify the dimension and slices to select on.
See also select.

Examples

import dascore as dc
patch = dc.get_example_patch()
# Select first 10 distance indices
out1 = patch.iselect(distance=(..., 10))
# Select last time row/column
out2 = patch.iselect(time=-1)