opengridcc / opengrid-dev

Open source building monitoring, analysis and control
Apache License 2.0
26 stars 21 forks source link

Forecast.io #62

Closed JrtPec closed 9 years ago

JrtPec commented 9 years ago

Added a library + demo to use weather data from forecast.io.

The wrapper allows you to download multiple days in one query and returns the result in a Pandas Dataframe. Calculation of Degree Days is also included.

saroele commented 9 years ago

Works well!

@JrtPec I have done some small changes in the demo notebook and merged. I did not yet check the code of the wrapper itself. Also maybe there is some functionality that is not demonstrated in the notebook?

JrtPec commented 9 years ago

I could add a small part explaining the tz argument: standard the dataframe is returned localised to the timezone of the requested location, but you could set tz to something else (eg. 'UTC') to get the dataframe localised to another timezone.

Other than that, there are basically two objects: Weather_Hours and Weather_Days, they differ in the resolution of the data. They both also have slightly different fields (because thats what Forecast returns). Weather_Days include calculated Degree Days.

Other than that it could be stressed just how cool the location field is: you could pass it any location string you would type into Google Maps and it will evaluate it. You could access Weather_Days.location, which is a geolocator object to check all details, coördinates etc.

(just putting it all here so I can add it to the demo later)

JrtPec commented 9 years ago

Future development might include another wrapper that saves historical data, because Forecast only allows 1000 requests per day so you can only download about 2,5 years worth of data per day.