Closed bzah closed 9 months ago
Workaround until the issue is fixed, using xclim:
import xclim
import xarray as xr
ds = xr.open_dataset("pr.nc")
base_pr = ds.pr.sel(time=slice("2015-01-01","2015-06-31"))
xclim.atmos.standardized_precipitation_index(
pr=ds.pr,
pr_cal=base_pr,
freq="MS",
window=6,
dist="gamma",
method="APP"
)
I'm working on a fix. @pagecp do you think this issue also apply to other indices ?
I'm working on a fix. @pagecp do you think this issue also apply to other indices ?
I need to go through all the indices, to be sure.
Description
Initially reported by email.
I am using your library to calculate the SPI6 climate index but I don't understand the results it gives me, I don't know if there is a bug. I send the netcdf that I'm using and this is the code that I'm using from you:
and the result looks like this:
The time dimension is supposed to start in january.
The bug is due to the post_processing step that is meant to add
time_bounds
but also resample the result if necessary. This step should probably be avoided when computing SPI6 or SPI3. Investigation needed to see if other indices are impacted.