Closed Tarikbouram closed 4 years ago
The code expects that the elevation dataset be at a higher resolution than the grid cell so that it can calculate the fraction of elevation bands, so that is fine. This issue you found was happening because the code masked any elevation data below 0 to prevent no data values from skewing the mean band elevation values. When that happened sometimes the grid cell would have no data to calculate elevation bands for, giving the error. To fix this, I changed the code to where it does not mask data anymore but manually checks for valid data. I tested it, hopefully it works now. Please download the updated scripts and try again. Please let me know if it works or not.
I think it worked since I no longer have this error, however there is another one that appears with this script
python format_snow_params.py ../data/input/gis/Nyando_grid.tif ../data/input/gis/Nyando_basin_SRTMSnap.tif ../data/input/snow.param 100
Traceback (most recent call last):
File "format_snow_params.py", line 218, in <module>
main()
File "format_snow_params.py", line 212, in main
format_snow_params(sys.argv[1],sys.argv[2],sys.argv[3],sys.argv[4])
File "format_snow_params.py", line 188, in format_snow_params
maxbands = max(nbands) # maximum number of bands for a pixel
ValueError: max() arg is an empty sequence
Hi Tarikbouram, Do you successfully complete the VIC model? If yes, could you please share your experience to me?
Hello
The webinar on the VIC model, is one of the best I have attended so far. I have successfully finished the model, and I have been able to apply it to other study areas. The only issue that unfortunately has not been solved until today is the fact that I have not received my certificate of participation.
Best regards
Le jeu. 19 mars 2020 à 23:53, gia_nguyen notifications@github.com a écrit :
Hi Tarikbouram, Do you successfully complete the VIC model? If yes, could you please share your experience to me?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/KMarkert/servir-vic-training/issues/6#issuecomment-601453263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7LR7B33UCNXA77EU2QO5TRIKO43ANCNFSM4E3JUDAQ .
-- T. Bouramtane
Hi @Tarikbouram, glad to hear you were able to successfully set up the model and execute it for your domain. However, I am sorry you have not received your certificate yet...unfortunately I have no control over this but you should try emailing the ARSET team to explain your situation with the certificate and see if they can help you out.
I'm using a script on python "format_snow_param.py". This script takes geotiff data for snow band parameterization and converts it to the needed text format for the VIC model
Usage:
on the terminal I type the following command:
Format elevation band file:
The results give this error:
the output results of the command gdalinfo -stats Nyando_basin_SRTMSnap.tif :
the output results of the command gdalinfo -stats Nyando_grid.tif :
gdalinfo: Relink
/home/lgee/miniconda3/bin/../lib/libpng16.so.16' with
/lib/x86_64-linux-gnu/libpthread.so.0' for IFUNC symbollongjmp' Driver: GTiff/GeoTIFF Files: Nyando_grid.tif Size is 20, 10 Coordinate System is
' Origin = (34.750000000000000,0.050000000000000) Pixel Size = (0.050000000000000,-0.050000000000000) Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 34.7500000, 0.0500000) Lower Left ( 34.7500000, -0.4500000) Upper Right ( 35.7500000, 0.0500000) Lower Right ( 35.7500000, -0.4500000) Center ( 35.2500000, -0.2000000) Band 1 Block=20x10 Type=Byte, ColorInterp=Gray Minimum=1.000, Maximum=1.000, Mean=1.000, StdDev=0.000 NoData Value=0 Metadata: STATISTICS_MAXIMUM=1 STATISTICS_MEAN=1 STATISTICS_MINIMUM=1 STATISTICS_STDDEV=0We can notice that the basin mask has a different pixel size and a different shape (rows and cols) to your elevation grid. From what I can see, the basin mask should be the same size for the code to work. Knowing that I followed exactly the command tutorial and All other parameters have been successfully calculated, except snow.param