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

Add oisst-0 #15

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
22 changes: 22 additions & 0 deletions recipes/oisst-0/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
title: "NOAA Optimum Interpolated SST"
description: "Analysis-ready Zarr datasets derived from NOAA OISST NetCDF"
pangeo_forge_version: "0.9.0"
pangeo_notebook_version: "2021.12.02"
recipes:
- id: noaa-oisst-avhrr-only
object: "recipe:recipe"
provenance:
providers:
- name: "NOAA NCEI"
description: "National Oceanographic & Atmospheric Administration National Centers for Environmental Information"
roles:
- producer
- licensor
url: https://www.ncdc.noaa.gov/oisst
license: "CC-BY-4.0"
maintainers:
- name: "Charles Stern"
orcid: "0000-0002-4078-0852"
github: cisaacstern
bakery:
id: "pangeo-ldeo-nsf-earthcube"
22 changes: 22 additions & 0 deletions recipes/oisst-0/recipe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pandas as pd

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

start_date = "1981-09-01"


def format_function(time):
import pandas as pd
base = pd.Timestamp(start_date)
day = base + pd.Timedelta(days=time)
input_url_pattern = (
"https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation"
"/v2.1/access/avhrr/{day:%Y%m}/oisst-avhrr-v02r01.{day:%Y%m%d}.nc"
)
return input_url_pattern.format(day=day)


dates = pd.date_range(start_date, "1981-10-01", freq="D")
pattern = FilePattern(format_function, ConcatDim("time", range(len(dates)), 1))
recipe = XarrayZarrRecipe(pattern, inputs_per_chunk=20, cache_inputs=True)