-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example tutorial notebook with launch buttons
- Loading branch information
Showing
6 changed files
with
164 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Tutorials | ||
|
||
This section contains everything you need to know about hackweek tutorials: | ||
|
||
* What are the [roles and responsibilities](tutorial_roles.md) of hackweek tutorial lead? | ||
* How to create an interactive jupyter notebook tutorial | ||
|
||
## Organization | ||
|
||
Each tutorial is a collection of jupyterbooks and files in a its own subfolder under tutorials. For example in this template we have the `tutorials/raster/into-ipyleaflet.ipynb`. New tutorials need to be listed explicitly in the `_toc.yml` file to show up in the rendered documentation. | ||
|
||
```{attention} | ||
When adding new notebooks be sure to "Clear all Outputs" before saving. This keeps the book source code small, but outputs are still built for the HTML webpage by Jupyter Book! | ||
``` | ||
|
||
## Suggestions | ||
|
||
Use small example datasets, or have notebooks start by loading source data from the data provider. For example, instead of downloading a large number of datasets from NASA's [NSIDC DAAC](https://nsidc.org/daac) and having your tutorial start by opening local files, your notebook should start with code to retrieve your necessary datasets from NSIDC servers. This captures the full workflow from data acquisition to final analysis. | ||
|
||
Increasingly there are ways to access data remotely in a streaming fashion so that you don't have to download lots of files as a first step in your analysis. This is a good option as well to facilitate data management and portability of your tutorial to run on different machines (hackweek jupyterhub, your personal computer, the computers of collaborators, some temporary server on the Cloud like mybinder.org, etc...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "controlling-birth", | ||
"metadata": {}, | ||
"source": [ | ||
"# An introduction to rasters\n", | ||
"\n", | ||
"We will examine raster images from the [MODIS instrument](https://modis.gsfc.nasa.gov/data/). \"MODIS\" stands for \"MODerate Resolution SpectroRadiometer\". Moderate resolution refers to the fact that MODIS data has at best a 250 meter pixel posting, but single images cover hundreds of kilometers and with two sensors currently in orbit, we currently get [daily views of the entire globe](https://worldview.earthdata.nasa.gov/)!" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "pleased-humanity", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import ipyleaflet\n", | ||
"from ipyleaflet import Map, Rectangle, basemaps, basemap_to_tiles, TileLayer, SplitMapControl, Polygon\n", | ||
"\n", | ||
"import ipywidgets\n", | ||
"import datetime\n", | ||
"import re" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "different-bible", | ||
"metadata": {}, | ||
"source": [ | ||
"Specify a bounding box covering Grand Mesa, Colorado" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "brutal-drama", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"bbox = [-108.3, 39.2, -107.8, 38.8]\n", | ||
"west, north, east, south = bbox\n", | ||
"bbox_ctr = [0.5*(north+south), 0.5*(west+east)]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "informative-jewelry", | ||
"metadata": {}, | ||
"source": [ | ||
"Display the bounding box on an interactive basemap for context. All the available basemaps can be found in the [ipyleaflet documentation](https://ipyleaflet.readthedocs.io/en/latest/api_reference/basemaps.html)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "neural-entertainment", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"m = Map(center=bbox_ctr, zoom=10)\n", | ||
"rectangle = Rectangle(bounds=((south, west), (north, east))) #SW and NE corners of the rectangle (lat, lon)\n", | ||
"m.add_layer(rectangle)\n", | ||
"m" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "noble-initial", | ||
"metadata": {}, | ||
"source": [ | ||
"### NASA GIBS\n", | ||
"\n", | ||
"NASA's [Global Imagery Browse Services (GIBS)](https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs) is a great Web Map Tile Service (WMTS) to visualize NASA data as pre-rendered tiled raster images. The NASA [Worldview](https://worldview.earthdata.nasa.gov) web application is a way to explore all GIBS datasets. We can also use ipyleaflet to explore GIBS datasets, like MODIS truecolor images, within a Jupyter Notebook. Use the slider in the image below to reveal the image from 2019-04-25:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "isolated-kennedy", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"m = Map(center=bbox_ctr, zoom=6)\n", | ||
"\n", | ||
"right_layer = basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, \"2019-04-25\")\n", | ||
"left_layer = TileLayer()\n", | ||
"control = SplitMapControl(left_layer=left_layer, right_layer=right_layer)\n", | ||
"m.add_control(control)\n", | ||
"\n", | ||
"m.add_layer(rectangle)\n", | ||
"\n", | ||
"m" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "official-thong", | ||
"metadata": {}, | ||
"source": [ | ||
"*Thats all for now, stay tuned for more!*" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |