hackcollective / wind-curtailment

10 stars 4 forks source link

UK Wind Curtailment Monitor

Exploring the wind power that the UK is discarding due to transmission constraints

https://wind-curtailment-app-ahq7fucdyq-lz.a.run.app/

Methodology

By pulling data from Elexon, we combine FPNs, BOALS, and BOD to see the effects of wind curtilament

More details are here

Data

We use the Elexon API to get data. See scripts/fetch_data.py. This is saved to an SQLite DB. Note that raw data is also saved as feather files to ./data/PHYBM/raw.

Analysis

Run scripts/calculate_curtailment.py to run the analysis against the SQLite DB.

Notebooks

There's some old analysis in scripts and notebooks/curtailment.ipynb, mostly useful for identifying the right day to focus on.

Prototype is in notebooks/bidoffer.ipynb.

Might need to run export PYTHONPATH=${PYTHONPATH}:/lib to get the lib in to your python path

App

simple streamlit app can be run using streamlit run main.py

image

ETL

Fast API app that can be called to fetch data from Elexon and save to a database.

Deployment

App is deployed via GH Actions to GCP Cloud Run.

In the Github workflow

Depends upon a single deploy secret (GLOUD_AUTH) which is in Secrets > Actions in Github, and is a base64 encoded version of the default service account credentials in GCP.

FAQs

BM units

Q: How do we make sure new BM units are being used?

A: Currently we manually update them every 6 months (or so). This is done by running the scripts/update_bm_units.py script. This script will fetch the latest BM units from the Elexon API and the update the csv in data/BMU.csv.

TODO