"""This script writes a control file with empty values. This script must be located in the same directory as HeatSource_control.csv. NOTE that executing this script from Python shell (IDLE) will not identify __file__ correctly and will result in an error. It must be executed from a command prompt. Your options are to try to double click on this file and execute it using python.exe, or to open a command prompt and execute manually by typing: python -i path/to/this/script/HS9_Setup_Control_File.py""" from heatsource9.ModelSetup.Inputs import Inputs from os.path import abspath from os.path import dirname from os.path import join from os.path import realpath def getScriptPath(): """Gets the path to the directory where the script is being executed from.""" return abspath(join(dirname(realpath(__file__)), '.')) model_dir = getScriptPath() + '/' control_file = 'HeatSource_Control.csv' # create an input object inputs = Inputs(model_dir, control_file) # Write a blank control file inputs.parameterize_cf(overwrite=False)
inputs.parameterize_cf(overwrite=False, usertxt = "This model is an example model", name = "example model", inputdir = model_dir + r"inputs/", outputdir = model_dir + r"outputs/", length = 1.8, outputkm = "all", datastart = "05/06/2003", modelstart = "07/01/2003", modelend = "07/14/2003", dataend = "09/21/2003", flushdays = 1, offset = -7, dt = 1, dx = 30, longsample = 50, bcfile = "bc.csv", inflowsites = 4, inflowinfiles = "inflow_01.csv, inflow_02.csv, inflow_03.csv, inflow_04.csv", inflowkm = "1.65, 1.5, 1.3, 0.85", accretionfile = "accretion.csv", metsites = 4, metfiles = "met_01.csv, met_02.csv, met_03.csv, met_04.csv", metkm = "1.75, 1.45, 1.10, 0.9", calcevap = "False", evapmethod = "Mass Transfer", wind_a = 1.51E-09, wind_b = 1.6E-09, calcalluvium = "True", alluviumtemp = 12.0, morphfile = "morphology.csv", lcdatafile = "lcdata.csv", lccodefile = "lccodes.csv", trans_count = 8, transsample_count = 4, transsample_distance = 8, emergent = "True", lcdatainput = "Codes", canopy_data = "CanopyClosure", lcsampmethod = "point", heatsource8 = "False")
inputs.parameterize_cf( overwrite=False, usertxt="This model is an example model", name="example model", inputdir=model_dir + r"inputs/", outputdir=model_dir + r"outputs/", length=1.8, outputkm="all", datastart="05/06/2003", modelstart="07/01/2003", modelend="07/14/2003", dataend="09/21/2003", flushdays=1, offset=-7, dt=1, dx=30, longsample=50, bcfile="bc.csv", inflowsites=4, inflowinfiles="inflow_01.csv, inflow_02.csv, inflow_03.csv, inflow_04.csv", inflowkm="1.65, 1.5, 1.3, 0.85", accretionfile="accretion.csv", metsites=4, metfiles="met_01.csv, met_02.csv, met_03.csv, met_04.csv", metkm="1.75, 1.45, 1.10, 0.9", calcevap="False", evapmethod="Mass Transfer", wind_a=1.51E-09, wind_b=1.6E-09, calcalluvium="True", alluviumtemp=12.0, morphfile="morphology.csv", lcdatafile="lcdata.csv", lccodefile="lccodes.csv", trans_count=8, transsample_count=4, transsample_distance=8, emergent="True", lcdatainput="Codes", canopy_data="CanopyClosure", lcsampmethod="point", heatsource8="False")
"""DO NOT DELETE THIS FILE. This script imports the heatsource module and executes the model routines. This script must be located in the same directory as HeatSource_control.csv. NOTE that executing this script from Python shell (IDLE) will not identify __file__ correctly and will result in an error. It must be executed from a command prompt. Your options are to double click on this file and execute using python.exe, use the batch command files (which point to these files), or open terminal and execture manually by typing: python -i path/to/this/script/HS9_Setup_Control_File.py""" from heatsource9.ModelSetup.Inputs import Inputs from os.path import abspath from os.path import dirname from os.path import join from os.path import realpath def getScriptPath(): """Gets the path to the directory where the script is being executed from.""" return abspath(join(dirname(realpath(__file__)), '.')) model_dir = getScriptPath() + '/' control_file = 'HeatSource_Control.csv' # create an input object inputs = Inputs(model_dir, control_file) # Write a blank control file inputs.parameterize_cf(overwrite=False)