UW-Hydro / RVIC

RVIC Streamflow Routing Model
http://rvic.readthedocs.org
GNU General Public License v3.0
34 stars 59 forks source link

Convolution failing on sample data #96

Open manueldeljesus opened 7 years ago

manueldeljesus commented 7 years ago

RVIC convolution is failing on the sample dataset. The error seems to occur while writing a restart file, in particular in lines 425, 441, 459 and 475 of rvic/core/variables.py. The look like the next ones:

for key, val in iteritems(share.timemgr_rst_curr_tod):
    if val:
        setattr(timemgr_rst_curr_tod, key, val)

The error that shows up is the one below

ERROR:write>> setattr(timemgr_rst_step_sec, key, val)
ERROR:write>>   File "netCDF4/_netCDF4.pyx", line 3679, in netCDF4._netCDF4.Variable.__setattr__ (netCDF4/_netCDF4.c:38607)
ERROR:write>> ValueError
ERROR:write>> :
ERROR:write>> could not convert string to float: '0, 86400'

Specifically it occurs while writing valid_range. If I comment the lines above, the program finishes without any error. I am pretty sure that those lines are there for a reason, however, I do not know how to solve the issue.

I have installed RVIC through anaconda in OS X Sierra, although I was getting this very same error on Ubuntu. I installed the cdo libraries from Homebrew because Anaconda's version did not seem to be working.

jhamman commented 7 years ago

can you put your convolution configuration file somewhere we can see it?

manueldeljesus commented 7 years ago

Yes, of course. I took the sample one and modified the paths. I attach it to this message.

rvic.convolution.rasm.cfg.txt

Your help is much appreciated.

corinat commented 7 years ago

I am having the same problem and I installed it using python 2.7 and python 3.5. The message error is slitly different but it crashes at the same line. Is there a way to solve this error?

manueldeljesus commented 7 years ago

I edited the source code to remove the parts that were failing. It creates the file without problem but some of the metadata do not appear. I use it as a temporary workaround while the problem is properly solved.

corinat commented 7 years ago

May I ask where did you do the editing? Is this file rvic/core/variables.py?

manueldeljesus commented 7 years ago

Yes. The lines on the file are referenced in the original message. I just commented those lines and everything worked.

corinat commented 7 years ago

Thank you, Manuel :)

frezersa commented 6 years ago

Hello folks, Is there any workaround for this problem? I am having an exact same problem for sample dataset (Gunnison). Thanks

jhamman commented 6 years ago

@frezersa , @manueldeljesus, @corinat -- If anyone is open to opening a pull request with a fix to this, that would very welcome. In the short term, I don't have any time to help debug this or work on RVIC.

frezersa commented 6 years ago

I fix this error by changing "valid_range" to "range" in ~/rvic/core/share.py between line 277 to 298

yixinmao commented 6 years ago

@frezersa I had the same issue and your solution works. I'm wondering what's the reason that this change fixed the problem? Seems to me that it's merely a name change. Thanks!