electricitymaps / electricitymaps-contrib

The open source repository for Electricity Maps App and data parser that enables a real-time visualisation of the CO2 emissions of electricity consumption
https://app.electricitymaps.com
GNU Affero General Public License v3.0
3.59k stars 946 forks source link

Åland / carbon intensity of zones fully powered by imports #883

Closed Bjarkigd closed 6 years ago

Bjarkigd commented 6 years ago

The Åland utility http://www.kraftnat.aland.fi/ However it says "Förändringar i bakomliggande system gör att statistiken inte visas rätt för tillfället." Which means that due to system work in the background the current stats aren't shown atm.

Yesterday's (and further back) data http://www.kraftnat.ax/text2.con?iPage=24&iLan=1

However http://www.fingrid.fi/en/Pages/default.aspx has the live import data from Sweden to Åland, and the rest which is local is wind production http://www.allwinds.ax/vindkraftverken/?lang=en (no live data what I can find)

Not much to go on, but it's a start.

corradio commented 6 years ago

This looks terrific. Don't we all all we need in order to write a parser?

systemcatch commented 6 years ago

Once kraftnat's stats start working again we should be good to go. @Bjarkigd do you want to write this parser?

Bjarkigd commented 6 years ago

I have to be honest and say that I have no idea at all about how to do that, I've no coding skills or experience at all, zilch, zero nada.

systemcatch commented 6 years ago

That's fair enough, would you be prepared to contact them about live wind generation data? They have it on http://www.kraftnat.ax/text2.con?iPage=28&iLan=1 but it's in an image format which is hard to scrape. Contact page is here.

Bjarkigd commented 6 years ago

I could do that

7hibault commented 6 years ago

@Bjarkigd If you get an answer from them, I could help with the coding part

tmslaine commented 6 years ago

I think it is possible to parse the Åland power generation figures from that image, which is updated every 30 seconds. stamnat

My idea was to use numpy and Image from PIL, recolor everything blue([0,0,255] in RGB) black and everything else white in the image, and scrape pixel masks for each digit and the decimal dot. Then one tries to fit these masks where the numbers appear on the image. I got it working but not very robust with respect to flow directions. My guess is that the arrow directions change if the flows reverse in which case the flow directions would also be machine readable using similar ideas.

http://194.110.178.135/grafik/stamnat.php is a source for the raw image On deciphering the image:

Did Kraftnät Åland have live generation statistics on the front page? The background changes breaking statistics might also refer to their monthly electricity graph, which does not show updates after mid-January: http://194.110.185.12/graphmonth1.php The monthly graphs strongly hint that any production that is not wind or fossil is renewable(förnyelsebar). The prime suspect for other generation is the 2.1 MW wood CHP plant owned by Mariehamns Bioenergi, according to Finnish Energy Industry Association's district heating statistics. It is possible that there is some solar or tidal generation, but for now assuming that other generation is 100% biomass based is my best guess.

tmslaine commented 6 years ago

Some supportive documents for mapping all fossil production as 'oil': Of the 44.8 MW "gasturbin" capacity

tmslaine commented 6 years ago

Some additional info from the data provider via email:

It should be easy to modify the logic of the parser, will make PR soon.

jarek commented 6 years ago

It is a bit concerning that we don't know some of the generation. Is fossil or biomass production significant on a monthly/yearly scale?

tmslaine commented 6 years ago

Fossil we can read, and all of it is diesel generators or gas turbines using fuel oil.

Some daily production/import statistics from last months, until January: Blue is import from Sweden, Yellow import from Finland, Red fossil production, Green renewables http://194.110.185.12/graphmonth6.php http://194.110.185.12/graphmonth5.php http://194.110.185.12/graphmonth4.php http://194.110.185.12/graphmonth3.php http://194.110.185.12/graphmonth2.php We see that imports dominate renewables, and that renewable production fluctuates a lot between days. My guess is that renewables is mostly wind.

corradio commented 6 years ago

@tmslaine if I understand correctly,

Hence my question: what is renewable but not wind nor biomass? or to put it differently: why can't we assume that unknown is biomass?

tmslaine commented 6 years ago

As oil+wind+imports already gives a higher number than the shown consumption, I think the amount of other generation must be quite marginal. We can of course assume that other generation is biomass, but we do not have data, or any way to estimate how much it produces.

corradio commented 6 years ago

If oil+wind+imports > consumption, doesn't it suggest something is wrong with the numbers? Is there anyone we can contact to get some confirmation?

