예제 #1
0
파일: intro03.py 프로젝트: waternk/PyHSPF
hspfmodel.add_timeseries('evaporation', 'hunting_evap', start, evap, tstep=60)
hspfmodel.add_timeseries('flowgage', 'hunting_flow', start, oflow, tstep=60)

# and assign the watershed time series to all the operations

hspfmodel.assign_watershed_timeseries('precipitation', 'hunting_prec')
hspfmodel.assign_watershed_timeseries('evaporation', 'hunting_evap')

# assign the flowgage to the subbasin 30 (the outlet)

hspfmodel.assign_subbasin_timeseries('flowgage', '30', 'hunting_flow')

# this simulation used the hydrology modules (and no others); need to set the
# operations for the watershed and default values for the hydrology parameters

hspfmodel.add_hydrology()

# this example will stop here by pickling the hspfmodel for later--since the
# model will be run many times it just makes sense to save the work so far
# before moving on.

with open('example03', 'wb') as f:
    pickle.dump(hspfmodel, f)

print('\nsuccessfully created new model "example03."\n')

# the Watershed class has a plot method to show the mass linkages for the
# model; this case can be useful for complicated networks

watershed.plot_mass_flow(show=True, output='masslink')
예제 #2
0
# Build the model
hspfmodel = HSPFModel(units='Metric')

filename = 'siletz_river'

outfile = filename + '.out'

wdmoutfile = filename + '_out.wdm'

hspfmodel.build_from_watershed(watershedSiletz,
                               'siletz_river',
                               ifraction=ifraction,
                               tstep=tstep,
                               print_file=outfile)

watershedSiletz.plot_mass_flow(output='siletz_basin_network')

# ADD TIME SERIES DATA: PRECIP, PET, and FLOW TO THE WDM FILE
pcpData = pd.read_csv(
    os.path.abspath(os.path.curdir) + '\\siletz_HSPF_precip.csv')

petData = pd.read_csv(
    os.path.abspath(os.path.curdir) + '\\siletz_HSPF_pet.csv')

flwData = pd.read_csv(
    os.path.abspath(os.path.curdir) + '\\siletz_HSPF_flw.csv')

ts_to_wdmFile(wdmFile=wdmFile,
              pcpData=pcpData,
              petData=petData,
              flwData=flwData)
예제 #3
0
파일: intro03.py 프로젝트: djibi2/PyHSPF
                         tstep = 60)
hspfmodel.add_timeseries('flowgage', 'hunting_flow', start, oflow, 
                         tstep = 60)

# and assign the watershed time series to all the operations

hspfmodel.assign_watershed_timeseries('precipitation', 'hunting_prec')
hspfmodel.assign_watershed_timeseries('evaporation',   'hunting_evap')

# assign the flowgage to the subbasin 30 (the outlet)

hspfmodel.assign_subbasin_timeseries('flowgage', '30', 'hunting_flow')

# this simulation used the hydrology modules (and no others); need to set the
# operations for the watershed and default values for the hydrology parameters

hspfmodel.add_hydrology()

# this example will stop here by pickling the hspfmodel for later--since the
# model will be run many times it just makes sense to save the work so far
# before moving on.

with open('example03', 'wb') as f: pickle.dump(hspfmodel, f)

print('\nsuccessfully created new model "example03."\n')

# the Watershed class has a plot method to show the mass linkages for the 
# model; this case can be useful for complicated networks

watershed.plot_mass_flow(show = True, output = 'masslink')