Code Monkey home page Code Monkey logo

gsflow-grass's Issues

libgfortran dependency

An user received the error when running GSFLOW v1.2.0:

libgfortran.so.3: cannot open shared object file: No such file or directory

He corrected it through:

sudo apt-get install libgfortran3

I'm not sure if it's just his system, or if this is a more general thing, so I'm first making a note here. I'm also not sure if it's the library or the specific version of the library. If others report this being an issue, I will update the README.md.

plotSegmentDischarge.py issues

plotSegmentDischarge.py

Concatenation error on line 125.
ax.set_title(plotting_variable+': '+ date)
The first number in the matrix dates is nan which means the variable is considered float so it doesn’t want to concatenate. I think this is just symptomatic of the next issue.
In the meantime I changed to
ax.set_title(plotting_variable+': '+ str(date))
Next I get an error with writer.grab_frame() on line 129. Also nothing shows up in the plot area of the graph in the console and it writes a movie but nothing shows up in the plot.
I believe this is an issue with reading in the “…ani.nsegment.corrected” file because the data frame “segment_outputs” is not reading in correctly. It’s mostly nans. I tried changing the number of line to skip from 8 to 10 which makes “segments_outputs” look better but then I run into more issues.
I keep getting 10d etc showing up "segments_outputs" and the first line of dates, even when I try to skip over more lines?

Small things:

  • Prints a bunch of HRU numbers in the console every time step. Why do we want this? It makes it hard to scroll back up.
  • No units on colour bar

docker installs grass78 (which uses Python 3.x)

The install_grass_package script, as called from the Dockerfile, installs the latest GRASS (7.8 as of today). Since the software is tested on GRASS 7.6, I had to make some changes to the Dockerfile and install_grass_package to get Ubuntu 16.04 and Grass76:

in Docker file, changed
FROM ubuntu:18.10
to
FROM ubuntu:16.04

in install_grass_package, changed
apt install -y software-properties-common add-apt-repository ppa:ubuntugis/ubuntugis-unstable
to
apt install -y software-properties-common add-apt-repository ppa:ubuntugis/ppa add-apt-repository ppa:grass/grass-stable apt-get update apt-get install grass76

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

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 <DEM_original_import> 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 <DEM_original_import>...
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 <streams_all>...
WARNUNG: Vektorkarte <streams_all> 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 <streams_all> ...
100%
Finding nodes...
100%
Delineating basins for 0 outlets...
100%
Schreibe Rasterkarte <basins_all>...
100%
WARNUNG: Vektorkarte <basins_all> 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

Move HRU centroids to HRU centers

Find the midpoint of the HRU and move the centroid to this location using v.edit.
This could make it easier to pick representative values (e.g., for climate).
One trick will be ensuring that the centroid is within the polygon for more complex shapes! There must be some mathematical approach for that -- like maximizing distance from all boundaries while requiring the point to be within them.

ERROR with GIS part: failed to add field name "XXX" and failed with running PRMS

Some field can't be added to the gis field. I have no idea about it. How do I solve this error? Could anyone give me a hint? The follows are part of error output:

WARNING: OGR layer already exists and will be overwritten
ERROR 6: Failed to add field named 'hru_area_m2'
ERROR 6: Failed to add field named 'hru_segment'
ERROR 6: Failed to add field named 'obsin_segment'
ERROR 6: Failed to add field named 'aspect_x_sum'
ERROR 6: Failed to add field named 'aspect_y_sum'
WARNING: OGR layer <gravity_reservoirs> already exists and will be overwritten
ERROR 6: Failed to add field named 'a_hru_aspect'
ERROR 6: Failed to add field named 'a_hru_slope'
ERROR 6: Failed to add field named 'a_outlet_sta'
ERROR 6: Failed to add field named 'a_hru_xlong'
ERROR 6: Failed to add field named 'a_hru_segment'
ERROR 6: Failed to add field named 'a_obsin_segment'
ERROR 6: Failed to add field named 'a_soil_type'
ERROR 6: Failed to add field named 'a_aspect_x_sum'
ERROR 6: Failed to add field named 'a_aspect_y_sum'
ERROR 6: Failed to add field named 'b_basinmask'
ERROR 6: Failed to add field named 'gvr_cell_id'
ERROR 6: Failed to add field named 'hru_area_m2'
ERROR 6: Failed to add field named 'cell_area_m2'
ERROR 6: Failed to add field named 'gvr_cell_pct'
ERROR 6: Failed to add field named 'gvr_hru_pct'

I think this error may cause the failure of running GSFLOW. The last part (running GSFLOW) of goGSFLOW.py was not successfully run. Those are the our records of running PRMS:

WARNING: parameter 'adj_by_hru' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 23109
WARNING: pt_alpha[0] = 0.750000 is out of range (1.000000 to 2.000000); file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 33503

WARNING: parameter 'mnsziter' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 40376

