I have quite a few sensors in the field that measure water pressure. In the past the height of these sensors have been changed quite a few times creating jumps in the timeseries. Since these timeseries are continuous and I have a manual measurement I should technically be able to remove the jumps (by hand this is easy, but there are too many measurements so I need to do it in python).
I've tried removing the jumps using a median filter but this doesn't really work.
My code:
# filter out noise in signal (peaks)
minimumPeak = 0.03 # filter peaks larger than 0.03m
filtered_value = np.array(im.median_filter(data['value'], 5))
noise = np.array((filtered_value-data['value']).abs() > minimumPeak)
data.loc[noise, 'value'] = filtered_value[noise]
data is pandas dataframe containing two columns: 'datetime' and 'value'.
I've also tried to do this manually and got it working in a simple case, but not well in any other. Any idea how I would filter out the jumps?
An example is shown in the picture below (yellow indicating the jumps, red the measurement by hand (it is very well possible that this measurement is not in the beginning as it is in this example))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…