Closed amedlin closed 5 years ago
Hi, in my opinion, if the array is empty, it does not make sense to return any index, so I think it is OK that the function errors. I also see, that there can be an error if value > max(array)
, but both are edge cases with defective data which will not lead to a reasonable deconvolution/receiver function.
@amedlin Can I close this issue? What was your setting that the error got triggered?
Actually I think I agree with your opinion on this function. In my situation an empty array was throwing the error. Now I'm avoiding the situation by better filtering of my input data.
https://github.com/trichter/rf/blob/2e2589b186fc07db09a11022b2cbebfbb5522122/rf/deconvolve.py#L23
If the array is empty, the function should simply return 0. Instead, after
np.searchsorted
returns 0, if tries to index into the empty array.