From f8cf7502b3e0fa176bdf212b943c64c422490658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Albert?= Date: Fri, 16 Sep 2022 11:35:44 +0200 Subject: [PATCH 1/6] Create recipe.py --- recipes/eNATL60/recipe.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 recipes/eNATL60/recipe.py diff --git a/recipes/eNATL60/recipe.py b/recipes/eNATL60/recipe.py new file mode 100644 index 0000000000..2f98df9d09 --- /dev/null +++ b/recipes/eNATL60/recipe.py @@ -0,0 +1,25 @@ +import pandas as pd +import xarray as xr + +from pangeo_forge_recipes.patterns import pattern_from_file_sequence +from pangeo_forge_recipes.recipes import XarrayZarrRecipe + +dates = pd.date_range('2009-07-01', '2010-06-30', freq='D') + +url_base = ( + "https://ige-meom-opendap.univ-grenoble-alpes.fr" + "/thredds/fileServer/meomopendap/extract/eNATL60/eNATL60-BLBT02/1d" +) + +def make_recipe(var,dep): + input_url_pattern = url_base + "/eNATL60-BLBT02_y{time:%Y}m{time:%m}d{time:%d}.1d_"+var+dep+".nc" + input_urls= [ input_url_pattern.format(time=time) for time in dates ] + pattern = pattern_from_file_sequence(input_urls, "time_counter") + recipe = XarrayZarrRecipe(pattern, target_chunks={"time_counter": 1}) + return recipe + +eNATL60_wtides_1d_mld = make_recipe('somxl010','') +eNATL60_wtides_1d_tsw60m = make_recipe('TSW','60m') +eNATL60_wtides_1d_tsw600m = make_recipe('TSW','600m') + + From bd4aec24e7d9f1975978e874a4b3158accd694ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Albert?= Date: Fri, 16 Sep 2022 11:48:06 +0200 Subject: [PATCH 2/6] Create meta.yaml --- recipes/eNATL60/meta.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/eNATL60/meta.yaml diff --git a/recipes/eNATL60/meta.yaml b/recipes/eNATL60/meta.yaml new file mode 100644 index 0000000000..6ba815b551 --- /dev/null +++ b/recipes/eNATL60/meta.yaml @@ -0,0 +1,27 @@ +title: "eNATL60 with tides daily data" +description: "extractions of temperature, salinity and vertical currents at some chosen depths from eNATL60 NEMO simulation with tides" +pangeo_forge_version: "0.8.3" +recipes: + - id: eNATL60_wtides_1d_mld + object: "recipe:eNATL60_wtides_1d_mld" + - id: eNATL60_wtides_1d_tsw60m + object: "recipe:eNATL60_wtides_1d_tsw60m" + - id: eNATL60_wtides_1d_tsw600m + object: "recipe:eNATL60_wtides_1d_tsw600m" +provenance: + providers: + - name: "MEOM IGE" + description: "Multiscale Ocean Modelling Group, Institut des Geosciences de l'Environnement, Grenoble, France" + roles: + - producer + - licensor + url: http://meom-group.github.io/ + # This is a required field for provider. Follow STAC spec + # https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#license + license: "CC-BY-4.0" +maintainers: + - name: "Aurélie Albert" + orcid: "0000-0001-7783-5629" + github: auraoupa +bakery: + id: "pangeo-ldeo-nsf-earthcube" From 6074b6e35efded1a04a3ec7fd6373ac22180dda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Albert?= Date: Tue, 27 Sep 2022 16:17:39 +0200 Subject: [PATCH 3/6] fix typos --- recipes/eNATL60/recipe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/eNATL60/recipe.py b/recipes/eNATL60/recipe.py index 2f98df9d09..769fb008b5 100644 --- a/recipes/eNATL60/recipe.py +++ b/recipes/eNATL60/recipe.py @@ -19,7 +19,7 @@ def make_recipe(var,dep): return recipe eNATL60_wtides_1d_mld = make_recipe('somxl010','') -eNATL60_wtides_1d_tsw60m = make_recipe('TSW','60m') -eNATL60_wtides_1d_tsw600m = make_recipe('TSW','600m') +eNATL60_wtides_1d_tsw60m = make_recipe('TSW','_60m') +eNATL60_wtides_1d_tsw600m = make_recipe('TSW','_600m') From 19574ee3e746bd78b608f977903358ae33389e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Albert?= Date: Tue, 27 Sep 2022 16:18:33 +0200 Subject: [PATCH 4/6] Update meta.yaml --- recipes/eNATL60/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/eNATL60/meta.yaml b/recipes/eNATL60/meta.yaml index 6ba815b551..fee637bd11 100644 --- a/recipes/eNATL60/meta.yaml +++ b/recipes/eNATL60/meta.yaml @@ -1,5 +1,5 @@ title: "eNATL60 with tides daily data" -description: "extractions of temperature, salinity and vertical currents at some chosen depths from eNATL60 NEMO simulation with tides" +description: "extractions of temperature, salinity and vertical velocity at some chosen depths from eNATL60 NEMO simulation with tides" pangeo_forge_version: "0.8.3" recipes: - id: eNATL60_wtides_1d_mld From 1a63b8bc72992e6210116d66a5f5d39a4cb7ed0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Albert?= Date: Wed, 28 Sep 2022 11:04:01 +0200 Subject: [PATCH 5/6] removes import of unused library --- recipes/eNATL60/recipe.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/eNATL60/recipe.py b/recipes/eNATL60/recipe.py index 769fb008b5..a4c4116858 100644 --- a/recipes/eNATL60/recipe.py +++ b/recipes/eNATL60/recipe.py @@ -1,5 +1,4 @@ import pandas as pd -import xarray as xr from pangeo_forge_recipes.patterns import pattern_from_file_sequence from pangeo_forge_recipes.recipes import XarrayZarrRecipe From d69ab3779b5571c2d8408cc6348a32ab7c7b2606 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 19:02:43 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- recipes/eNATL60/meta.yaml | 22 +++++++++++----------- recipes/eNATL60/recipe.py | 24 +++++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/recipes/eNATL60/meta.yaml b/recipes/eNATL60/meta.yaml index fee637bd11..0dd3b810c2 100644 --- a/recipes/eNATL60/meta.yaml +++ b/recipes/eNATL60/meta.yaml @@ -1,16 +1,16 @@ -title: "eNATL60 with tides daily data" -description: "extractions of temperature, salinity and vertical velocity at some chosen depths from eNATL60 NEMO simulation with tides" -pangeo_forge_version: "0.8.3" +title: 'eNATL60 with tides daily data' +description: 'extractions of temperature, salinity and vertical velocity at some chosen depths from eNATL60 NEMO simulation with tides' +pangeo_forge_version: '0.8.3' recipes: - id: eNATL60_wtides_1d_mld - object: "recipe:eNATL60_wtides_1d_mld" + object: 'recipe:eNATL60_wtides_1d_mld' - id: eNATL60_wtides_1d_tsw60m - object: "recipe:eNATL60_wtides_1d_tsw60m" + object: 'recipe:eNATL60_wtides_1d_tsw60m' - id: eNATL60_wtides_1d_tsw600m - object: "recipe:eNATL60_wtides_1d_tsw600m" + object: 'recipe:eNATL60_wtides_1d_tsw600m' provenance: providers: - - name: "MEOM IGE" + - name: 'MEOM IGE' description: "Multiscale Ocean Modelling Group, Institut des Geosciences de l'Environnement, Grenoble, France" roles: - producer @@ -18,10 +18,10 @@ provenance: url: http://meom-group.github.io/ # This is a required field for provider. Follow STAC spec # https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#license - license: "CC-BY-4.0" + license: 'CC-BY-4.0' maintainers: - - name: "Aurélie Albert" - orcid: "0000-0001-7783-5629" + - name: 'Aurélie Albert' + orcid: '0000-0001-7783-5629' github: auraoupa bakery: - id: "pangeo-ldeo-nsf-earthcube" + id: 'pangeo-ldeo-nsf-earthcube' diff --git a/recipes/eNATL60/recipe.py b/recipes/eNATL60/recipe.py index a4c4116858..a224178a19 100644 --- a/recipes/eNATL60/recipe.py +++ b/recipes/eNATL60/recipe.py @@ -6,19 +6,21 @@ dates = pd.date_range('2009-07-01', '2010-06-30', freq='D') url_base = ( - "https://ige-meom-opendap.univ-grenoble-alpes.fr" - "/thredds/fileServer/meomopendap/extract/eNATL60/eNATL60-BLBT02/1d" + 'https://ige-meom-opendap.univ-grenoble-alpes.fr' + '/thredds/fileServer/meomopendap/extract/eNATL60/eNATL60-BLBT02/1d' ) -def make_recipe(var,dep): - input_url_pattern = url_base + "/eNATL60-BLBT02_y{time:%Y}m{time:%m}d{time:%d}.1d_"+var+dep+".nc" - input_urls= [ input_url_pattern.format(time=time) for time in dates ] - pattern = pattern_from_file_sequence(input_urls, "time_counter") - recipe = XarrayZarrRecipe(pattern, target_chunks={"time_counter": 1}) - return recipe -eNATL60_wtides_1d_mld = make_recipe('somxl010','') -eNATL60_wtides_1d_tsw60m = make_recipe('TSW','_60m') -eNATL60_wtides_1d_tsw600m = make_recipe('TSW','_600m') +def make_recipe(var, dep): + input_url_pattern = ( + url_base + '/eNATL60-BLBT02_y{time:%Y}m{time:%m}d{time:%d}.1d_' + var + dep + '.nc' + ) + input_urls = [input_url_pattern.format(time=time) for time in dates] + pattern = pattern_from_file_sequence(input_urls, 'time_counter') + recipe = XarrayZarrRecipe(pattern, target_chunks={'time_counter': 1}) + return recipe +eNATL60_wtides_1d_mld = make_recipe('somxl010', '') +eNATL60_wtides_1d_tsw60m = make_recipe('TSW', '_60m') +eNATL60_wtides_1d_tsw600m = make_recipe('TSW', '_600m')