예제 #1
0
     if os.path.exists(str(path_to_project) + "/" + "head_ogs_" + str(item) + "_" + str(which) + ".txt"):
         checker.append(True)
     else:
         checker.append(False)
 if all(checker) == True and checker != []:
     print("All time series have already been extracted. Continuing without checking if content is correct.")
 else:
     # extract the time series from the tec files
     print("Extracting time series...")
     extract_timeseries(path_to_project, which="mean", process="GROUNDWATER_FLOW")
 # extract the rfd curve
 time_time_series, recharge_time_series = extract_rfd(
     path=path_to_project, rfd=1
 )
 # plot the time series vs recharge
 plot_head_timeseries_vs_recharge(path=path_to_project)
 # write OGS input parameters in DataFrame, but don't return kf because it is ditrubuted
 Ss, time_step_size, time_steps = get_ogs_parameters(path_to_project, noKf=True)
 # load from a file with information about the generated field
 field_info = open(path_to_project + "/field_info" + ".dat", "r")
 for line in field_info:
     dim, var, len_scale, mean, seed, geomean, harmean, arimean = line.split()
 field_info.close()
 kf_geo = float(geomean)
 kf_har = float(harmean)
 kf_ari = float(arimean)
 S = Ss * aquifer_thickness
 T_in_geo = kf_geo * aquifer_thickness
 T_in_har = kf_har * aquifer_thickness
 T_in_ari = kf_ari * aquifer_thickness
 # make directory for results
"""
script to execute the extract_timeseries() from transect_plot.py.
"""

from transect_plot import extract_timeseries
import sys

try:
    path_to_project = sys.argv[1]
except IndexError:
    path_to_project = input("Insert path to project: ")

try:
    which = sys.argv[2]
    process = sys.argv[3]
    rfd = sys.argv[4]
    plot = sys.argv[5]
except IndexError:
    which = "mean"
    process = "GROUNDWATER_FLOW"
    rfd = 1
    plot = True

rfd = int(rfd)
extract_timeseries(path_to_project, which=which, process=process, rfd=rfd)

if plot == True:
    from transect_plot import plot_head_timeseries_vs_recharge

    plot_head_timeseries_vs_recharge(path_to_project, which=which)