How to start PhytoBasinRisk? NO WARRANTIES! We disclaim any liability when starting the Python script "PhytoBasinRisk_100816b.py". The PhytoBasinRisk program implements the PhytoBasinRisk model (Mischke et al. 2016). Website and documentation: http://www.moneris.igb-berlin.de/index.php/phytobasinrisk.html Use PhytoBasinRisk.py --help for help on usage and simple examples. Please send bugs and feedback to: gericke@igb-berlin.de, mischke@igb-berlin.de License: Copyright (C) 2016-2018 by Andreas Gericke Ute Mischke Released under the Creative Commons license (CC BY-NC-SA 4.0), https://creativecommons.org/licenses/by-nc-sa/4.0/ No warranties are given. You may not use this software for commercial purposes. Suggested citations: U. Mischke, A. Gericke, M. Venohr 2018. PhytoBasinRisk v1.100816b, http://www.moneris.igb-berlin.de/index.php/phytobasinrisk.html U. Mischke, J. Mahnkopf, A. Gericke, M. Venohr 2016. Simulation of the effect of riparian shading and nutrient reduction measures on phytoplankton in Middle Elbe basin (Germany), MARS Basin Report Middle Elbe, In: D4.1 Case study synthesis, T. Fereira et al. 2016, MARS Final Report, 187–220, http://fis.freshwatertools.eu/index.php/elbe-havel-saale.html ------------------------------------------------------------------------------------------- How to start PhytoBasinRisk? Install Python 2.7 and libraries - see pdf-files "Requirements PhytoBasinRisk_engl.pdf" und "Model description PhytoBasinRisk_webpage.pdf" Das Starten des Python scripts wird über das commandline interface von Windows (CMD) oder in einer Linux-Shell ausgeführt, wobei auch die Quelle für die Inputdaten und Modellausgabe festgelegt werden :Engl The Python script is started from the commandline interface of Windows or a Linux shell, withwhich also the input and output database is specified- In diesem Beispiel-Befehl erfolgt ein Zugriff auf eine Access-Datenbank (nur lesend; Example_input_PBR_paraM.accdb) und das Ergebnis wird in PostgreSQL-Datenbank geschrieben :Engl In the example provided here, the input data is read from an Access-database (read only; Example_input_PBR_paraM.accdb) and the result is stored in a PostgreSQL database #DE_Engl Follow the steps: #DE Aufruf des Managementtools für PostgreSQL und Zugangsdaten für die Ausgabe-Datenbank eingeben ## Start the PostgreSQL admin tool and unlock the output database with your credentials #DE Aufruf des commandline interface von Windows (cmd.exe) #Engl Open the commandline interface of Windows (cmd.exe) #DE Gehe zum Ordner mit dem Script und der Input-Datenbank #Engl Go to the path with your script and input database cd C:\Users\~path #DE Kopiere folgenden Befehl #Engl Please copy the following command #DE Passe in diesem Befehl die Dateipfade an: Pfad zur python.exe, kompletter Pfad zur Input-Access-Datei und Pfad zur Output-Datenbank (hier localhost/ute) #Engl Adapt the file paths: path to python.exe, full path to the Access database (input) and path to the Output database (here localhost/ute) command: C:\Python27\python.exe PhytoBasinRisk_100816b.py -m pyodbc -o --driver "Microsoft Access Driver (*.mdb, *.accdb)" --dialect postgresql -c postgres:postgres --def_results basin_inflow --ts_in_mem --out_db localhost/ute c:\~path\Example_input_PBR_paraM.accdb au_characters ts_climate ts_nutr_date algal_class veloclass constant_values output_ #DE_EGL Start mit/with RETURN-key #DE WARTEN bis der Prompt / Cursor wieder erscheint #ENGL Wait until your promt /cursor appear again #DE Um mehr Details zu erhalten (e.g. Zwischenergebnisse) werden diese in eine Textdatei output.txt mit folgendem Argument umgeleitet -v oder -v -v -v (noch mehr Details), "> output.txt" am Ende der Befehlszeile #ENGL Additionally it is possible to print out interim results into a text file output.txt; add argument -v or -v -v -v (more details), use "> output.txt" after the command command with text-output: C:\Python27\python.exe PhytoBasinRisk_100816b.py -m pyodbc -o --driver "Microsoft Access Driver (*.mdb, *.accdb)" --dialect postgresql -c postgres:postgres --def_results basin_inflow --ts_in_mem -v -v -v --out_db localhost/ute c:\~path\Example_input_PBR_paraM.accdb au_characters ts_climate ts_nutr_date algal_class veloclass constant_values output_ -v > output.txt #DE ==> Hinweise auf optionale Argumente im Skript: - m pyodbc : nutze eine Python-Bibliothek für den Zugriff auf MS Access-Dateien -- driver wird von pyodbc verwendet, um Verbindung zur Datenbank herzustellen -o : überschreibe möglicherweise bestehenden Output --out_db : Ausgabe-Datenbank --dialect für Zugriff auf Ausgabe-Datenbank (über die sqlalchemy-Bibliothek) -c credentials / Zugangsdaten für Datenbank (nutzer, kennwort) -ts_in_mem : vorhalten der Zeitreihen im Speicher, erhöht die Geschwindigkeit, weil weniger Datenbankzugriffe --v (-v -v -v für mehr Details) mandatory: Eingangsdatenbank (nicht vergessen: Access benötigt den vollen Pfad!) Input-Tabellennamen Dateiname der Output-Tabelle (output_) Dateiname der detaillierten Text-Outputtabelle >output.txt (Achtung: wird überschrieben)