Im trying to calculate the mean SPI value over a selected area with a specific lon/lat. I made the following area where i want to calculate the mean over.
ds_mlw1 = ds.sel(lat=slice(-16.74833, -16.75613), lon=slice(35.27023, 35.27915))
I saw that it works best to work with the cdo package. I get an error that my cdo is not recognized. Does someone know how to solve this problem.
This is my script
from cdo import *
import matplotlib.pyplot as plt
file = 'spi3_6_12_1deg_cru_ts_3_21_1949_2012.nc'
cdo = Cdo()
cdo.debug=True
meanspi = cdo.fldmean(input=file,returnCdf=True).variables['spi3'][:]
I get the following error
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-77-7eeb6d09369c> in <module>()
9 import matplotlib.pyplot as plt
10 file = 'spi3_6_12_1deg_cru_ts_3_21_1949_2012.nc'
---> 11 cdo = Cdo()
12 cdo.debug=True
13
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden
meaning (the systme can't find the given file)