-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The routing model: IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
#7
Comments
one of the solutions I tried is to wrap [tt-1],[tt-1] and[t,1] in int(.....) :
|
I had a similar problem to your original post. Basically, the script was indexing using a float datatype, which is not allowed anymore. I fixed the issue in script where the index is forced to be an integer datatype. Please get the new script and try to rerun the process. Please let me know if you get it to work. |
Thank you for your answer and update , this error message no longer appears, but now there is a new issues:
Do you have any idea what caused this problem and how to solve it. thank you again. |
It seems that the model is trying to grab runoff data from a time period that is not available in the NetCDF data. Can you please check that the NetCDF data has the time period 2005-01-01 to 2013-12-31 as you are specific to run the routing model for? |
I just rebuilt the netCDFS runoff and baseflow data from 2005 to 2013 just to be sure, and it's still the same problem. would you like me to send you the file that contains the netCDFS data? |
Yes, please send both the runoff and baseflow NetCDF data. |
Here I sent you the netCDFS runoff and baseflow data. Thanks |
This is interesting...I am not even to open the NetCDF data on my system which makes me believe it might be an issue with your NetCDF library installation to where it is not writing the data properly. Can you please check your configuration for the netCDF software on your system? You can do this by running |
indeed it is very strange, on my machine I manage to open this netcdf data, and analyze them on panoply.
|
It seems there has been some bugs in the version of the netCDF library that you have installed were the information may not be written correctly. Can you please try updating you netCDF package in anaconda using the following command: |
I updated my netCDF package, as you can see below:
but unfortunately I still have the same issue. would you like me to send you the feeds file? maybe the problem has a connection with the fluxes. In fact when opening the netCDF runoff file the values range from 00 to 1.0e-25. which I know is not correct but even by changing the maximum value to for example 2.2, the runoff hardly varies. |
Hi everyone, I just got to this stage of processing after making some changes to the flux2nc.py script, like changing "string" to "str", adding some "int' before "input', here attached the script:
`
|
So, there was an error with the initial model setup where the underlying grid had an extra row and column but the way the model outputs the data was omitting that extra row and column. Basically, this led to mismatched dimensions between the model output and expected grid. Any indexing on the edges of the grid while routing was throwing Index Errors. I have updated the input files for the grids on the repo. Users will have to download the new Nyando_basin shapefile, setup the model input data from the beginning, and rerun the model. I apologize for any inconvenience. |
@optyrox12 thanks for your suggestions on the code. It seems like this issue was a Python 3 compatibility issue which should have been fixed with b453fe4. Considering this issue should be fixed and the time since latest comment, I will go ahead and close. Please reopen if this is still an issue. |
Hello
I am trying to use the routing model of the tutorial, and I encounter this indexerror, I tried several solution but it didn't work.
Is there any known way to fix it ?
Thanks
The text was updated successfully, but these errors were encountered: