def load_hydrograph(inputs):
    # Load in discharge file as a list
    DischargeFile = os.path.join(os.pardir,"Discharge_Files", inputs.DischargeFile)
    Qlist = open(DischargeFile).readlines()
    inputs.Qlist = map(lambda x: float(x), Qlist)
    
    # Create a duration curve from the list for setting up equilibrium floodplain
    # conditions and feed.  Other parameters can be customized (see ExtractDC function).
    Q = clsTimeSeries([],inputs.Qlist) 
    inputs.Qw, inputs.p = Q.CreateDurationCurve(inputs.HydroBins)
    
    return inputs
Beispiel #2
0
def load_hydrograph(inputs):
    # Load in discharge file as a list
    # Comment these out for variable Q
    #DischargeFile = os.path.join(os.pardir,"Discharge_Files", inputs.DischargeFile)
    #Qlist = open(DischargeFile).readlines()
    #inputs.Qlist = map(lambda x: float(x), Qlist)
    #    inputs.Qlist = inputs.Qlist[395:]

    # Create a duration curve from the list for setting up equilibrium floodplain
    # conditions and feed.  Other parameters can be customized (see ExtractDC function).
    #wholeQ = open(os.path.join(os.pardir, 'Discharge_Files', inputs.DischargeFile)).readlines()
    wholeQ = open(
        os.path.join(os.pardir, 'Discharge_Files',
                     inputs.DischargeFile)).readlines()
    wholeQ = map(lambda x: float(x), wholeQ)
    Q = clsTimeSeries([], wholeQ)
    inputs.Qw, inputs.p = Q.CreateDurationCurve(inputs.HydroBins)
    return inputs
Beispiel #3
0
def load_hydrographs(inputs):
    #Initialize lists
    inputs.Qlist = []
    inputs.Qw = []
    inputs.p = []

    for f in inputs.DischargeFiles:
        # Load discharge files as a lists
        DischargeFile = os.path.join(os.pardir, "Discharge_Files", f)
        print(DischargeFile)
        Qlist = open(DischargeFile).readlines()
        Qlist = list(map(lambda x: float(x), Qlist))
        binsize = (max(Qlist) - min(Qlist)) / inputs.NumberofHydroBins
        print('binsize = %s' % (binsize))
        # Create a duration curve from the list for setting up equilibrium floodplain
        # conditions and feed.  Other parameters can be customized (see ExtractDC function).
        Q = clsTimeSeries([], Qlist)
        Qw, p = Q.CreateDurationCurve(binsize)
        print('number of bins made = %s' % len(Qw))
        inputs.Qlist.append(Qlist)
        inputs.Qw.append(Qw)
        inputs.p.append(p)

    return inputs