Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Honduras (real-time total production) #2136

Merged
merged 6 commits into from Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -112,7 +112,8 @@ Real-time electricity data is obtained using [parsers](https://github.com/tmrowc
- Great Britain: [ENTSOE](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html)
- Great Britain (Orkney Islands): [SSEN](https://www.ssen.co.uk/ANM/)
- Greece: [ENTSOE](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html)
- Guatemala : [AMM](http://www.amm.org.gt)
- Guatemala: [AMM](http://www.amm.org.gt)
- Honduras: [ENTE](https://www.enteoperador.org/flujos-regionales-en-tiempo-real/)
- Hungary: [ENTSOE](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html)
- Iceland: [LANDSNET](https://amper.landsnet.is/generation/api/Values)
- Ireland: [ENTSOE](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html)
Expand Down Expand Up @@ -240,6 +241,7 @@ Production capacities are centralized in the [zones.json](https://github.com/tmr
- Great Britain: [ENTSO-E](https://transparency.entsoe.eu/generation/r2/installedGenerationCapacityAggregation/show)
- Greece: [ENTSO-E](https://transparency.entsoe.eu/generation/r2/installedGenerationCapacityAggregation/show)
- Guatemala: [AMM](http://www.amm.org.gt/pdfs2/2017/Capacidad_Instalada_2017.xls)
- Honduras: [ENEE](http://www.enee.hn/planificacion/2018/boletines/Boletin%20Estadistico%20Mes%20de%20Septiembre%202018%20PDF.pdf)
- Hungary
- Solar: [IRENA](http://resourceirena.irena.org/gateway/countrySearch/?countryCode=HUN)
- Other[ENTSO-E](https://transparency.entsoe.eu/generation/r2/installedGenerationCapacityAggregation/show)
Expand Down
7 changes: 7 additions & 0 deletions config/co2eq_parameters.json
Expand Up @@ -316,6 +316,13 @@
"value": 178.67099686684926
}
},
"HN": {
"unknown": {
"_url": "https://www.iea.org/data-and-statistics?country=ISRAEL&fuel=Electricity%20and%20heat&indicator=Electricity%20generation%20by%20source",
"source": "IEA 2017, assumes 36.5% oil, 33.4% hydro, 10.0% solar, 8.1% biomass, 6.2% wind, 5.8& oil",
"value": 316
}
},
"HR": {
"unknown": {
"source": "2018 average estimated from https://www.hops.hr/page-file/oEvvKj779KAhmQg10Gezt2/temeljni-podaci/Temeljni%20podaci%202018.pdf",
Expand Down
29 changes: 29 additions & 0 deletions config/zones.json
Expand Up @@ -1778,6 +1778,35 @@
},
"timezone": null
},
"HN": {
"bounding_box": [
[
-90.5131,
13.0290
],
[
-82.4981,
17.4603
]
],
"capacity": {
"biomass": 210,
"coal": 135,
"geothermal": 35,
"hydro": 706,
"nuclear": 0,
"oil": 875,
"solar": 451,
"wind": 225
},
"contributors": [
"https://github.com/alixunderplatz"
],
"parsers": {
"production": "ENTE.fetch_production"
},
"timezone": "America/Tegucigalpa"
},
"HR": {
"bounding_box": [
[
Expand Down
23 changes: 22 additions & 1 deletion parsers/ENTE.py
Expand Up @@ -20,6 +20,25 @@
"CR->NI": "5SISTEMA.LT230.INTER_NET_CR.CMW.MW",
"CR->PA": "6SISTEMA.LT230.INTER_NET_PAN.CMW.MW"}

def fetch_production(zone_key='HN', session=None, target_datetime=None, logger=None):
# Total production data for HN from the ENTE-data is the 57th element in the JSON ('4SISTEMA.GTOT.OSYMGENTOTR.-.MW')

r = session or requests.session()
response = r.get(DATA_URL).json()
production = round(response[56]['value'], 1)

dt = arrow.now('UTC-6').floor('minute')

data = {
'zoneKey': zone_key,
'datetime': dt.datetime,
'production': {
'unknown':production
},
'source': 'enteoperador.org'
}

return data

def extract_exchange(raw_data, exchange):
"""
Expand Down Expand Up @@ -66,7 +85,7 @@ def fetch_exchange(zone_key1, zone_key2, session=None, target_datetime=None, log
s = session or requests.Session()

raw_data = s.get(DATA_URL).json()
flow = extract_exchange(raw_data, sorted_zones)
flow = round(extract_exchange(raw_data, sorted_zones), 1)
dt = arrow.now('UTC-6').floor('minute')

exchange = {'sortedZoneKeys': sorted_zones,
Expand All @@ -79,6 +98,8 @@ def fetch_exchange(zone_key1, zone_key2, session=None, target_datetime=None, log

if __name__ == '__main__':
"""Main method, never used by the Electricity Map backend, but handy for testing."""
print('fetch_production(HN) ->')
print(fetch_production())
print('fetch_exchange(CR, PA) ->')
print(fetch_exchange('CR', 'PA'))
print('fetch_exchange(CR, NI) ->')
Expand Down