intermittentnrg / intermittent-importers

2 stars 1 forks source link

South Africa ESKOM fix Pumped_Water_SCO_Pumping data #1

Closed intermittentnrg closed 5 months ago

intermittentnrg commented 6 months ago

Ensure we're using correct mappings from https://github.com/electricitymaps/electricitymaps-contrib/blob/master/parsers/ESKOM.py#L22-L43

    0: "coal",  # Thermal_Gen_Excl_Pumping_and_SCO
    1: "ignored",  # Eskom_OCGT_SCO_Pumping             changed to ignored since negative oil is not possible, usually [-6, 0]
    2: "ignored",  # Eskom_Gas_SCO_Pumping              changed to ignored since negative gas is not possible, usually -1 or 0
    3: "ignored",  # Hydro_Water_SCO_Pumping            Probably electricity consumed by the plant itself (even) when not generating power. Can be ignored.
    4: "hydro",  # Pumped_Water_SCO_Pumping
    5: "ignored",  # Thermal_Generation                 sum of 0, 1, 2, 3, 4. Can be ignored.
    6: "nuclear",  # Nuclear_Generation
    7: "ignored",  # International_Imports
    8: "oil",  # Eskom_OCGT_Generation
    9: "gas",  # Eskom_Gas_Generation
    10: "oil",  # Dispatchable_IPP_OCGT
    11: "hydro",  # Hydro_Water_Generation
    12: "hydro",  # Pumped_Water_Generation
    13: "ignored",  # IOS_Excl_ILS_and_MLR              Interruption of Supply. Can be ignored.
    14: "ignored",  # ILS_Usage                         Interruptible Load Shed = companies paid not to consume electricity. Can be ignored.
    15: "ignored",  # Manual_Load_Reduction_MLR         MLS = forced load shedding. Can be ignored.
    16: "wind",  # Wind
    17: "solar",  # PV
    18: "solar",  # CSP
    19: "biomass",  # Other_RE - looking at capacity data and the IEA annual balances, other RE is likely to be biomass

compare with my own https://github.com/intermittentnrg/intermittent-data/blob/master/lib/eskom.rb#L102-L141

          #Thermal_Gen_Excl_Pumping_and_SCO
          r << {country: 'ZA', time:, production_type: 'fossil_coal', value: row[1].to_f*1000}
          #Eskom_OCGT_SCO_Pumping

          #Eskom_Gas_SCO_Pumping

          #Hydro_Water_SCO_Pumping

          #Pumped_Water_SCO_Pumping

          #Thermal_Generation - sum of above. Can be ignored

          #Nuclear_Generation
          r << {country: 'ZA', time:, production_type: 'nuclear', value: row[7].to_f*1000}
          #International_Imports

          #Eskom_OCGT_Generation
          #added to OCGT below
          #Eskom_Gas_Generation
          r << {country: 'ZA', time:, production_type: 'fossil_gas', value: row[10].to_f*1000}
          #Dispatchable_IPP_OCGT
          r << {country: 'ZA', time:, production_type: 'fossil_oil', value: (row[9].to_f+row[11].to_f)*1000}
          #Hydro_Water_Generation
          r << {country: 'ZA', time:, production_type: 'hydro', value: row[12].to_f*1000}
          #Pumped_Water_Generation
          r << {country: 'ZA', time:, production_type: 'hydro_pumped_storage', value: row[13].to_f*1000}
          #IOS_Excl_ILS_and_MLR - Interruption of Supply

          #ILS_Usage - Interruptible Load Shed

          #Manual_Load_Reduction_MLR - MLS = forced load shedding

          #Wind
          r << {country: 'ZA', time:, production_type: 'wind', value: row[17].to_f*1000}
          #PV
          r << {country: 'ZA', time:, production_type: 'solar', value: row[18].to_f*1000}
          #CSP
          r << {country: 'ZA', time:, production_type: 'solar_thermal', value: row[19].to_f*1000}
          #Other_RE
          r << {country: 'ZA', time:, production_type: 'other_renewable', value: row[20].to_f*1000}
intermittentnrg commented 6 months ago
Mapping comparison: eskom intermittent.energy electricityMaps
Thermal_Gen_Excl_Pumping_and_SCO 1 fossil_coal 0 coal
Eskom_OCGT_SCO_Pumping
Eskom_Gas_SCO_Pumping
Hydro_Water_SCO_Pumping
Pumped_Water_SCO_Pumping 4 hydro
Thermal_Generation
Nuclear_Generation 7 nuclear 6 nuclear
International_Imports
Eskom_OCGT_Generation 9 fossil_oil 8 oil
Eskom_Gas_Generation 10 fossil_gas 9 gas
Dispatchable_IPP_OCGT 11 fossil_oil 10 oil
Hydro_Water_Generation 12 hydro 11 hydro
Pumped_Water_Generation 13 hydro_pumped_storage 12 hydro
IOS_Excl_ILS_and_MLR
ILS_Usage
Manual_Load_Reduction_MLR
Wind 17 wind 16 wind
PV 18 solar 17 solar
CSP 19 solar_thermal 18 solar
Other_RE 20 other_renewable 19 biomass

Could probably make the code more readable. So it's an exact match except that:

Also need to request historic ESKOM data from https://www.eskom.co.za/dataportal/data-request-form/

intermittentnrg commented 5 months ago

Should probably split these to separate production_types also. But need to do #7 to re-process historical data.

intermittentnrg commented 5 months ago

Fixed in 2be16283a8c1562308fd6c6b8064c6abe1a16d9f