Tools for parsing control area load historical reports posted at <http://www.bctc.com/transmission_system/balancing_authority_load_data/historical_transmission_data.htm> (2010-02-08).
Object representing load at a given point in time. The object is iterable so that it can be unpacked:
>>> from datetime import datetime
>>> import pytz
>>> point = LoadPoint(pytz.utc.localize(datetime(2001, 1, 1)), 1000)
>>> t, load = point
>>> assert t == point.t
>>> assert load = point.load
Parameters: |
|
---|
Load in MW.
Return type: | int |
---|
Return type: | UTC offset-aware datetime.datetime |
---|
Yields control area LoadPoint objects with time t such that start_dt <= t < end_dt. By default all available data is returned. A manager object, if provided, gives advanced users the ability to use previously cached files to save download time.
Parameters: |
|
---|
>>> from bctc.load import LoadBookManager, yield_load_points
>>> from datetime import datetime
>>> import pytz
>>>
>>> # list of all available data points
>>> points = list(yield_load_points())
>>> assert len(points) > 10000
>>>
>>> # Create a list of all data for 2007 and use a manager
>>> # object to cache downloaded data for later usage.
>>> manager = LoadBookManager()
>>> start_dt = pytz.utc.localize(datetime(2007, 1, 1))
>>> end_dt = pytz.utc.localize(datetime(2008, 1, 1))
>>> points_2007 = list(yield_load_points(start_dt, end_dt, manager = manager))
>>> assert len(points_2007) > 10000
>>>
>>> # Create a new list of 2007 and 2008 points re-using the
>>> # 2007 data already stored by *manager* to save time.
>>> points_2007_and_2008 = list(yield_load_points(start_dt, end_dt, manager = manager))
>>> assert len(points_2007_and_2008) > 10000