Example #1
0
    last = current[:]
    current = []

    for c in hydroseqs:
        if flowlines[hydroseqs[c]].down in last:
            comids.append(c)
            current.append(hydroseqs[c])

print(('found {} flowlines including:\n'.format(len(comids))))
for c in comids:
    print(c)
print('')

# make an instance of the FtableCalculator to use for the data from the file

calculator = FtableCalculator(gageid)

# calculate log-log regressions of flow and width vs depth

calculator.calculate_regressions()

# get the length and average flow from the flowline VAAs

length = flowlines[hydroseqs[comid]].length
qref = flowlines[hydroseqs[comid]].flow * 0.3048**3

# calculate the FTABLE for the gage station using the length of the reach

ftable = calculator.create_ftable(length, units=units)

print(('FTABLE for gage station {}:\n'.format(comid)))
Example #2
0
# find the record indices of the comid and reach length in km in the file

i = [f[0] for f in reader.fields].index('LENGTHKM') - 1
j = [f[0] for f in reader.fields].index('COMID') - 1

# get the reach length and common identifier

length = record[i]
comid  = record[j]

it = comid, length
print('comid {} is closest to the gage and has a length of {} km\n'.format(*it))

# make an instance of the FtableCalculator to use for the data from the file

calculator = FtableCalculator(gageid)

# calculate log-log regressions of flow and width vs depth using the observed
# values from the NWIS database

calculator.calculate_regressions()

# calculate the FTABLE using the length of the reach and the regressions for:
#
# the width (surface area = width * length), 
# the volume (volume = width * depth * length)
# the discharge
#
# this approach utilizes all available data to infer discharge rate for a given
# depth of flow needed for continuous simulation
Example #3
0
i = [f[0] for f in reader.fields].index('LENGTHKM') - 1
j = [f[0] for f in reader.fields].index('COMID') - 1

# get the reach length and common identifier

length = record[i]
comid = record[j]

it = comid, length
print(
    'comid {} is closest to the gage and has a length of {} km\n'.format(*it))

# make an instance of the FtableCalculator to use for the data from the file

calculator = FtableCalculator(gageidpath)

# calculate log-log regressions of flow and width vs depth using the observed
# values from the NWIS database

calculator.calculate_regressions()

# calculate the FTABLE using the length of the reach and the regressions for:
#
# the width (surface area = width * length),
# the volume (volume = width * depth * length)
# the discharge
#
# this approach utilizes all available data to infer discharge rate for a given
# depth of flow needed for continuous simulation
Example #4
0
while len(current) > 0:
    last    = current[:]
    current = []

    for c in hydroseqs:
        if flowlines[hydroseqs[c]].down in last:
            comids.append(c)
            current.append(hydroseqs[c])

print('found {} flowlines including:\n'.format(len(comids)))
for c in comids: print(c)
print('')

# make an instance of the FtableCalculator to use for the data from the file

calculator = FtableCalculator(gageid)

# calculate log-log regressions of flow and width vs depth

calculator.calculate_regressions()

# get the length and average flow from the flowline VAAs

length = flowlines[hydroseqs[comid]].length
qref   = flowlines[hydroseqs[comid]].flow * 0.3048**3

# calculate the FTABLE for the gage station using the length of the reach

ftable = calculator.create_ftable(length, units = units)

print('FTABLE for gage station {}:\n'.format(comid))