Repository: electricitymaps/electricitymaps-contrib

Issue:
Northern Ireland data quality issues
Right now we show (timezone of screenshots UTC-5):

![image](https://user-images.githubusercontent.com/47415/48109856-1b015f00-e217-11e8-8e55-eeaa9187d19d.png)

Link from GB (Scotland) is the "Moyle" link - SONI show it a large part of the _supply_:

![image](https://user-images.githubusercontent.com/47415/48109901-52700b80-e217-11e8-991d-e7ea8b675cf0.png)

Our data shows it as export, and at over 100% of the available supply at that:

![image](https://user-images.githubusercontent.com/47415/48109911-6156be00-e217-11e8-838b-7acf8db3aba2.png)

Something is wrong. Is it just Moyle being flipped, or is there more problems? If someone has some time to investigate, it would be super.


Discussion:
There is a notice on http://www.soni.ltd.uk/ about problems with their fuel mix.

Current screenshot.

![moyle_overload](https://user-images.githubusercontent.com/30196510/48125681-2b492680-e277-11e8-8911-853fc980d49e.png)

I think generation is being under reported.
ENTSO-E data for the exchanges of Ireland and GB were irregular or NA today, so it really seems like there are some data issues.

![image](https://user-images.githubusercontent.com/25743609/48158242-4d23c700-e2d2-11e8-83b3-60a2b318cd29.png)

![image](https://user-images.githubusercontent.com/25743609/48158400-b4da1200-e2d2-11e8-8d7c-7cd5c1f99e85.png)

I've renamed the issue

If I understand well, data fro ENTSOE TP for GB-NIR has been seen incorrect many times:
- GB-NIR reported "production per plant type" seen insufficient, leading to sometimes negative computed consumption (prod - net export) values.

- GN-NIR to GB power exchanges are sometime missing (N/A)

Pinging @Dalius-ENTSO-E for his information

Our parser https://github.com/tmrowco/electricitymap-contrib/blob/master/parsers/GB_NIR.py uses SONI data, not ENTSOE, for both exchanges and production. Per https://github.com/tmrowco/electricitymap-contrib/blob/master/config/zones.json#L1446 ENTSOE is used for consumption, price, and forecasts.
Ah, apology I did not read carefully your issue! It might well be that we coded the NIR import in reverse. Did you check absolute values in your previous screenshot to see if they match?
Hey @systemcatch, looking at your code [here](https://github.com/tmrowco/electricitymap-contrib/blob/86781b197595764d4cbc3bf00501db7ff9328272/parsers/GB_NIR.py#L177)

- I believe we should put a minus sign because we seem to report exchanges in the wrong way. 


Resolving patch:
diff --git a/parsers/GB_NIR.py b/parsers/GB_NIR.py
--- a/parsers/GB_NIR.py
+++ b/parsers/GB_NIR.py
@@ -16,8 +16,8 @@
 thermal_url = 'http://ws.soni.ltd.uk/DownloadCentre/aspx/FuelMix.aspx'
 wind_url = 'http://ws.soni.ltd.uk/DownloadCentre/aspx/SystemOutput.aspx'
 exchange_url = 'http://ws.soni.ltd.uk/DownloadCentre/aspx/MoyleTie.aspx'
-# Positive values represent imports to Northern Ireland.
-# Negative value represent exports from Northern Ireland.
+# Positive values represent exports to Northern Ireland.
+# Negative value represent imports from Northern Ireland.
 
 
 def get_data(url, target_datetime, session=None):
@@ -174,7 +174,7 @@ def moyle_processor(df):
         snapshot = {}
         snapshot['datetime'] = add_default_tz(parser.parse(row['TimeStamp'],
                                                            dayfirst=True))
-        snapshot['netFlow'] = row['Total_Moyle_Load_MW']
+        snapshot['netFlow'] = -1 * row['Total_Moyle_Load_MW']
         snapshot['source'] = 'soni.ltd.uk'
         snapshot['sortedZoneKeys'] = 'GB->GB-NIR'
         datapoints.append(snapshot)
@@ -196,7 +196,7 @@ def IE_processor(df):
         netFlow = (row['Total_Str_Let_Load_MW'] +
                    row['Total_Enn_Cor_Load_MW'] +
                    row['Total_Tan_Lou_Load_MW'])
-        snapshot['netFlow'] = -1 * (netFlow)
+        snapshot['netFlow'] = netFlow
         snapshot['source'] = 'soni.ltd.uk'
         snapshot['sortedZoneKeys'] = 'GB-NIR->IE'
         datapoints.append(snapshot)


Test patch: