I have the following arrays:
time = [1e-6, 2e-6, 3e-6, 4e-6, 5e-6, 6e-6, 7e-6, 8e-6, 9e-6, 10e-6]
signal = [0, 10, 3, 2, 1, 0, 10, 2, 2, 5]
and I want to remove (from both arrays) any datapoints that are above a threshold value, with a given padding width
threshold = 9
padding = 3e-6
so any indexes that are above 9 in the signal
array or are within 100 data points in the time
array should be removed from both arrays. Note: this means there could be overlap if there are two data points within the padding
window that are above the threshold
example output
time_out = [4e-6, 5e-6, 9e-6, 10e-6]
signal_out = [2, 1, 2, 5]
EDIT: this post is very similar, however it does it only for one index of an array, where I would need to do it at multiple (above e.g. time=2e-6 and time=7e-6) https://stackoverflow.com/a/66695205/12728698