-
Notifications
You must be signed in to change notification settings - Fork 53
Getting Started
To use PyHSPF, you will need to be comfortable with Python scripting and some basic Python programming concepts. If you don't have any experience with Python, there are tons of free online resources. You will need to be comfortable with lists, dictionaries and some basic object-oriented programming concepts to understand the example scripts.
Many example scripts make use of the built-in Python pickle, os, and datetime modules. "Pickling" provides a mechanism for saving class instances to a file, which is important given that PyHSPF uses classes to store many different kinds of data. The operating system (os) module is needed to perform functions that vary on different operating systems such as checking the existence of files. The datetime module is essential to perform time series calculations such as the number of time steps between two dates. In addition to these basic Python concepts, the examples rely heavily on the third-party math plotting library (matplotlib) to generate graphical output for visualizing the data and other tasks performed by the example scripts. In general the example scripts assume familiarity with all of these modules.
If you are comfortable with Python and want to learn how to use PyHSPF, you might begin by going through the examples in the "intro" directory. PyHSPF is designed to use classes to accomplish tasks related to watershed modeling. Each class is designed to accomplish a specific task like interacting with an internet database, extracting information about land use or hydrography, or interacting in a specific way with the HSPF library. The amount of coding required to use the classes should be substantially less than what it takes to write a UCI file (that is the advantage of a high-level language). You will need to be comfortable with the concept of classes to really use PyHSPF to develop HSPF models.
What I hope to do is create an environment where you can add in your piece to the hydrology/water quality puzzle (new datasets, new calibration routines, different assumptions, etc.) and seamlessly integrate that piece with HSPF without having to develop an entirely new package. If you are interested in implementing advanced concepts into HSPF using Python, please contact me and I will help you figure out the easiest way to do it. For example, one thing I want to do is create time-variable land use--this would be impossible with the traditional UCI file = "the model" approach.
If you are unsure how to get started, please contact me directly.