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

osi_saf_450_430-a_rg025 #245

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
45 changes: 45 additions & 0 deletions recipes/OSI-SAF-450-430-a_rg025/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Name for dataset. User chosen.
title: 'OSI-SAF Global Sea Ice Concentration Climate Data Record (1990-2021 Daily) Release 3'
# Description of dataset. User chosen, roughly 1 sentence in length.
description: 'Daily global sea ice concentration climate data record (product ID: OSI-450-a and OSI-430-a) for the preiod 1990-2021 interpolated onto a global regular grid with a resolution of 0.25 degrees'
# Version of pangeo_forge_recipes library that was used
pangeo_forge_version: '0.9.2'
# The recipes section tells Pangeo Cloud where to find the recipes within your PR.
# Many recipe PRs will have just 1 recipe, in which case this section will look similar to the example below.
# If your PR contains multiple recipes, you may add additional elements to the list below.
recipes:
# User chosen name for recipe. Likely similiar to dataset name, ~25 characters in length
- id: OSI-SAF-450-430-a_rg025
# The `object` below tells Pangeo Cloud specifically where your recipe instance(s) are located and uses the format <filename>:<object_name>
# <filename> is name of .py file where the Python recipe object is defined.
# For example, if <filename> is given as "recipe", Pangeo Cloud will expect a file named `recipe.py` to exist in your PR.
# <object_name> is the name of the recipe object (i.e. Python class instance) _within_ the specified file.
# For example, if you have defined `recipe = XarrayZarrRecipe(...)` within a file named `recipe.py`, then your `object` below would be `"recipe:recipe"`
object: 'recipe:recipe'
provenance:
# Data provider object. Follow STAC spec.
# https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#provider-object
providers:
- name: 'EUMETSAT OSI SAF'
description: 'EUMETSAT Ocean and Sea Ice Satellite Application Facility High Latitude Processing Center'
roles:
- producer
- licensor
url: https://osi-saf.eumetsat.int/products/osi-450-a
- name: 'NCAR'
description: 'Regridding and merging of the observations performed by Lorenzo Zampieri at the National Center for Atmospheric Research, where observations are stored'
roles:
- processor
- host
# 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: 'EUMETSAT Essential (free and unrestricted)'
maintainers:
# Information about recipe creator. name and github are required
- name: 'Lorenzo Zampieri'
orcid: '0000-0003-1703-4162'
github: lzampier
# The specific bakery (i.e. cloud infrastructure) that your recipe will run on.
# Available bakeries can be found on the Pangeo Forge website https://pangeo-forge.org/dashboard/bakeries
bakery:
id: 'pangeo-ldeo-nsf-earthcube'
46 changes: 46 additions & 0 deletions recipes/OSI-SAF-450-430-a_rg025/recipe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import pandas as pd

from pangeo_forge_recipes.patterns import ConcatDim, FilePattern
from pangeo_forge_recipes.recipes import XarrayZarrRecipe

dates = pd.date_range('1989-01-01', '2021-12-31', freq='D')

missing_dates = [
pd.Timestamp(1990, 8, 13),
pd.Timestamp(1990, 8, 25),
pd.Timestamp(1990, 8, 26),
pd.Timestamp(1990, 10, 21),
pd.Timestamp(1990, 10, 22),
pd.Timestamp(1990, 10, 26),
pd.Timestamp(1990, 10, 27),
pd.Timestamp(1990, 10, 28),
pd.Timestamp(1990, 12, 21),
pd.Timestamp(1990, 12, 22),
pd.Timestamp(1990, 12, 23),
pd.Timestamp(1990, 12, 24),
pd.Timestamp(1990, 12, 25),
pd.Timestamp(1990, 12, 26),
pd.Timestamp(2000, 12, 1),
pd.Timestamp(2021, 2, 20),
]

# Drop missing dates
dates = dates.drop(missing_dates)

URL_FORMAT = (
'https://g-08c618.7a577b.6fbd.data.globus.org/'
'ice_conc_r1440x720_{interim}cdr-v3p0_{time:%Y%m%d}1200.nc'
)


def make_url(time):
if time.year <= 2020:
return URL_FORMAT.format(time=time, interim='')
if time.year > 2020:
return URL_FORMAT.format(time=time, interim='i')


time_concat_dim = ConcatDim('time', dates, nitems_per_file=1)
pattern = FilePattern(make_url, time_concat_dim)

recipe = XarrayZarrRecipe(pattern, inputs_per_chunk=5)