Skip to content

Commit eda08e3

Browse files
committed
deploy: 8674d6f
1 parent d7d4fde commit eda08e3

File tree

64 files changed

+14834
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14834
-123
lines changed

_preview/13/README.html

+17-3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
gtag('config', 'G-T52X8HNYE8');
7272
</script>
7373
<script>const THEBE_JS_URL = "https://unpkg.com/[email protected]/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
74+
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
75+
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
7476
<script>DOCUMENTATION_OPTIONS.pagename = 'README';</script>
7577
<link rel="icon" href="_static/favicon.ico"/>
7678
<link rel="index" title="Index" href="genindex.html" />
@@ -376,10 +378,20 @@
376378
<li class="toctree-l2"><a class="reference internal" href="notebooks/synoptic/xarray_500hPa_map.html">Using Xarray for Data read and selection</a></li>
377379
</ul>
378380
</details></li>
379-
<li class="toctree-l1 has-children"><a class="reference internal" href="notebooks/skewt/index.html">Skew-T Analysis</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="simple">
381+
<li class="toctree-l1 has-children"><a class="reference internal" href="notebooks/skewt/index.html">Skew-T Analysis</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
382+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Advanced_Sounding.html">Advanced Sounding</a></li>
383+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Foundational_Sounding.html">MetPy Skew-T Cookbook</a></li>
384+
385+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Skew-T_Analysis.html">Skew-T Analysis</a></li>
386+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Skew-T_Hodograph_Inset.html">Hodograph Inset</a></li>
387+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Skew-T_Layout_Hodograph.html">Skew-T with Complex Layout</a></li>
388+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Sounding_Calculations.html">Sounding Calculation Examples</a></li>
389+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Sounding_LCL_Dataset.html">Sounding as Dataset Example</a></li>
390+
<li class="toctree-l2"><a class="reference internal" href="notebooks/skewt/Sounding_Plotter.html">Sounding Plotter</a></li>
380391
</ul>
381392
</details></li>
382393
<li class="toctree-l1 has-children"><a class="reference internal" href="notebooks/convective/index.html">Convective Calculations</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
394+
<li class="toctree-l2"><a class="reference internal" href="notebooks/convective/MUCAPE.html">Most-Unstable Convective Available Potential Energy (MUCAPE)</a></li>
383395
<li class="toctree-l2"><a class="reference internal" href="notebooks/convective/miller_composite.html">Miller Composite Chart</a></li>
384396
</ul>
385397
</details></li>
@@ -389,7 +401,9 @@
389401
<li class="toctree-l2"><a class="reference internal" href="notebooks/specialty/Smoothing_Contours.html">Smoothing Contours</a></li>
390402
</ul>
391403
</details></li>
392-
<li class="toctree-l1 has-children"><a class="reference internal" href="notebooks/declarative/index.html">Simplified Plotting</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="simple">
404+
<li class="toctree-l1 has-children"><a class="reference internal" href="notebooks/declarative/index.html">Simplified Plotting</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
405+
<li class="toctree-l2"><a class="reference internal" href="notebooks/declarative/Declarative_300hPa.html">MetPy Declarative - 300 hPa</a></li>
406+
<li class="toctree-l2"><a class="reference internal" href="notebooks/declarative/declarative_500_hPa.html">Declarative 500-hPa Absolute Vorticity</a></li>
393407
</ul>
394408
</details></li>
395409
</ul>
@@ -426,7 +440,7 @@
426440
<img src="_static/NSF-Unidata_lockup_horizontal_2023_light.png" alt="NSF-Unidata Logo" width="35%"/>
427441
</div>
428442
<div class="column">
429-
<img src="_static/metpy_150x150.png" alt="MetPy Logo" width="100%"/>
443+
<img src="_static/metpy_150x150.png" alt="MetPy Logo" width="35%"/>
430444
</div>
431445
</div>
432446
<section class="tex2jax_ignore mathjax_ignore" id="metpy-cookbook">
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

