From 9f305bb620d1f82dcfd4076e884408c076ff9c9a Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Sat, 17 Feb 2024 17:13:58 +0000 Subject: [PATCH] update --- ecml_tools/create/functions/actions/opendap.py | 11 ++++------- ecml_tools/create/functions/steps/rotate_winds.py | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ecml_tools/create/functions/actions/opendap.py b/ecml_tools/create/functions/actions/opendap.py index 2fad5ed..d0561f6 100644 --- a/ecml_tools/create/functions/actions/opendap.py +++ b/ecml_tools/create/functions/actions/opendap.py @@ -12,16 +12,16 @@ from climetlab.utils.patterns import Pattern -def opendap(context, dates, url_pattern, *args, **kwargs): - all_urls = Pattern(url_pattern, ignore_missing_keys=True).substitute( +def execute(context, dates, url_pattern, *args, **kwargs): + urls = Pattern(url_pattern, ignore_missing_keys=True).substitute( *args, date=dates, **kwargs ) ds = load_source("empty") levels = kwargs.get("level", kwargs.get("levelist")) - for url in all_urls: - print("URL", url) + for url in urls: + # print("URL", url) s = load_source("opendap", url) s = s.sel( valid_datetime=[d.isoformat() for d in dates], @@ -32,6 +32,3 @@ def opendap(context, dates, url_pattern, *args, **kwargs): s = s.sel(levelist=levels) ds = ds + s return ds - - -execute = opendap diff --git a/ecml_tools/create/functions/steps/rotate_winds.py b/ecml_tools/create/functions/steps/rotate_winds.py index 401d845..a0474ac 100644 --- a/ecml_tools/create/functions/steps/rotate_winds.py +++ b/ecml_tools/create/functions/steps/rotate_winds.py @@ -25,9 +25,6 @@ def rotate_winds(lats, lons, x_wind, y_wind, source_projection, target_projectio source_projection = pyproj.Proj(source_projection) target_projection = pyproj.Proj(target_projection) - print("source_projection", source_projection) - print("target_projection", target_projection) - transformer = pyproj.transformer.Transformer.from_proj( source_projection, target_projection ) @@ -43,6 +40,7 @@ def rotate_winds(lats, lons, x_wind, y_wind, source_projection, target_projectio orig_speed = np.sqrt(x_wind**2 + y_wind**2) x0, y0 = source_projection(lons, lats) + print(x0, y0) if source_projection.name != "longlat": x1 = x0 + x_wind y1 = y0 + y_wind