From d26c53831b140384e7dfe62e726a3f759b6d9806 Mon Sep 17 00:00:00 2001 From: Olivier Corradi Date: Mon, 12 Sep 2016 19:25:43 +0200 Subject: [PATCH] Heuristic for estimating breakdown of DE --- backend/parsers/DE.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/parsers/DE.py b/backend/parsers/DE.py index 6466f9381c..041a2eea21 100644 --- a/backend/parsers/DE.py +++ b/backend/parsers/DE.py @@ -14,7 +14,7 @@ def fetch_DE(): parsed = {} for s in re.findall('{"id":"(.*?)",.*?,"data":(.*?)(,"|})', body): parsed[s[0]] = json.loads(s[1])[-1] - # We here assume a constant nuclear production of 7.7GW + data = { 'countryCode': COUNTRY_CODE, 'datetime': arrow.get(parsed['wind'][0] / 1000.0).datetime, # UTC @@ -22,7 +22,8 @@ def fetch_DE(): 'wind': parsed['wind'][1], 'solar': parsed['solar'][1], 'biomass': parsed['biomass'][1], - 'nuclear': 7700 + 'nuclear': 10000, + 'coal': 15000 }, 'consumption': { 'other': parsed['total-load'][1] @@ -30,7 +31,10 @@ def fetch_DE(): } if parsed['run-of-the-river'][1] and parsed['conventional-power'][1]: - data['production']['other'] = -7700 - parsed['run-of-the-river'][1] + parsed['conventional-power'][1] + hard_coal_and_gas = parsed['conventional-power'][1] - data['production']['coal'] - data['production']['nuclear'] - parsed['run-of-the-river'][1] + data['production']['coal'] += 17.0/25.0 * hard_coal_and_gas + data['production']['gas'] = 5.0/25.0 * hard_coal_and_gas + data['production']['other'] = 3.0/25.0 * hard_coal_and_gas return data