openego / powerd-data

GNU Affero General Public License v3.0
1 stars 0 forks source link

Missing Filter for EinheitBetriebsstatus in power_plants_status_quo Function #221

Closed khelfen closed 6 months ago

khelfen commented 6 months ago

Issue Description

In the power_plants_status_quo function, it appears that there's a missing filter for the EinheitBetriebsstatus attribute to ensure that only power plants with a status of "InBetrieb" (In Operation) are represented in the model. Currently, decommissioned conventional power plants are also included, which leads to inaccuracies in the energy model's outcomes.

Expected Behavior

The function should include a filter that selects only the power plants with an EinheitBetriebsstatus of "InBetrieb" to ensure that the model accurately represents operational power plants only.

Current Behavior

Decommissioned conventional power plants are represented in the model due to the absence of a filter for the EinheitBetriebsstatus attribute in the power_plants_status_quo function.

Possible Solution

Implement a filter in the power_plants_status_quo function that checks the EinheitBetriebsstatus attribute of each power plant and includes only those with a status of "InBetrieb" in the model.

khelfen commented 6 months ago

See 8183ecc for a possible solution.

khelfen commented 6 months ago

@ClaraBuettner or @CarlosEpia besides conventional power plants other power plants are loaded from the DB (e.g. hydro). These are also not filtered for EinheitBetriebsstatus. Are these filtered before they are written in the DB table (e.g. supply.egon_power_plants_hydro) which they are read from?

CarlosEpia commented 6 months ago

@khelfen I agree with your observation. I will take care of this issue.

CarlosEpia commented 6 months ago

There are two attributes that should be considered here:

  1. EinheitBetriebsstatus (Power plant status): currently applied just to not conventional generators here
  2. DatumEndgueltigeStilllegung (decommission date): Not used yet. I will use this commit 8183ecc as a reference.
CarlosEpia commented 6 months ago

Additionally, I will delete this filter. This will allow us to calculate several scenarios (still a pending decision) and filter the generators according to the requirements of each of them.

CarlosEpia commented 6 months ago

@khelfen After implementing the changes I concluded that using the attribute "EinheitBetriebsstatus" == "InBetrieb" is something that we don't want in general. The value presented there corresponds to the current status of the power plant by the moment the data is downloaded. For instance, for the Status2019 we would lose all the generators that were decommissioned after 2020, since they are marked as "DauerhaftStillgelegt".

In conclusion, I think that using the decommissioned date is enough to guarantee the accuracy of the data.

khelfen commented 6 months ago

@khelfen After implementing the changes I concluded that using the attribute "EinheitBetriebsstatus" == "InBetrieb" is something that we don't want in general. The value presented there corresponds to the current status of the power plant by the moment the data is downloaded. For instance, for the Status2019 we would lose all the generators that were decommissioned after 2020, since they are marked as "DauerhaftStillgelegt".

In conclusion, I think that using the decommissioned date is enough to guarantee the accuracy of the data.

Hey @CarlosEpia :) I'm not sure if I would trust the MaStR to that degree. Did you check if all plants that are "DauerhaftStillgelegt" have a date DatumEndgueltigeStilllegung? I did not, but I would suspect that it is not the case. That's why I added this part which should work as desired in your case.

khelfen commented 6 months ago

If you implement it for all MaStR data could you also update the filter for pv rooftop here?

CarlosEpia commented 6 months ago

Sure. I could also apply it there. Just in case I will mention that we are not currently using that code for "Status20XX" scenarios. We are dealing with solar rooftop here