nasa / RHEAS

Regional Hydrologic Extremes Assessment System
MIT License
73 stars 54 forks source link

SPI Calculation Issue #124

Open akssinghe opened 5 years ago

akssinghe commented 5 years ago

Seems with the new patch, SPI calculation has an issue as below. This issue occurs for all the runs, i.e., nowcast, forecast and with initialize on and off.

Traceback (most recent call last): File "../.././bin/rheas", line 16, in sys.exit(rheas.run()) File "/home/ubuntu/RHEAS/src/rheas.py", line 97, in run nowcast.execute(dbname, options) File "/home/ubuntu/RHEAS/src/nowcast.py", line 200, in execute runVIC(dbname, options) File "/home/ubuntu/RHEAS/src/nowcast.py", line 29, in runVIC runDeterministicVIC(dbname, options) File "/home/ubuntu/RHEAS/src/nowcast.py", line 78, in runDeterministicVIC model.save(saveto, savevars) File "/home/ubuntu/RHEAS/src/vic/vic.py", line 625, in save self.saveToDB(args, initialize=initialize, skipsave=skipsave, ensemble=ensemble) File "/home/ubuntu/RHEAS/src/vic/vic.py", line 524, in saveToDB dout = drought.calc(var, self, ensemble) File "/home/ubuntu/RHEAS/src/drought.py", line 353, in calc output = calcSPI(duration, model, ensemble) File "/home/ubuntu/RHEAS/src/drought.py", line 244, in calcSPI t = np.where(p.index == startdate)[0][0] IndexError: index 0 is out of bounds for axis 0 with size 0