Replies: 2 comments
-
I am encountering the same problem. I get an array filled with NaNs even though my inputs satisfy all the requirements for the spei function. Is anyone at Ouranosinc able to assist? |
Beta Was this translation helpful? Give feedback.
-
Hi! Sorry, this discussion has slipped through the cracks. In the example, you are using a single year for calibration.
That means you will be doing a fit on a statistical distribution with only one point. I'm not 100% sure, but it might be that some scipy function simply fail and gives an NaN in this context. Could you try with a bigger sample for you calibration data, say over 30 years, and see if things work this way? @pjmcguire , were you also trying with a very small sample? |
Beta Was this translation helpful? Give feedback.
-
Setup Information
Context
I have run standardized_precipitation_index with CMORPH daily data
The output has no data in any time step. I don't know what could be wrong.
The calculation got some UserWarning s but the function went through.
I'm not sure if I want to run SPI from 1998 to 2017 what pr_cal should I set to, could it be based on climatology (1981-01-01 to 2020-12-31)?
Steps To Reproduce
ds = cmorph_ds
ds['prcp'].attrs['units'] = 'mm/day'
pr = cmorph_ds.prcp
pr_cal = pr.sel(time=slice(datetime(1998, 5, 1), datetime(1998, 11, 30)))
spi_6 = standardized_precipitation_index(pr, pr_cal, freq="MS", window=6, dist="gamma", method="ML")
Beta Was this translation helpful? Give feedback.
All reactions