mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
Merge pull request #37 from srcarter3/notebook-updates
Add new cira notebook
This commit is contained in:
commit
e88780b6b7
4 changed files with 945 additions and 0 deletions
320
examples/Template.ipynb
Normal file
320
examples/Template.ipynb
Normal file
|
@ -0,0 +1,320 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<a name=\"top\"></a>\n",
|
||||
"<div style=\"width:1000 px\">\n",
|
||||
"\n",
|
||||
"<div style=\"float:right; width:98 px; height:98px;\">\n",
|
||||
"<img src=\"https://docs.unidata.ucar.edu/images/logos/unidata_logo_vertical_150x150.png\" alt=\"Unidata Logo\" style=\"height: 98px;\">\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"# YOUR NOTEBOOK TITLE\n",
|
||||
"**Python-AWIPS Tutorial Notebook**\n",
|
||||
"\n",
|
||||
"<div style=\"clear:both\"></div>\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"Be sure to commit a small example output image from your code and link to it HERE (in the source), or link to an external image (logo, etc.) via URL. Remove this line after! Provide a brief `alt` text as well to benefit those with image display issues or potentially making use of screen readers.\n",
|
||||
"<div style=\"float:right; width:250 px\"><img src=\"../images/[image name]_preview.png\" alt=\"[image text]\" style=\"height: 300px;\"></div>\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Objectives\n",
|
||||
"\n",
|
||||
"* Use this section to \"tag\" the key interactions with your notebook, restate in plain language your notebooks overall goal\n",
|
||||
"* Supplement with brief description of the skills/tools that will be highlighted or smaller objectives that will be completed\n",
|
||||
"* Generate numbers for function inputs with [NumPy](https://numpy.org/doc/stable/)\n",
|
||||
"* Calculate $y = f(x) = sin(x)$ with [NumPy](https://numpy.org/doc/stable/) (don't forget math text!)\n",
|
||||
"* Demonstrate visualizing this with [Matplotlib](https://matplotlib.org/)\n",
|
||||
"\n",
|
||||
"---"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"toc": true
|
||||
},
|
||||
"source": [
|
||||
"<h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n",
|
||||
"<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Imports\" data-toc-modified-id=\"Imports-1\"><span class=\"toc-item-num\">1 </span>Imports</a></span></li><li><span><a href=\"#Your-first-objective\" data-toc-modified-id=\"Your-first-objective-2\"><span class=\"toc-item-num\">2 </span>Your first objective</a></span></li><li><span><a href=\"#Objective-number-two\" data-toc-modified-id=\"Objective-number-two-3\"><span class=\"toc-item-num\">3 </span>Objective number two</a></span><ul class=\"toc-item\"><li><span><a href=\"#Highlight-boxes-can-be-useful!\" data-toc-modified-id=\"Highlight-boxes-can-be-useful!-3.1\"><span class=\"toc-item-num\">3.1 </span>Highlight boxes can be useful!</a></span></li><li><span><a href=\"#Don't-forget,-in-markdown-cells\" data-toc-modified-id=\"Don't-forget,-in-markdown-cells-3.2\"><span class=\"toc-item-num\">3.2 </span>Don't forget, in markdown cells</a></span><ul class=\"toc-item\"><li><span><a href=\"#you-have-access-to\" data-toc-modified-id=\"you-have-access-to-3.2.1\"><span class=\"toc-item-num\">3.2.1 </span>you have access to</a></span><ul class=\"toc-item\"><li><span><a href=\"#further-subsection-headings\" data-toc-modified-id=\"further-subsection-headings-3.2.1.1\"><span class=\"toc-item-num\">3.2.1.1 </span>further subsection headings</a></span></li></ul></li></ul></li></ul></li><li><span><a href=\"#Objective,-the-third\" data-toc-modified-id=\"Objective,-the-third-4\"><span class=\"toc-item-num\">4 </span>Objective, the third</a></span></li><li><span><a href=\"#See-Also\" data-toc-modified-id=\"See-Also-5\"><span class=\"toc-item-num\">5 </span>See Also</a></span><ul class=\"toc-item\"><li><span><a href=\"#Related-Notebooks\" data-toc-modified-id=\"Related-Notebooks-5.1\"><span class=\"toc-item-num\">5.1 </span>Related Notebooks</a></span></li><li><span><a href=\"#Additional-Documention\" data-toc-modified-id=\"Additional-Documention-5.2\"><span class=\"toc-item-num\">5.2 </span>Additional Documention</a></span></li></ul></li></ul></div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Imports\n",
|
||||
"We will begin by importing the important packages to be used throughout! Instructors, generally keep your imports to before your objectives unless there is an important takeaway from what you're importing or the way you're doing it. Give a brief description if necessary in more introductory notebooks."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"import numpy as np"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"---"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Your first objective\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Begin your learning narrative here with your first individual learning objective. Be sure to use markdown cells to guide your notebook, and explain your larger and more complicated objectives in plain language as necessary. Keep code comments to a minimum, but include them if they clearly help explain a quick decision or syntax quirk. Of course, if you find yourself needing more and more and more markdown as you go, you may need to trim down or split up your notebook!"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"**NOTICE** copy this cell (after removing this text from source) to include at the end of any new sections you illustrate for a clear visual break and offer a path to the start of the notebook. You can use the markdown `---` separator to clearly separate your sections.\n",
|
||||
"\n",
|
||||
"<a href=\"#top\">Top</a>\n",
|
||||
"\n",
|
||||
"---"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Objective number two\n",
|
||||
"\n",
|
||||
"Continue into your next objective, again defined by what unique piece of information you want your student to take away, or what pieces of code you want them to be able to take advantage of."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"x = np.linspace(0, 2*np.pi, 5)\n",
|
||||
"x"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Highlight boxes can be useful!"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert-info\">\n",
|
||||
"<b>Tip:</b> My Tip\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert-warning\">\n",
|
||||
"<b>Tip:</b> My Warning\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert-danger\">\n",
|
||||
"<b>Tip:</b> My Error\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert-success\">\n",
|
||||
"<b>Tip:</b> My Success\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"y = np.sin(x)\n",
|
||||
"y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Don't forget, in markdown cells\n",
|
||||
"#### you have access to\n",
|
||||
"##### further subsection headings\n",
|
||||
"\n",
|
||||
"to help break up the organization of your sections as necessary. Don't let them get too long, however!"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"labels = [f'{val / np.pi} $\\pi$' for val in x]\n",
|
||||
"\n",
|
||||
"plt.plot(x, y)\n",
|
||||
"plt.scatter(x, y)\n",
|
||||
"plt.xticks(x, labels);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<a href=\"#top\">Top</a>\n",
|
||||
"\n",
|
||||
"---"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Objective, the third\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"x_10 = np.linspace(0, 2*np.pi, 10)\n",
|
||||
"y_10 = np.sin(x_10)\n",
|
||||
"\n",
|
||||
"x_100 = np.linspace(0, 2*np.pi, 100)\n",
|
||||
"y_100 = np.sin(x_100)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"plt.plot(x_10, y_10, label=\"x=10\")\n",
|
||||
"plt.plot(x_100, y_100, label=\"x=100\")\n",
|
||||
"plt.xticks(x, labels)\n",
|
||||
"plt.legend();"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"and so on, and so forth! Don't forget to follow your narrative, and by the end feel free to sneak in some (not so scary!) previews or natural extensions to your notebook pointing the learner where they might go next. And of course, thank you!"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<a href=\"#top\">Top</a>\n",
|
||||
"\n",
|
||||
"---"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## See Also\n",
|
||||
"\n",
|
||||
"Finally, reserve a small space at the end for any citations/references, links to external resources (e.g. other websites, courses, activities), or suggestions for potentially 2-3 of our other notebooks that may complement or make for a logical prequel/sequel to your notebook. We will have direction for this on the website as well, but keep this in mind here at the end!\n",
|
||||
"\n",
|
||||
"### Related Notebooks\n",
|
||||
"\n",
|
||||
"Other notebooks that have similar content or ideas\n",
|
||||
"- [notebook 1](link)\n",
|
||||
"- [notebook 2](link)\n",
|
||||
"\n",
|
||||
"### Additional Documention\n",
|
||||
"\n",
|
||||
"Add documention links and/or supporting scientific information"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<a href=\"#top\">Top</a>\n",
|
||||
"\n",
|
||||
"---"
|
||||
]
|
||||
}
|
||||
],
|
||||
"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.9.2"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
"nav_menu": {},
|
||||
"number_sections": true,
|
||||
"sideBar": true,
|
||||
"skip_h1_title": true,
|
||||
"title_cell": "Table of Contents",
|
||||
"title_sidebar": "Contents",
|
||||
"toc_cell": true,
|
||||
"toc_position": {},
|
||||
"toc_section_display": true,
|
||||
"toc_window_display": true
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
BIN
examples/images/GOES_CIRA_night_preview.png
Normal file
BIN
examples/images/GOES_CIRA_night_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 KiB |
BIN
examples/images/GOES_CIRA_preview.png
Normal file
BIN
examples/images/GOES_CIRA_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 366 KiB |
625
examples/notebooks/GOES_CIRA_Product_Writer.ipynb
Normal file
625
examples/notebooks/GOES_CIRA_Product_Writer.ipynb
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue