opennem / opennem-fe

An Open Platform for National Electricity Market Data
https://opennem.org.au
MIT License
62 stars 11 forks source link

Stripes: Bad solar value figures before March 2018 #169

Open simonhac opened 1 year ago

simonhac commented 1 year ago
image

i suspect this is due to the aggregation of rooftop and utility solar *_market_value is 0 or missing — which is the case for significant periods.

i suspect the formula for value is basically:

average_price = (rooftop_market_value + utility_market_value) / (rooftop_energy + utility_energy)

the calculation needs to take into account the possibility that we don't have market_value. something like this:

total_market_value = 0
total_energy = 0

if (isNotZeroOrNull(utility_market_value)) {
  total_market_value += utility_market_value
  total_energy += utility_energy
}

if (isNotZeroOrNull(rooftop_market_value)) {
  total_market_value += rooftop_market_value
  total_energy += rooftop_energy
}

if (total_market_value != 0) {
   average_price = total_market_value / total_energy
} else {
  average_price = null
}

nb: it is possible to have a negative *_market_value.