Closed bweeding closed 4 weeks ago
Hi! Thanks for raising this issue! I agree with you that all-nan slices are not treated appropriately as they as elsewhere in xclim
. The culprit is this operation on 1d-array: np.quantile(ref[ref >= cluster_thresh], q_thresh)
, it should have a been using np.nanquantile
. But even then, there are other operations after that don't make much sense with all-nan slices.
I will add a fast track that simply outputs nan's for training parameters whenever this situtation occurs, I'll keep you posted.
I'll close the issue, it was fixed in #1983. The fixes will appear in the next xclim version. Thanks again for raising this issue!
Best, Éric
Generic Issue
I'm trying to apply sdba.adjustment.ExtremeValues to some precipitation data with coordinates time, lat, lon. The data is over land only, and areas of water are all nan. However, when I try this the compute fails. If I select locations (combinations of lat and lon) that are land only, the function works. However, as other xclim bias adjusting functions successfully ignore all nan locations, this behaviour seems out of character for the package.
If I slice the data so I'm only including locations with non-nan values, things work fine:
However, if I include a location that contains all nans, rather than ignoring it, the code fails as shown below. Any help would be greatly appreciated.
extremes_issues.zip
Code of Conduct