Skip to content

Commit 472eb0e

Browse files
authored
Merge pull request #14 from NicholasCote/main
DRAFT: Project Pythia 2024 Cook Off: Interactive ERA5 Dashboard [ DO NOT MERGE]
2 parents 93b686c + 5f71642 commit 472eb0e

13 files changed

+9590
-25
lines changed

.isort.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[settings]
2-
known_third_party =
2+
known_third_party =holoviews,hvplot,panel,xarray

Containerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use an official Python runtime as a base image
2+
FROM docker.io/mambaorg/micromamba:latest
3+
4+
USER root
5+
6+
RUN apt-get update && apt-get install -y git-all
7+
8+
# Set the working directory in the container to /app
9+
WORKDIR /home/mambauser/app
10+
11+
# Copy the current directory contents into the container at /usr/src/app
12+
RUN git clone https://github.com/NicholasCote/ERA5_interactive-cookbook-ncote.git
13+
14+
# Install any needed packages specified in requirements.yml
15+
RUN micromamba env create -f ERA5_interactive-cookbook-ncote/environment.yml
16+
17+
RUN mv ERA5_interactive-cookbook-ncote/notebooks/04_dashboard.ipynb .
18+
19+
RUN rm -r ERA5_interactive-cookbook-ncote/
20+
21+
# Activate the environment by providing ENV_NAME as an environment variable at runtime
22+
# Make port bokeh application port to the world outside this container
23+
EXPOSE 5006
24+
25+
USER mambauser
26+
27+
CMD ["panel", "serve", "04_dashboard.ipynb", "--allow-websocket-origin=*", "--autoreload"]

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ In the notebooks which comprise this Cookbook, we demonstrate the following:
3333

3434
## Authors
3535