WARNING: parameter 'szconverge' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 40383

WARNING: parameter 'print_freq' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 43456

WARNING: parameter 'print_type' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 43463
ERROR - CHECK_ani_vars: sat_recharge is not a valid animation output variable.
Set animation variables: sat_recharge is not a valid stat variable.

I used the latest example of Cannon. The version of GRASS GIS is 7.6 of Ubuntu. Maybe those problem can be own to the unstable GRASS GIS on ubuntu?

2 Settings files?

There is a Settings.ini file in with the Domain Builder. It has different format than the one in the Run folder. Should these be the same? Are they both necessary?

Error with settings.ini file

I created a settings.ini file based on the template provided. However, when I try to run buildDomainGrass.py using the GRASS terminal, I receive the following message "Error opening or parsing input file." I am a brand new GRASS GIS user, and my python experience is largely from using ArcGIS. I am having trouble identifying the source of the above error. Could you please take a look at my input file and provide guidance and/or feedback? I am using GRASS 7.4.4 and Python 2.7.15. Thanks.

A link to my input file is here: https://github.com/jaeisma08/GSFLOW-GRASS-test/blob/master/settings.ini

Docker-compose fails at install tzdata

Run docker-compose build from within gsflow-grass-docker folder and get the following error. Running Ubuntu 18.04.1. Could be a problem with my environment.

Building gsflow_grass
Step 1/17 : FROM ubuntu:18.10
 ---> 9dc19675e327
Step 2/17 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 8876b44ce55c
Step 3/17 : USER root
 ---> Using cache
 ---> 1c4315854a5f
Step 4/17 : RUN useradd -m -s /bin/bash mezcla
 ---> Using cache
 ---> cb011c3a9dbf
Step 5/17 : RUN apt update && apt install tzdata
 ---> Running in 7e0b4361e56e

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Ign:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease
Err:2 http://security.ubuntu.com/ubuntu cosmic-security Release
  404  Not Found [IP: 91.189.91.39 80]
Ign:3 http://archive.ubuntu.com/ubuntu cosmic InRelease
Ign:4 http://archive.ubuntu.com/ubuntu cosmic-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu cosmic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu cosmic Release
  404  Not Found [IP: 91.189.88.142 80]
Err:7 http://archive.ubuntu.com/ubuntu cosmic-updates Release
  404  Not Found [IP: 91.189.88.142 80]
Err:8 http://archive.ubuntu.com/ubuntu cosmic-backports Release
  404  Not Found [IP: 91.189.88.142 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' do                                                                                                                                             es not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic Release' does not hav                                                                                                                                             e a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-updates Release' does                                                                                                                                              not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-backports Release' do                                                                                                                                             es not have a Release file.
ERROR: Service 'gsflow_grass' failed to build: The command '/bin/sh -c apt updat                                                                                                                                             e && apt install tzdata' returned a non-zero code: 100

Error: v.stream_inbasin()

I used a new california_dem.zip DEM file to Run buildDomainGRASS.py, some error occured. There is something wrong with the extension v.stream_inbasin. There are no area features in the temporary files

Default clipping with dissolved clip map.
-------------------------------------------------------------------------
Warning:No 'column' option specified. Dissolving based on category values
         from layer <1>.
Extracting features...
Building topology for vector map <temp_32268@PERMANENT>...
Registering primitives...
Writing attributes...
Removing duplicate centroids...
Building topology for vector map <temp_32268@PERMANENT>...
Registering primitives...
Copying vector features from <basins_all@PERMANENT>...
 100%
Copying vector features from <temp_32268@PERMANENT>...
Error:No area features found in vector map <temp_32268@PERMANENT>.
         Verify 'btype' parameter.
Error:Clipping steps failed. Check above error messages and see
         following details:
         Module run None ['v.overlay', 'binput=temp_32268', 'operator=and',
         'olayer=0,1,0', 'ainput=basins_all', 'output=basins_inbasin']
         ended with error
         Process ended with non-zero return code 1. See errors in the
         (error) output.

buildDomainGRASS.py

  1. Using the g.extensions command: I can get extensions with GRASS 7.2.2 but not with 7.3, the version recommended in the Readme.

  2. There is an additional settings.ini file in the Domain builder folder I think it's an old format. Do I need to do anything with this or can it be eliminated? If so it should be outlined in the readme.

  3. When I run buildDomainGRASS.py it gives an error on line 14 importing readsettings:

Traceback (most recent call last):
File "D:\GSFLOW\Pre_processor_codes\Shullcas_8_GSFLOW-
GRASS\domain_builder\buildDomainGRASS.py", line 14, in

from readSettings import Settings
ImportError: No module named readSettings
(Wed Nov 29 16:43:18 2017) Command finished (0 sec)

Maybe my current directory is wrong because I seem to have problems locating the correct files here and in the next issue.
To temporarily work around I drop a copy of readSsettings.py into the domain builder folder.

  1. Looks like the name 'Settings_AW.ini' and the Linux \ slashes are hard coded on line 11 of buildDomainGRASS.py.
    When I try and run this script from GRASS is cannot find Settings_AW.ini...even when I change the names? Again maybe it is an issue which what is supposed to be the current directory? Error:

D:\GSFLOW\Pre_processor_codes\Shullcas_8_GSFLOW-GRASS\domain_builder\buildDomainGRASS.py
Error opening or parsing input file: ../Run/settings_AW.ini
Using specified input file: ../Run/settings_AW.ini
(Wed Nov 29 16:29:22 2017) Command finished (0 sec)

I temporarily work around by giving a full path for my settings file but then I mess other stuff up and get more errors with the settings stuff.

Params from and pt_alpha

I think there is an error in how pt_alpha is assigned in printPRMSparamfile.py . A basic pt_alpha value is assigned for the whole array. The number of entries = nhru*nmonths. This part is fine. There are the correct number of values so no error is raised. However when assigning different values of pt_alpha for high elev barren, it's only done for the first month (Jan) so the rest of the values remain as the default.

GrassError: Error running: `r.cell.area --interface-description`

Hi, while building my domain I keep getting an error whith r.cell.area. I've tested the module r.cell.area standalone and it works perfectly
I'm currently on
GrassGIS 7.6.14
python 2.7.14
gsflow 1.2.2

C:\Users\lenovo>python C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-master\domain_builder\buildDomainGRASS.py C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Using specified input file: C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing DEM and generating hydrologic correction
ATTENTION: Raster map <DEM_original_import> already exists and will be
overwritten
Importing raster map <DEM_original_import>...
100%
OSError error(None): None
Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-master\domain_builder\buildDomainGRASS.py", line 89, in
r.cell_area(output=cellArea_meters2, units='m2', overwrite=True)
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\shortcuts.py", line 59, in getattr
name.strip('').replace('', '.')))
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 530, in init
raise GrassError(str_err % self.name)
grass.exceptions.GrassError: Error running: r.cell.area --interface-description.

