Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df0cde3

Browse files
authored
Extended the convolution filter
Changed the convolution filter from [1, 1] to [1, 1, 1] such that the mask is dilated on both sides, not only at the end.
1 parent 6429e9d commit df0cde3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/event_handling/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def downsample(self, xstart, xend):
2525
mask = (self.origXData > xstart) & (self.origXData < xend)
2626
# dilate the mask by one to catch the points just outside
2727
# of the view range to not truncate the line
28-
mask = np.convolve([1, 1], mask, mode='same').astype(bool)
28+
mask = np.convolve([1, 1, 1], mask, mode='same').astype(bool)
2929
# sort out how many points to drop
3030
ratio = max(np.sum(mask) // self.max_points, 1)
3131

0 commit comments

Comments
 (0)