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

pv-site dynamic normalizing #363

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions ocf_datapipes/training/pvnet_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,10 @@
xr.set_options(keep_attrs=True)
logger = logging.getLogger("pvnet_site_datapipe")

normalization_values = {
2019: 3185.0,
2020: 2678.0,
2021: 3196.0,
2022: 3575.0,
2023: 3773.0,
2024: 3773.0,
}


def normalize_pv(x: xr.DataArray):
"""Normalize PV data"""
# This is after the data has been temporally sliced, so have the year
return x / normalization_values[2024]

year = x.time_utc.dt.year

# Add the effective_capacity_mwp to the dataset, indexed on the time_utc
return (
x / normalization_values[year]
if year in normalization_values
else x / normalization_values[2024]
)
return x / x.nominal_capacity_wp


class DictDatasetIterDataPipe(IterDataPipe):
Expand Down
Loading