UW-Hydro / RVIC

RVIC Streamflow Routing Model

Home Page:http://rvic.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convolution failing on sample data

manueldeljesus opened this issue · comments

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.

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

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.

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?

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.

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

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

Thank you, Manuel :)

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

@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.

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

@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!