UMN-Hydro / GSFLOW-GRASS

Generates inputs for and runs the coupled groundwater-surface water model "GSFLOW"
GNU General Public License v3.0
28 stars 18 forks source link

Error v.stream.network.py: too many indices for array #18

Open jvollhueter opened 4 years ago

jvollhueter commented 4 years ago

Hello,

for my master thesis I would like to generate the input files for a GSFLOW model with the software GSFLOW-GRASS. The calculation of example setups worked well. Unfortunately I did not manage to create my own synthetic model yet, because the conversion of the DEM fails. Unfortunately I don't know if this is a problem with the DEM raw file or something else. Maybe someone has already had experience with the error message and can give me a hint where the problem is.

I work with GRASS-GIS version 7.6.1, GSFLOW version 1.2.2 and Python 2.7.18.

Below the console output:

C:\WRDAPP\GSFLOW-GRASS-master>py -2.7 domain_builder\buildDomainGRASS.py C:\WRDAPP\GSFLOW-GRASS-master\Run\settings.ini

Using specified input file: C:\WRDAPP\GSFLOW-GRASS-master\Run\settings.ini Importing DEM and generating hydrologic correction WARNUNG: Die Rasterkarte existiert bereits und wird überschrieben WARNUNG: Updating spatial reference with embedded proj4 definition WARNUNG: Datum von GRASS nicht erkannt und keine Parameter gefunden. Importing raster map ... 100% 100% 100% Load elevation map 100% Remove one cell extremas 100% Set edge points 100% A Search... 100% Processing 0 sinks Write conditioned DEM 100% ABSCHNITT 1a (von 4): Initiiere den Speicher. ABSCHNITT 1b (of 4): Ermittle den Fluß aus der Karte heraus. 100% SECTION 2: A Search. 100% ABSCHNITT 3: Akkumuliere Oberflächenabfluß mit SFD. 100% ABSCHNITT 4: Schließe Karten. 100% 100% Benenne raster in um 100% WARNUNG: Unable to rename null file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\3708.1' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\accumulation_onmap\nullcmpr': File exists WARNUNG: Unable to rename cell file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\3708.0' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\accumulation_onmap': File exists 100% WARNUNG: Unable to rename null file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\7348.1' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\DEM\nullcmpr': File exists WARNUNG: Unable to rename cell file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\7348.0' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\DEM': File exists 100% WARNUNG: Unable to rename null file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\2860.1' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\accumulation_onmap\nullcmpr': File exists WARNUNG: Unable to rename cell file 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\2860.0' to 'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\accumulation_onmap': File exists Loading input raster maps... 100% Initializing A search... 100% A Search... 100% Extracting streams... 100% Thinning stream segments... 100% Schreibe Ausgabe-Rasterkarten... 100% Writing vector map ... WARNUNG: Vektorkarte existiert bereits und wird überschrieben. 100% Writing attribute data... Erstelle Topologie für die Vektorkarte streams_all@PERMANENT... Registriere Primitive... Memory swap calculation (may take some time)... Lese Rasterkarte ... 100% Calculating basins using streams... Lese Rasterkarte ... 100% Finding nodes... 100% Delineating basins for 0 outlets... 100% Schreibe Rasterkarte ... 100% WARNUNG: Vektorkarte existiert bereits und wird überschrieben. Extrahiere Flächen ... 100% Schreibe Flächen... 100% Erstelle Topologie für die Vektorkarte basins_all@PERMANENT... Registriere Primitive... r.to.vect komplett. Erstelle Topologie f³r die Vektorkarte streams_all@PERMANENT... Registriere Primitive... WARNUNG: Values in column will be overwritten WARNUNG: Values in column will be overwritten Lese Objekte... 100% Aktualisiere die Datenbank... 100% 0 Datensätze aktualisiert/eingefügt (Layer 1). WARNUNG: Values in column will be overwritten WARNUNG: Values in column will be overwritten Lese Objekte... 100% Aktualisiere die Datenbank... 100% 0 Datensätze aktualisiert/eingefügt (Layer 1). Traceback (most recent call last): File "C:\Users\jonas\AppData\Roaming\GRASS7\addons/scripts/v.stream.network.py", line 208, in main() File "C:\Users\jonas\AppData\Roaming\GRASS7\addons/scripts/v.stream.network.py", line 174, in main cats = colValues[:,colNames == 'cat'].astype(int).squeeze() # river number IndexError: too many indices for array Traceback (most recent call last): File "domain_builder\buildDomainGRASS.py", line 154, in v.stream_network(map=streams_all) File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 649, in call return self.run() File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 770, in run self.wait() File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 791, in wait module=self.name, errors=stderr) grass.exceptions.CalledModuleError: Module run v.stream.network v.stream.network map=streams_all upstream_easting_column=x1 upstream_northing_column=y1 downstream_easting_column=x2 downstream_northing_column=y2 tostream_cat_column=tostream ended with error Process ended with non-zero return code 1. See errors in the (error) output.

Thank you very much in advance!

With best regards

Jonas Vollhüter

aandrovitsanea commented 4 years ago

Dear Jonas,

could you send your ini and raster file as well so that I can check the issue?

One point is that the raster file should exceed the boarders of your basin.

Kind regards,

Anna

jvollhueter commented 4 years ago

Dear Anna,

thank you very much for your answer. In the meantime I stopped the experiments with synthetic models and tried to create a model with a real area. I uploaded the files to this repository. The data for the DEM are from the responsible state authority and represent an area of the city of Dresden. Thank you very much for your help!

Best regrads

Jonas

jvollhueter commented 4 years ago

Dear Anna,

i tried the tip with the border of the area in DEM and the calculation is now running much faster. Unfortunately it still breaks off at a certain point and I get an error message that the north value will be greater than the south value, together with this line:

grass.exceptions.CalledModuleError: Module run g.region g.region n=5655990.0 s=5655990.0 e=411990.0 w=411990.0 nsres=5.0 ewres=5.0 ended with error Process ended with non-zero return code 1. See errors in the (error) output.

But the computational region in GRASS-GIS is given correctly and does not correspond to the values the module reads:

g.region -p projection: 1 (UTM) zone: 33 datum: etrs89 ellipsoid: grs80 north: 5658600 south: 5655400 west: 411400 east: 414600 nsres: 50 ewres: 50 rows: 64 cols: 64 cells: 4096

Do you have an idea how I can fix this error?

Thank you again in advance and have a nice weekend!

Best regards

Jonas