Esempio n. 1
0
# import the ClimateProcessor and PyShp reader

from pyhspf.preprocessing import ClimateProcessor
from shapefile            import Reader

# path to existing shapefile defining the data region and processing information

filename = 'subbasin_catchments'

if not os.path.isfile(filename + '.shp'):
    print('error, {} does not exist!'.format(filename))
    raise

# create an instance of the ClimateProcessor class

processor = ClimateProcessor()

# working directory location for all the data files

output = 'HSPF_data'  

if not os.path.isdir(output): os.mkdir(output)

# working directory for aggregated precipitation files

directory = '{}/subbasinprecipitation'.format(output)

if not os.path.isdir(directory): os.mkdir(directory)

# start and end dates (aggregate the whole 31 years)