From c33fde6399feff0a22fe6640838609b2a6e31471 Mon Sep 17 00:00:00 2001 From: John Tourtellott Date: Wed, 20 Nov 2024 21:01:55 -0500 Subject: [PATCH] docs(examples): Update esgf example - add markup cells, update config --- examples/example_config_esgf.json | 53 +++++++++++++++++++++-- examples/jupyter/import_config_esgf.ipynb | 44 ++++++++++++++++++- 2 files changed, 92 insertions(+), 5 deletions(-) diff --git a/examples/example_config_esgf.json b/examples/example_config_esgf.json index 6892d28..b6c4655 100644 --- a/examples/example_config_esgf.json +++ b/examples/example_config_esgf.json @@ -1,12 +1,59 @@ { "data_origin": { "source": "esgf", - "id": "CMIP6.PAMIP.MOHC.HadGEM3-GC31-MM.pdSST-futAntSIC.r102i1p1f2.day.sfcWind.gn.v20210311|eagle.alcf.anl.gov" + "id": "CMIP6.PAMIP.MOHC.HadGEM3-GC31-MM.pdSST-futAntSIC.r102i1p1f2.day.sfcWind.gn.v20210311|eagle.alcf.anl.gov", + "order": "C" }, "dataset_config": { - "arrays": ["sfcWind"] + "x": "lon", + "y": "lat", + "z": null, + "t": "time", + "slices": { + "time": 355, + "lon": [ + 0, + 432, + 1 + ], + "lat": [ + 0, + 324, + 1 + ] + }, + "t_index": 1, + "arrays": [ + "sfcWind" + ] }, "preview": { - "color_by": "sfcWind" + "view_3d": true, + "color_by": "sfcWind", + "color_preset": "Cool to Warm", + "color_min": 0.19989013671875, + "color_max": 21.98614501953125, + "scale_x": 1, + "scale_y": 1, + "scale_z": 1 + }, + "camera": { + "position": [ + 179.9999898225069, + 7.62939453125e-06, + 775.6354152568821 + ], + "view_up": [ + 0.0, + 1.0, + 0.0 + ], + "focal_point": [ + 179.9999898225069, + 7.62939453125e-06, + 0.0 + ], + "parallel_projection": 0, + "parallel_scale": 200.74921752448336 } } diff --git a/examples/jupyter/import_config_esgf.ipynb b/examples/jupyter/import_config_esgf.ipynb index d1cde44..c4bbf32 100644 --- a/examples/jupyter/import_config_esgf.ipynb +++ b/examples/jupyter/import_config_esgf.ipynb @@ -1,5 +1,23 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "3c5ed231-0166-4181-ad69-630f32eb9af5", + "metadata": {}, + "source": [ + "# Example: Climate model data (ESGF host)\n", + "\n", + "This dataset contains a model of near-surface wind speec computed on a daily basis for a 14 month\n", + "period from April 2000 through May 2001. It is taken from the Coupled Model Intercomparison Project Phase 6\n", + "(CMIP6) and is hosted by the Earth System Grid Federation (ESGF).\n", + "\n", + "To setup your environment:\n", + "\n", + "```\n", + "> pip install pan3d[viewer,esgf]\n", + "```" + ] + }, { "cell_type": "code", "execution_count": null, @@ -37,7 +55,9 @@ "id": "84d23d39-2fad-4495-8701-b8fe69170639", "metadata": {}, "source": [ - "## Load dataset" + "## Load dataset - and please be patient!\n", + "\n", + "When you run the next code cell, it will load one time step and build the coordinates and data for that time step. Download times have been observed to take over 10 seconds, so after running the next code cell, check the kernel state in the status bar at the bottom of the notebook and wait for it to go from \"Busy\" to \"Idle\"." ] }, { @@ -56,7 +76,9 @@ "id": "4a15f7d2-faea-4aba-b4bc-653ac39e155f", "metadata": {}, "source": [ - "## Show UI" + "## Start the Viewer\n", + "\n", + "Run the next cell to open the pan3d viewer. In the \"Xarray Viewer\" panel, you can open the \"Rendering\" subpanel and update the time slider to load and view different days in the 14 month range. (To move 1 day at a time, click on the slider then use the left and right arrow keys.)" ] }, { @@ -68,6 +90,24 @@ "source": [ "viewer.ui" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "42f73ae2-6f68-4cd0-942e-72d0a390223d", + "metadata": {}, + "outputs": [], + "source": [ + "viewer.source._input" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a7c7d279-ef3b-4689-8400-e016378c3177", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {