Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.55 KB

README.md

File metadata and controls

28 lines (19 loc) · 1.55 KB

WeatherForecastStorage

A tool to collect weather forecasts from DarkSky for any number of cities in the world and store them in an SQL database. This is useful to run as an hourly (cron) job.

DarkSky provides forecasts for many kinds of sensors (e.g. temperature, wind speed) up to 24 hours ahead. However, they do not store these forecasts for later retrieval. For past data, you'll only get actual measurements from their API. To train and test any forecasting model, you'll need actual forecasts and this tool helps you automate their collection.

We save the forecasts based on a data model provided by the TimelyBeliefs package. This model connects sensors (which are automatically created for you) to forecasts (beliefs), and keeps track of event time and belief time.

Setup

  1. (optional) install / activate a virtual environment
  2. export PYTHONPATH=/your/path/to/weatherforecaststorage
  3. pip install -r requirements.txt
  4. cp config/configuration.ini.sample config/configuration.ini
  5. Adjust database connection string in config/configuration.ini
  6. Also adjust in this config file which cities you want to get forecasts for (an extensive list of cities worldwide is available in data/City_geolocation-en-v2.csv)
  7. Create a sensor/location lookup table: python -c "from weatherforecast.utils import helping_tables_utility; helping_tables_utility.create_sensor_location_id_mapping_table()"

Generate forecasts

Run this command to generate forecasts:

python weatherforecast/get_new_forecasts.py