OSUKED / ElexonDataPortal

Python wrapper for the Elexon/BMRS API
https://osuked.github.io/ElexonDataPortal
MIT License
52 stars 14 forks source link

Question about *Wind generation data* provided by BMRS #30

Open LuisTellezSirocco opened 9 months ago

LuisTellezSirocco commented 9 months ago

Hello,

I have a question about the use of this API, when I was downloading data from the API, I noticed some abrupt ups and downs in the data.

For example, with the following code:

start_date = '2024-01-21'
end_date = '2024-01-23'

data = client.get_B1630(start_date, end_date)
data.drop_duplicates(inplace=True)
data['quantity'] = data['quantity'].astype('float32')

api_bmrs = data.groupby(['local_datetime', 'businessType']).agg({'quantity': 'sum'}).squeeze().unstack().reset_index(drop=False).copy()
api_bmrs = api_bmrs.melt(id_vars='local_datetime', value_vars=['Solar generation', 'Wind generation'], var_name='TYPE', value_name='GENERATION')
api_bmrs['API'] = 'BMRS_github'

I have compared it with the new API to find out if it was the fault of the previous version and no, I get exactly the same response. However, when I look at the historical data provided by Elexon, I see some inconsistencies with the data provided via API. (Note that I may be comparing data at the beginning of the period and data at the end of the period, but that is not a problem)

Captura de pantalla 2024-02-13 a las 14 04 20

Can anyone shed some light on why this happens?

peterdudfield commented 8 months ago

Hi @LuisTellezSirocco

So good that Blue and Green match! The new and old elexon apis.

Red does look a bit different

  1. Firstly it looks 1 hour out, this could be becasue its UTC not localtime
  2. It might include some extra embedded wind, which does come up through elexon. Im not quite sure on the full details of this though.