tmslaine commented 6 years ago

I inquired Kraftnät Åland about it already, the response was:

corradio commented 6 years ago

I'm still puzzled about the unknown part. If oil, wind and imports are a good estimate for consumption, where does it leave the unknown part (currently assumed to be biomass)? Based on the data, it doesn't seem to be negligible.

tmslaine commented 6 years ago

The old logic is based on two false assumptions:

With these assumptions in place, unknown production is calculated in the live version as the portion of (reported cons.+exports) that is not covered by oil, wind and imports

Now that we know that Gustavs is import and the reported consumption is a couple of MW off, the best guess with available data is to define oil+wind+imports(incl. Gustavs) = consumption

Say the flow from Gustavs was 5 MW and the calculated unknown production was 7 MW. Changing the interpretation of Gustavs from -5 MW to 5 MW adds 10 MW to the energy balance. Redefining consumption as oil+wind+imports yields roughly 3 MW larger than reported consumption, therefore all of "unknown production" is in fact explained by import from Finland.

corradio commented 6 years ago

Got it! If I understood correctly, the "unknown" part can't actually be relied upon as it is based on the consumption value which is not precisely enough measured. Will approve the PR :)

jarek commented 6 years ago

Has this been fully fixed now @tmslaine ?

tmslaine commented 6 years ago

Åland is now showing as correctly as possible given the available data. There is a front end bug that gives no CO2 intensity when all electricity is imported but otherwise this issue has been fixed.

systemcatch commented 6 years ago

I think we still assume the direction of flow in the exchanges? But Åland is unlikely to be exporting any electricity so I think you can close this @tmslaine, thank for your help on this.

corradio commented 6 years ago

@tmslaine what bug are you talking about exactly?

tmslaine commented 6 years ago

I think the CO2 intensity calculations show NaN when the parser returns 0.0 MW generation for an area. For bigger areas this is an OK approach, but for small zones with capability to import all needed electricity there could be an exception to this rule that calculates the CO2 intensity based purely on the CO2 intensity of imports. Last weekend for example there were times when Åland was shown as grey because all available electricity was imported.

corradio commented 6 years ago

ok. Let's leave that issue opened then. Can you post a screenshot with the time visible when you see it next time? That way we'll be able to debug it.

On Wed, Mar 14, 2018 at 4:37 PM, tmslaine notifications@github.com wrote:

I think the CO2 intensity calculations show NaN when the parser returns 0.0 MW generation for an area. For bigger areas this is an OK approach, but for small zones with capability to import all needed electricity there could be an exception to this rule that calculates the CO2 intensity based purely on the CO2 intensity of imports. Last weekend for example there were times when Åland was shown as grey because all available electricity was imported.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tmrowco/electricitymap/issues/883#issuecomment-373066116, or mute the thread https://github.com/notifications/unsubscribe-auth/ABlEKPO0qg1CrryJi__G0WC_uF222jAsks5teTksgaJpZM4QxVzL .

jarek commented 6 years ago

This happened at 17 March 2018 09:45 CET:

aland no local production

corradio commented 6 years ago

I've pushed a potential fix. Let's see if it works.

jarek commented 6 years ago

Seems to still be happening, e.g. at 21.03.2018 01:00 CET

corradio commented 6 years ago

Indeed you're right:

This will require a bit more investigation then.

On Wed, Mar 21, 2018 at 8:25 PM, jarek notifications@github.com wrote:

Seems to still be happening, e.g. at 21.03.2018 <21%2003%2020%2018> 01:00 CET

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tmrowco/electricitymap/issues/883#issuecomment-375066383, or mute the thread https://github.com/notifications/unsubscribe-auth/ABlEKMPHxllU1vVaS9pCY8WqOyoXU3GVks5tgqkUgaJpZM4QxVzL .

jarek commented 6 years ago

On the other hand, there are zones where no own production and supply only from imports is an error, e.g. Croatia right now:

hr

And this also happens when a central European country doesn't report their own production but the neighbours report exchanges (e.g. Austria, Switzerland). In those cases the carbon intensity should remain as unknown.

I'm thinking now that a possible way to solve this would be to have a minimum "valid" MW/GW supply/load level configurable in the zone config. Then backend can compare with that to see if it's likely that there is indeed no local production.

corradio commented 6 years ago

We have opened a backend issue to fix this

corradio commented 6 years ago

Fixed!