I’m taking a shot in the dark that someone can guide me with this. I’ve just started working on this and information is not so easy to find. I have a python code that simulates land use change and can output arcgis raster images. The watershed model SWAT uses these images to calculate land use parameters generating streamflow quantities. I have the source code for SWAT, it’s written in fortran. I’m basically asking how to talk with SWAT using my python code. SWAT uses txt files to compile the watershed model. I need to intercept SWATs writting of txt files with my simulated land use rasters…over and over again for each yearly change of land use. I don’t know where to start so any advice on the process would be greatly appreciated.
Thanks!
I’m taking a shot in the dark that someone can guide me with this.
Share
SWAT is probably written to run non-interactively (in “batch” mode). If it generates lots and lots of files with a single call, your program can read them in and process them. If it needs to be called a lot of times to generate your results, you can call SWAT from your python program. Figure out how the command line options (or control file) that SWAT needs, then take a look at the python module
subprocess.