36-
[Kevin Tyle](https://github.com/ktyle), [Michael Barletta](https://github.com/Michael-Barletta)
36+
[Kevin Tyle](https://github.com/ktyle), [Michael Barletta](https://github.com/Michael-Barletta), [Negin Sobhani](https://github.com/negin513), [Nicholas Cote](https://github.com/ncote) , [Harsha Hampapura](https://github.com/hrhampapura) , and [Philip Chmielowiec](https://github.com/philip2c)
3737

3838
We also gratefully acknowledge the Google Cloud Research team for making an ARCO-friendly version of the ERA-5 available. Citations for their effort and the ERA-5 reanalysis are below:
3939

@@ -65,18 +65,32 @@ We also gratefully acknowledge the Google Cloud Research team for making an ARCO
6565

6666
## Structure
6767

68-
This cookbook currently consists of two notebooks that access, regrid, and visualize the ARCO ERA-5 repository.
68+
This cookbook currently consists of multiple notebooks that access, regrid, and visualize the ARCO ERA-5 repository. Additionally we cover a section on how to preprocess and create ARCO files.
6969

7070
Additional notebooks will follow.
7171

7272
### Section 1 ( "Basic Visualization" )
7373

7474
This notebook reads in a sea-level pressure ERA-5 grid, regrids from Gaussian to Cartesian coordinates, and visualizes the data with Matplotlib and Cartopy.
7575

76-
### Section 2 ( "Interactive Visualization 1" )
76+
### Section 2 ( "Interactive Visualization Part 1: `GeoViews`" )
7777

7878
This notebook reads in sea-level pressure and 2-meter temperature ERA-5 grids, regrids as in the first notebook, and visualizes the data in an interactive manner using [Geoviews](https://geoviews.org).
7979

80+
### Section 3 ("Interactive Visualization Part 2: `hvPlot`")
81+
This notebook reads in annual average 2-m temperature from RDA's Zarr store and visualizes the data using `hvPlot`. The notebook also demonstrates how to create a simple interactive plot that allows the user to select a specific year and visualize the 2-m and how to create animations.
82+
83+
### Section 4 ("Creating an Interactive Dashboard with `Panel`")
84+
This notebook demonstrates how to create an interactive dashboard using `Panel` that allows the user to select a specific year and visualize the 2-m temperature.
85+
86+
## Preprocessing Notebooks for NCAR RDA
87+
### Section 5 ( "Generate annual/yearly Zarr stores from hourly ERA5 NetCDF files on NCAR’s Research Data Archive")
88+
This notebook demonstrates how to preprocess hourly ERA5 NetCDF files from NCAR's Research Data Archive (RDA) and generate annual/yearly Zarr stores.
89+
90+
### Section 6 ( "Calculate Temperature Anomalies")
91+
This notebook demonstrates how to calculate temperature anomalies from the annual 2-m temperature Zarr store generated in Section 5.
92+
93+
8094
## Running the Notebooks
8195

8296
You can either run the notebook using [Binder](https://binder.projectpythia.org/) or on your local machine.

_config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
# Learn more at https://jupyterbook.org/customize/config.html
33

44
title: ARCO ERA-5 Interactive Visualization
5-
author: Michael Barletta and Kevin Tyle
5+
author: Michael Barletta, Kevin Tyle, Negin Sobhani, Nicholas Cote, Harshah Hampapura, Philip Chmielowiec
66
logo: notebooks/images/logos/pythia_logo-white-rtext.svg
77
copyright: "2024"
88

99
execute:
1010
# To execute notebooks via a Binder instead, replace 'cache' with 'binder'
1111
execute_notebooks: cache
12+
exclude_patterns:
13+
- '*era5_anomaly*'
14+
- '*data_preprocessing*'
1215
timeout: 600
1316
allow_errors: False # cells with expected failures must set the `raises-exception` cell tag
1417

@@ -28,7 +31,7 @@ parse:
2831
sphinx:
2932
config:
3033
linkcheck_ignore: ["https://doi.org/*", "https://zenodo.org/badge/*"] # don't run link checker on DOI links since they are immutable
31-
nb_execution_raise_on_error: true # raise exception in build if there are notebook errors (this flag is ignored if building on binder)
34+
nb_execution_raise_on_error: false # raise exception in build if there are notebook errors (this flag is ignored if building on binder)
3235
html_favicon: notebooks/images/icons/favicon.ico
3336
html_last_updated_fmt: "%-d %B %Y"
3437
html_theme: sphinx_pythia_theme

_toc.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ parts:
44
- caption: Preamble
55
chapters:
66
- file: notebooks/how-to-cite
7-
- caption: Visualization notebooks
7+
- caption: Visualization Notebooks
88
chapters:
99
- file: notebooks/01BasicVisualization
1010
- file: notebooks/02InteractiveVisualization
11-
- file: notebooks/03_intro_to_interactive_viz.ipynb
11+
- file: notebooks/03_hvplot
12+
- file: notebooks/04_dashboard
1213

1314
- caption: Preprocessing Notebooks for NCAR RDA
1415
chapters:
15-
- file: notebooks/01_data_preprocessing.ipynb
16+
- file: notebooks/05_data_preprocessing
17+
- file: notebooks/06_era5_anomaly

environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dependencies:
2222
- gcsfs
2323
- cf_xarray
2424
- sphinx-pythia-theme
25+
- hvplot
26+
- spatialpandas
27+
- watchfiles

notebooks/01BasicVisualization.ipynb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,9 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"# 01_BasicVisualization"
14+
"# Basic Visualization using `matplotlib` and `Cartopy`"
1515
]
1616
},
17-
{
18-
"cell_type": "markdown",
19-
"metadata": {},
20-
"source": []
21-
},
22-
{
23-
"cell_type": "markdown",
24-
"metadata": {},
25-
"source": []
26-
},
2717
{
2818
"cell_type": "markdown",
2919
"metadata": {},
@@ -6291,7 +6281,7 @@
62916281
],
62926282
"metadata": {
62936283
"kernelspec": {
6294-
"display_name": "Python 3.9.6 64-bit",
6284+
"display_name": "Python 3 (ipykernel)",
62956285
"language": "python",
62966286
"name": "python3"
62976287
},
@@ -6305,7 +6295,7 @@
63056295
"name": "python",
63066296
"nbconvert_exporter": "python",
63076297
"pygments_lexer": "ipython3",
6308-
"version": "3.9.6"
6298+
"version": "3.10.13"
63096299
},
63106300
"nbdime-conflicts": {
63116301
"local_diff": [

notebooks/02InteractiveVisualization.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"# 02_InteractiveVisualization Part 1: Geoviews"
14+
"# Interactive Visualization using `GeoViews`"
1515
]
1616
},
1717
{
@@ -536,7 +536,7 @@
536536
],
537537
"metadata": {
538538
"kernelspec": {
539-
"display_name": "Python 3.9.6 64-bit",
539+
"display_name": "Python 3 (ipykernel)",
540540
"language": "python",
541541
"name": "python3"
542542
},
@@ -550,7 +550,7 @@
550550
"name": "python",
551551
"nbconvert_exporter": "python",
552552
"pygments_lexer": "ipython3",
553-
"version": "3.9.6"
553+
"version": "3.10.13"
554554
},
555555
"nbdime-conflicts": {
556556
"local_diff": [

0 commit comments

Comments
 (0)