Skip to content

Commit

Permalink
remove yearisdate
Browse files Browse the repository at this point in the history
  • Loading branch information
veronikasamborska1994 committed Feb 17, 2025
1 parent 2f55b1d commit a9eb011
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
7 changes: 0 additions & 7 deletions etl/steps/data/garden/climate/2025-02-12/sst_annual.meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,4 @@ tables:
unit: ""
description_processing: |-
Annual anomalies of the Oceanic Niño Index (ONI) are calculated by taking the average of the monthly ONI values for a given year.
annual_nino_classification:
title: Annual El Niño or La Niña classification
unit: ""
description_processing: |-
The annual classification of the El Niño-Southern Oscillation (ENSO) state based on the Oceanic Niño Index (ONI) is determined by the majority of the monthly ONI values for a given year.
17 changes: 0 additions & 17 deletions etl/steps/data/garden/climate/2025-02-12/sst_annual.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,7 @@ def run(dest_dir: str) -> None:
#
# Calculate the annual average for the dataset
tb_annual = tb.groupby(["country", "year"]).mean().reset_index()

# Classify the year based on nino_classification
def classify_year(group):
if (group["nino_classification"] == 1).sum() > 6:
return 1
elif (group["nino_classification"] == 2).sum() > 6:
return 2
else:
return 0

tb_annual["annual_nino_classification"] = (
tb.groupby(["country", "year"]).apply(classify_year).reset_index(drop=True)
)
tb_annual = tb_annual.rename(columns={"oni_anomaly": "annual_oni_anomaly"})
tb_annual["annual_nino_classification"] = tb_annual["annual_nino_classification"].copy_metadata(
tb["nino_classification"]
)

tb_annual = tb_annual.drop(columns={"month", "nino_classification"})

tb_annual = tb_annual.format(["country", "year"])
Expand Down

0 comments on commit a9eb011

Please sign in to comment.