Example #1
0
        # remove datasets with no observations during the requested period

        observations = [v for v in data if v is not None]

        if len(observations) > 0:

            # add the data to the dictionary

            evaporation[v['name']] = data

print('')

# the ETCalculator class uses the Penman-Monteith Equation to estimate
# evapotranspiration time series; let's make an instance to use

calculator = ETCalculator()

# the ETCalculator makes use of hourly and daily time series that must be
# supplied externally as:
#
#   1. time series type (temperature, dewpoint, humidity, wind, solar, etc)
#   2. time step step ("daily", "hourly", or size in minutes, e.g., 60, 1440)
#   3. start time
#   4. list of data values
#
# note these are the same formats used by the PyHSPF HSPFModel class
# so now we can add the daily timeseries from above

calculator.add_timeseries('tmin', 'daily', start, tmin)
calculator.add_timeseries('tmax', 'daily', start, tmax)
calculator.add_timeseries('dewpoint', 'daily', start, dewt)