crop#
- pypillometry.crop(start=-inf, end=inf, units='ms')#
Pipeline step for
crop()(d | pp.crop(...)).Crop the data to the time range from start to end.
The result contains all data (and events) between start and end (inclusive), e.g.
d.crop(3*u.min, 5*u.min)ord.crop("3 min", "5 min"). start and end refer to the values of the time-vector (not to the time since the start of the recording). Masks are kept; stored blinks (in sample indices) are shifted and cut to the new range.- Parameters:
start (
float) – start for new dataset; default: beginning of the dataend (
float) – end of new dataset; default: end of the dataunits (
str) – time units of start and end if they are plain numbers (one of “ms”, “sec”, “min”, “h”); default “ms” (the units of the time vector).inplace (bool or None, optional) – if True, make change in-place and return the object; if False, make and return copy before making changes; if None, use the object-level setting (specified in the constructor)
- Return type:
- Returns:
the shortened object (self or a copy, depending on inplace)
- Raises:
ValueError – if start is after end or there are no samples between them
See also
remove_intervalsremove periods (e.g., breaks) and join the rest