I have been using the median_filter
function from scipy.ndimage
. I would like to use this in a way that discards any data that isn't positively valued.
That is, suppose one iteration of the filter acts over:
[40, 50, 0, 90]
If I simply run the median filter over this, I will get 45. I desire a function which ignores the zero, such that the median is 50.
Thanks for your suggestions!