_preview/13/_sources/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<img src="_static/NSF-Unidata_lockup_horizontal_2023_light.png" alt="NSF-Unidata Logo" width="35%"/>
44
</div>
55
<div class="column">
6-
<img src="_static/metpy_150x150.png" alt="MetPy Logo" width="100%"/>
6+
<img src="_static/metpy_150x150.png" alt="MetPy Logo" width="35%"/>
77
</div>
88
</div>
99

_preview/13/_sources/notebooks/convective/MUCAPE.ipynb

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"cell_marker": "\"\"\"",
7+
"lines_to_next_cell": 0
8+
},
9+
"source": [
10+
"Most-Unstable Convective Available Potential Energy (MUCAPE)\n",
11+
"======================\n",
12+
"Calculate MUCAPE on a grid of netCDF data using MetPy."
13+
]
14+
},
315
{
416
"cell_type": "code",
517
"execution_count": 10,

_preview/13/_sources/notebooks/convective/TCPW.ipynb

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"cell_marker": "\"\"\"",
7+
"lines_to_next_cell": 0
8+
},
9+
"source": [
10+
"Total Column Precipitable Water (TCPW)",
11+
"======================\n",
12+
"Calculate TCPW on a grid of netCDF data using MetPy."
13+
]
14+
},
315
{
416
"cell_type": "code",
517
"execution_count": 10,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"cell_marker": "\"\"\""
7+
},
8+
"source": [
9+
"MetPy Declarative - 300 hPa\n",
10+
"===========================\n",
11+
"\n",
12+
"By: Kevin Goebbert\n",
13+
"\n",
14+
"This example uses the declarative syntax available through the MetPy\n",
15+
"package to allow a more convenient method for creating simple maps of\n",
16+
"atmospheric data. The key thing the declarative language does is to\n",
17+
"reduce the number of packages that users will need to know in detail and\n",
18+
"instead allow them to set key parameters to get the map they desire. One\n",
19+
"key element is the use of xarray as the data object, which allows\n",
20+
"coordinate information to be associated with atmospheric variables."
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": null,
26+
"metadata": {},
27+
"outputs": [],
28+
"source": [
29+
"from datetime import datetime\n",
30+
"\n",
31+
"import metpy.calc as mpcalc\n",
32+
"from metpy.plots.declarative import *\n",
33+
"from metpy.units import units\n",
34+
"import xarray as xr"
35+
]
36+
},
37+
{
38+
"cell_type": "markdown",
39+
"metadata": {
40+
"cell_marker": "######################################################################"
41+
},
42+
"source": [
43+
"Open dataset using xarray module and subset global GFS to be over the\n",
44+
"CONUS.\n"
45+
]
46+
},
47+
{
48+
"cell_type": "code",
49+
"execution_count": null,
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"ds = xr.open_dataset('https://thredds.ucar.edu/thredds/dodsC/casestudies'\n",
54+
" '/python-gallery/GFS_20101026_1200.nc').sel(\n",
55+
" lon=slice(360-150, 360-50, 2), lat=slice(65, 20, 2))"
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"metadata": {
61+
"cell_marker": "######################################################################"
62+
},
63+
"source": [
64+
"Calculate Variable and Add to Dataset\n",
65+
"-------------------------------------\n",
66+
"\n",
67+
"Here it is demonstrated how you can calculate a new variable and add it\n",
68+
"to the xarray dataset (ds) so that it can be plotted with the\n",
69+
"declarative syntax. The key to adding a variable to an xarray dataset\n",
70+
"for use in the declarative syntax is the need to add a ``grid_mapping``\n",
71+
"and ``units`` attribute.\n"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"# Calculate New Variables and place into Xarray Dataset\n",
81+
"uwnd = ds['u-component_of_wind_isobaric']\n",
82+
"vwnd = ds['v-component_of_wind_isobaric']\n",
83+
"\n",
84+
"# Compute wind speed using MetPy\n",
85+
"wspd = mpcalc.wind_speed(uwnd, vwnd)\n",
86+
"\n",
87+
"# Place wind speed (wspd) into xarray dataset and attach needed attributes\n",
88+
"ds['wind_speed'] = wspd"
89+
]
90+
},
91+
{
92+
"cell_type": "markdown",
93+
"metadata": {
94+
"cell_marker": "######################################################################"
95+
},
96+
"source": [
97+
"Declarative Plot\n",
98+
"----------------\n",
99+
"\n",
100+
"The following settings create a single panel map plot of 300 hPa\n",
101+
"geopotential heights, wind speed, and wind barbs.\n"
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": null,
107+
"metadata": {},
108+
"outputs": [],
109+
"source": [
110+
"# Countour Plot of Geopotential Heights\n",
111+
"contour = ContourPlot()\n",
112+
"contour.data = ds\n",
113+
"contour.time = datetime(2010, 10, 31, 12)\n",
114+
"contour.field = 'Geopotential_height_isobaric'\n",
115+
"contour.level = 300 * units.hPa\n",
116+
"contour.linecolor = 'black'\n",
117+
"contour.linestyle = '-'\n",
118+
"contour.linewidth = 2\n",
119+
"contour.clabels = True\n",
120+
"contour.contours = list(range(0, 20000, 120))\n",
121+
"\n",
122+
"# Colorfilled Plot of Wind Speed\n",
123+
"cfill = FilledContourPlot()\n",
124+
"cfill.data = ds\n",
125+
"cfill.field = 'wind_speed'\n",
126+
"cfill.level = 300 * units.hPa\n",
127+
"cfill.colormap = 'BuPu'\n",
128+
"cfill.contours = list(range(50, 171, 20))\n",
129+
"cfill.colorbar = 'vertical'\n",
130+
"cfill.plot_units = 'kt'\n",
131+
"\n",
132+
"# Plot wind barbs\n",
133+
"barb = BarbPlot()\n",
134+
"barb.data = ds\n",
135+
"barb.level = 300 * units.hPa\n",
136+
"barb.field = ['u-component_of_wind_isobaric', 'v-component_of_wind_isobaric']\n",
137+
"barb.skip = (3, 3)\n",
138+
"barb.color = 'black'\n",
139+
"barb.barblength = 6.5\n",
140+
"barb.earth_relative = False\n",
141+
"barb.plot_units = 'kt'\n",
142+
"\n",
143+
"# Panel for plot with Map features\n",
144+
"panel = MapPanel()\n",
145+
"panel.layout = (1, 1, 1)\n",
146+
"panel.area = (-124, -72, 20, 53)\n",
147+
"panel.projection = 'lcc'\n",
148+
"panel.layers = ['coastline', 'borders', 'states', 'land']\n",
149+
"panel.plots = [cfill, contour, barb]\n",
150+
"\n",
151+
"# Bringing it all together\n",
152+
"pc = PanelContainer()\n",
153+
"pc.size = (15, 9)\n",
154+
"pc.panels = [panel]\n",
155+
"\n",
156+
"pc.show()"
157+
]
158+
},
159+
{
160+
"cell_type": "code",
161+
"execution_count": null,
162+
"metadata": {},
163+
"outputs": [],
164+
"source": []
165+
}
166+
],
167+
"metadata": {
168+
"jupytext": {
169+
"cell_metadata_filter": "-all",
170+
"main_language": "python",
171+
"notebook_metadata_filter": "-all"
172+
},
173+
"kernelspec": {
174+
"display_name": "Python 3 (ipykernel)",
175+
"language": "python",
176+
"name": "python3"
177+
},
178+
"language_info": {
179+
"codemirror_mode": {
180+
"name": "ipython",
181+
"version": 3
182+
},
183+
"file_extension": ".py",
184+
"mimetype": "text/x-python",
185+
"name": "python",
186+
"nbconvert_exporter": "python",
187+
"pygments_lexer": "ipython3",
188+
"version": "3.11.4"
189+
}
190+
},
191+
"nbformat": 4,
192+
"nbformat_minor": 4
193+
}

0 commit comments

Comments
 (0)