diff --git a/notebooks/example-workflows/enso-esgf.ipynb b/notebooks/example-workflows/enso-esgf.ipynb index 2e87e85..88956b6 100644 --- a/notebooks/example-workflows/enso-esgf.ipynb +++ b/notebooks/example-workflows/enso-esgf.ipynb @@ -107,6 +107,7 @@ " source_id=\"CESM2\",\n", " variable_id=[\"tos\"],\n", " member_id='r11i1p1f1',\n", + " grid_label=\"gn\",\n", " table_id=\"Omon\",\n", " )" ] @@ -129,10 +130,22 @@ }, "outputs": [], "source": [ - "tos_tree = cat.to_datatree()\n", + "tos_tree = cat.to_dataset_dict()\n", "tos_tree" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "3694d7de-3b75-4e25-8001-1fa5c7877f53", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "tos_tree[]" + ] + }, { "cell_type": "markdown", "id": "5395c611-afda-405e-9b1c-35b7566c557f", @@ -140,7 +153,7 @@ "tags": [] }, "source": [ - "The nodes in the tree represent two different, grids. We would like to stay on the native model grid, using the `gn` node of the datatree, which represents the model native grid data." + "There is only one variable in this dictionary of datasets, `tos`, which is the \"Sea Surface Temperature\". We can extract this dataset by passing in that key:" ] }, { @@ -152,7 +165,7 @@ }, "outputs": [], "source": [ - "ds = tos_tree[\"gn\"].to_dataset()\n", + "ds = tos_tree[\"tos\"]\n", "ds" ] }, @@ -373,16 +386,13 @@ " activity_id=\"CMIP\",\n", " experiment_id=\"historical\",\n", " institution_id=institution_id,\n", + " grid_label=grid,\n", " variable_id=[\"tos\"],\n", " member_id='r11i1p1f1',\n", " table_id=\"Omon\",\n", " )\n", - " try:\n", - " tos_ds = cat.to_datatree()[grid].to_dataset()\n", - " except KeyError:\n", - " tos_ds = cat.to_dataset_dict()[\"tos\"]\n", "\n", - " return tos_ds" + " return cat.to_dataset_dict()[\"tos\"]" ] }, {