You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
The text was updated successfully, but these errors were encountered: