Skip to content

Commit

Permalink
implement use_grib_paramid for accumulation
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jun 26, 2024
1 parent 9dcac60 commit efb9e4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/anemoi/datasets/create/functions/sources/accumulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

from anemoi.datasets.create.utils import to_datetime_list

from .mars import use_grib_paramid

LOG = logging.getLogger(__name__)


Expand Down Expand Up @@ -231,6 +233,7 @@ def identity(x):


def compute_accumulations(
context,
dates,
request,
user_accumulation_period=6,
Expand Down Expand Up @@ -307,7 +310,10 @@ def compute_accumulations(
ds = cml.load_source("empty")
for r in compressed.iterate():
request.update(r)
if context.use_grib_paramid and "param" in request:
request = use_grib_paramid(request)
print("🌧️", request)

ds = ds + cml.load_source("mars", **request)

accumulations = {}
Expand Down Expand Up @@ -410,6 +416,7 @@ def accumulations(context, dates, **request):
context.trace("🌧️", f"accumulations {request} {user_accumulation_period} {kwargs}")

return compute_accumulations(
context,
dates,
request,
user_accumulation_period=user_accumulation_period,
Expand Down

0 comments on commit efb9e4d

Please sign in to comment.