C:\Users\lenovo>

Visualization script instructions in Readme

When using plotMODFLOW.py, the Readme says use this syntax:
run (visualization_script).py (Settings File full path)
But I need to use something with at least one flag
run plotMODFLOW.py -i (Settings File full path) -p wtd -o TEST.mp4

Deprecated Windows run file?

In GSFLOW-GRASS/Run, is the following superceded by goGSFLOW.bat?
run_Python_GSFLOW_current_Win.bat
If so, should remove.

Python 3 upgrade needed

A number of issues have been cropping up that seem to be related to changes in library naming and structure. Much of this may be related to the Python 2-->3 transition, and the fact that GSFLOW-GRASS was built for Python 2.7. (This is in addition to any changes from newer versions of GRASS GIS.) From my initial pass through the code base, this will take some significant effort in building and restructuring. I am trying to decide whether continued support here is warranted, or is likely to become a major and unproductive time-suck as GSFLOW, GRASS, and Python continue to update and I am just one person who does not plan to use GSFLOW in the near future for his work. Thoughts and voluntary co-development appreciated!

Error with "r.cell.area" in buildDomainGRASS.py

I am using GRASS GIS 7.6+the example of Cannon+python 2.7.17
This is the error output:

python buildDomainGRASS.py G:\GSFLOW\input_tool_2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing raster map <DEM_original_import>...
Traceback (most recent call last):
File "buildDomainGRASS.py", line 89, in
r.cell_area(output=cellArea_meters2, units='m2',
overwrite=True)

File "D:\Program Files\GRASS GIS
7.6\etc\python\grass\pygrass\modules\shortcuts.py", line 59,
in getattr
name.strip('').replace('', '.')))

File "D:\Program Files\GRASS GIS
7.6\etc\python\grass\pygrass\modules\interface\module.py",
line 530, in init
raise GrassError(str_err % self.name)
grass.exceptions.GrassError: Error running: r.cell.area --interface-description.
Using specified input file: G:\GSFLOW\input_tool_2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing DEM and generating hydrologic correction
OSError error(None): None

It seems like there is something wrong with the calculation of DEM cell area. I don't have no idea about this. Should I change the verson of GRASS GIS from 7.6 into 7.4?

plotHRUvars.py issues

plotHRUvars.py
Line 125 was giving an error for the index being out of range. Changed the reference to i to i-1 and it seems to plot the right dates. So the line now reads:
_polys.append(ax.fill(_x, _y, facecolor=colors[i-1], edgecolor='k')[0])

  • As I mentioned before, unfortunately 1.2.2 has different names in the output csv so this should only work with 1.2.0.
  • No units on the colour bar.
  • Precip is plotted in inches, maybe we should convert to mm?
  • I see my sat_recharge is super high at first not necessarily a problem with the plotting script but not sure where this comes from?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.