This commit is contained in:
srcarter3 2022-06-13 20:56:15 +00:00
parent 35ae86b023
commit 210a2d211d
21 changed files with 5 additions and 1094 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

View file

@ -1,570 +0,0 @@
==========
METAR main
==========
`Notebook <http://nbviewer.ipython.org/github/Unidata/python-awips/blob/master/examples/notebooks/METAR_main.ipynb>`_
.. container::
.. container::
.. rubric:: METAR Staion Plot with MetPy
:name: metar-staion-plot-with-metpy
**Python-AWIPS Tutorial Notebook**
.. container::
--------------
.. container::
Objectives
==========
- Use python-awips to connect to an edex server
- Define and filter data request for METAR surface obs
- Extract necessary data and reformat it for plotting
- Stylize and plot METAR station data using Cartopy, Matplotlib, and
MetPy
--------------
.. raw:: html
<h1>
Table of Contents
.. raw:: html
</h1>
.. container:: toc
.. raw:: html
<ul class="toc-item">
.. raw:: html
<li>
1  Imports
.. raw:: html
</li>
.. raw:: html
<li>
2  Function: get_cloud_cover()
.. raw:: html
</li>
.. raw:: html
<li>
3  Initial Setup
.. raw:: html
<ul class="toc-item">
.. raw:: html
<li>
3.1  Initial EDEX Connection
.. raw:: html
</li>
.. raw:: html
<li>
3.2  Setting Connection Location Names
.. raw:: html
</li>
.. raw:: html
</ul>
.. raw:: html
</li>
.. raw:: html
<li>
4  Filter by Time
.. raw:: html
</li>
.. raw:: html
<li>
5  Use the Data!
.. raw:: html
<ul class="toc-item">
.. raw:: html
<li>
5.1  Get the Data!
.. raw:: html
</li>
.. raw:: html
<li>
5.2  Extract all Parameters
.. raw:: html
</li>
.. raw:: html
<li>
5.3  Populate the Data Dictionary
.. raw:: html
</li>
.. raw:: html
</ul>
.. raw:: html
</li>
.. raw:: html
<li>
6  Plot the Data!
.. raw:: html
</li>
.. raw:: html
<li>
7  See Also
.. raw:: html
<ul class="toc-item">
.. raw:: html
<li>
7.1  Related Notebooks
.. raw:: html
</li>
.. raw:: html
<li>
7.2  Additional Documentation
.. raw:: html
</li>
.. raw:: html
</ul>
.. raw:: html
</li>
.. raw:: html
</ul>
Imports
-------
The imports below are used throughout the notebook. Note the first two
imports are coming directly from python-awips and allow us to connect to
an EDEX server, and define a timrange used for filtering the data. The
subsequent imports are for data manipulation and visualization.
.. code:: ipython3
from awips.dataaccess import DataAccessLayer
from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
from datetime import datetime, timedelta
import numpy as np
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from metpy.calc import wind_components
from metpy.plots import StationPlot, StationPlotLayout, sky_cover
from metpy.units import units
Top
--------------
Function: get_cloud_cover()
---------------------------
Returns the cloud fraction values as integer codes (0 through 8).
.. code:: ipython3
def get_cloud_cover(code):
if 'OVC' in code:
return 8
elif 'BKN' in code:
return 6
elif 'SCT' in code:
return 4
elif 'FEW' in code:
return 2
else:
return 0
Top
--------------
Initial Setup
-------------
Initial EDEX Connection
~~~~~~~~~~~~~~~~~~~~~~~
First we establish a connection to Unidatas public EDEX server. With
that connection made, we can create a `new data request
object <http://unidata.github.io/python-awips/api/IDataRequest.html>`__
and set the data type to **obs**.
Then, because were going to uses MetPys
`StationPlot <https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlot.html>`__
and
`StationPlotLayout <https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html>`__
we need to define several parameters, and then set them on the data
request object.
.. code:: ipython3
# EDEX Request
edexServer = "edex-cloud.unidata.ucar.edu"
DataAccessLayer.changeEDEXHost(edexServer)
request = DataAccessLayer.newDataRequest("obs")
# define desired parameters
single_value_params = ["timeObs", "stationName", "longitude", "latitude",
"temperature", "dewpoint", "windDir",
"windSpeed"]
multi_value_params = ["skyCover"]
params = single_value_params + multi_value_params
# set all parameters on the request
request.setParameters(*(params))
Setting Connection Location Names
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We are also going to define specific station IDs so that our plot is not
too cluttered.
.. code:: ipython3
# Define a list of station IDs to plot
selected = ['KPDX', 'KOKC', 'KICT', 'KGLD', 'KMEM', 'KBOS', 'KMIA', 'KMOB', 'KABQ', 'KPHX', 'KTTF',
'KORD', 'KBIL', 'KBIS', 'KCPR', 'KLAX', 'KATL', 'KMSP', 'KSLC', 'KDFW', 'KNYC', 'KPHL',
'KPIT', 'KIND', 'KOLY', 'KSYR', 'KLEX', 'KCHS', 'KTLH', 'KHOU', 'KGJT', 'KLBB', 'KLSV',
'KGRB', 'KCLT', 'KLNK', 'KDSM', 'KBOI', 'KFSD', 'KRAP', 'KRIC', 'KJAN', 'KHSV', 'KCRW',
'KSAT', 'KBUY', 'K0CO', 'KZPC', 'KVIH', 'KBDG', 'KMLF', 'KELY', 'KWMC', 'KOTH', 'KCAR',
'KLMT', 'KRDM', 'KPDT', 'KSEA', 'KUIL', 'KEPH', 'KPUW', 'KCOE', 'KMLP', 'KPIH', 'KIDA',
'KMSO', 'KACV', 'KHLN', 'KBIL', 'KOLF', 'KRUT', 'KPSM', 'KJAX', 'KTPA', 'KSHV', 'KMSY',
'KELP', 'KRNO', 'KFAT', 'KSFO', 'KNYL', 'KBRO', 'KMRF', 'KDRT', 'KFAR', 'KBDE', 'KDLH',
'KHOT', 'KLBF', 'KFLG', 'KCLE', 'KUNV']
# set the location names to the desired station IDs
request.setLocationNames(*(selected))
Top
--------------
Filter by Time
--------------
Here we decide how much data we want to pull from EDEX. By default well
request 1 hour, but that value can easily be modified by `adjusting the
``timedelta(hours = 1)`` <https://docs.python.org/3/library/datetime.html#timedelta-objects>`__
in line ``2``. The more data we request, the longer this section will
take to run.
.. code:: ipython3
# Time range
lastHourDateTime = datetime.utcnow() - timedelta(hours = 1)
start = lastHourDateTime.strftime('%Y-%m-%d %H')
beginRange = datetime.strptime( start + ":00:00", "%Y-%m-%d %H:%M:%S")
endRange = datetime.strptime( start + ":59:59", "%Y-%m-%d %H:%M:%S")
timerange = TimeRange(beginRange, endRange)
Top
--------------
Use the Data!
-------------
Get the Data!
~~~~~~~~~~~~~
Now that we have our ``request`` and TimeRange ``timerange`` objects
ready, were ready to get the data array from EDEX.
.. code:: ipython3
# Get response
response = DataAccessLayer.getGeometryData(request,timerange)
Extract all Parameters
~~~~~~~~~~~~~~~~~~~~~~
In this section we start gathering all the information well need to
properly display our data. First we create an empty dictionary and array
to keep track of all data and unique station IDs. We also create a
boolean to help us only grab the first entry for ``skyCover`` related to
a station id.
.. container:: alert-info
::
<b>Note:</b> The way the data responses are returned, we recieve many <code>skyCover</code> entries for each station ID, but we only want to keep track of the most recent one (first one returned).
After defining these variables, we are ready to start looping through
our response data. If the response is an entry of ``skyCover``, and this
is a new station id, then set the skyCover value in the obs dictionary.
If this is not a skyCover entry, then explicitly set the ``timeObs``
variable (because we have to manipulate it slightly), and dynamically
set all the remaining parameters.
.. code:: ipython3
# define a dictionary and array that will be populated from our for loop below
obs = dict({params: [] for params in params})
station_names = []
time_title = ""
# cycle through all the data in the response, in reverse order to get the most recent data first
for ob in reversed(response):
avail_params = ob.getParameters()
#print(avail_params)
# if it has cloud information, we want the last of the 6 entries (most recent)
if "skyCover" in avail_params:
if i == 5:
# store the associated cloud cover int for the skyCover string
obs['skyCover'].append(get_cloud_cover(ob.getString("skyCover")))
i = i + 1
elif "stationName" in avail_params:
# If we already have a record for this stationName, skip
if ob.getString('stationName') not in station_names:
station_names.append(ob.getString('stationName'))
i = 0
for param in single_value_params:
if param in avail_params:
if param == 'timeObs':
obs[param].append(datetime.fromtimestamp(ob.getNumber(param)/1000.0))
if time_title == "":
time_title = str(ob.getDataTime())
else:
try:
obs[param].append(ob.getNumber(param))
except TypeError:
obs[param].append(ob.getString(param))
else:
obs[param].append(None)
Populate the Data Dictionary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next grab the variables out of the obs dictionary we just populated,
attach correct units, (calculate their components, in the instance of
wind) and put them into a new dictionary that we will hand the plotting
function later.
.. code:: ipython3
data = dict()
data['stid'] = np.array(obs['stationName'])
data['latitude'] = np.array(obs['latitude'])
data['longitude'] = np.array(obs['longitude'])
data['air_temperature'] = np.array(obs['temperature'], dtype=float)* units.degC
data['dew_point_temperature'] = np.array(obs['dewpoint'], dtype=float)* units.degC
direction = np.array(obs['windDir'])
direction[direction == -9999.0] = 'nan'
u, v = wind_components(np.array(obs['windSpeed']) * units('knots'),
direction * units.degree)
data['eastward_wind'], data['northward_wind'] = u, v
data['cloud_coverage'] = np.array(obs['skyCover'])
Top
--------------
Plot the Data!
--------------
Now we have all the data we need to create our plot! First well assign
a projection and create our figure and axes.
Next, we use Cartopy to add common features (land, ocean, lakes,
borders, etc) to help give us a more contextual map of the United States
to plot the METAR stations on. We create and add a title for our figure
as well.
Additionally, we use `MetPys
StationPlotLayout <https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html>`__
to instantiate a custom layout and define all the attributes we want
displayed. We need to then set the data dictionary (containing all of
our data values) on the custom layout so it knows what to draw.
Finally, we display the plot!
.. code:: ipython3
proj = ccrs.LambertConformal(central_longitude=-95, central_latitude=35,
standard_parallels=[35])
# Create the figure
fig = plt.figure(figsize=(20, 10))
ax = fig.add_subplot(1, 1, 1, projection=proj)
# Add various map elements
ax.add_feature(cfeature.LAND)
ax.add_feature(cfeature.OCEAN)
ax.add_feature(cfeature.LAKES)
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.STATES)
ax.add_feature(cfeature.BORDERS, linewidth=2)
# Set plot bounds
ax.set_extent((-118, -73, 23, 50))
ax.set_title(time_title + " | METAR | " + edexServer)
# Winds, temps, dewpoint, station id
custom_layout = StationPlotLayout()
custom_layout.add_barb('eastward_wind', 'northward_wind', units='knots')
custom_layout.add_value('NW', 'air_temperature', fmt='.0f', units='degF', color='darkred')
custom_layout.add_value('SW', 'dew_point_temperature', fmt='.0f', units='degF', color='darkgreen')
custom_layout.add_symbol('C', 'cloud_coverage', sky_cover)
stationplot = StationPlot(ax, data['longitude'], data['latitude'], clip_on=True,
transform=ccrs.PlateCarree(), fontsize=10)
stationplot.plot_text((2, 0), data['stid'])
custom_layout.plot(stationplot, data)
plt.show()
.. image:: METAR_main_files/METAR_main_25_0.png
Top
--------------
See Also
--------
- `Aviation Weather Center Static METAR Plots
Information <https://www.aviationweather.gov/metar/help?page=plot>`__
Related Notebooks
~~~~~~~~~~~~~~~~~
- `Grid Levels and
Parameters <http://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html>`__
- `Colored Surface Temperature
Plot <http://unidata.github.io/python-awips/examples/generated/Colored_Surface_Temperature_Plot.html>`__
Additional Documentation
~~~~~~~~~~~~~~~~~~~~~~~~
**python-awips:**
- `DataAccessLayer.changeEDEXHost() <http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.changeEDEXHost>`__
- `DataAccessLayer.newDataRequest() <http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.newDataRequest>`__
- `IDataRequest <http://unidata.github.io/python-awips/api/IDataRequest.html>`__
- `DataAccessLayer.getGeometryData <http://unidata.github.io/python-awips/api/PyGeometryData.html>`__
**datetime:**
- `datetime.datetime <https://docs.python.org/3/library/datetime.html#datetime-objects>`__
- `datetime.utcnow() <https://docs.python.org/3/library/datetime.html?#datetime.datetime.utcnow>`__
- `datetime.timedelta <https://docs.python.org/3/library/datetime.html#timedelta-objects>`__
- `datetime.strftime() and
datetime.strptime() <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior>`__
**numpy:**
- `np.array <https://numpy.org/doc/stable/reference/generated/numpy.array.html>`__
**cartopy:**
- `cartopy projection
list <https://scitools.org.uk/cartopy/docs/v0.14/crs/projections.html?#cartopy-projection-list>`__
- `cartopy feature
interface <https://scitools.org.uk/cartopy/docs/v0.14/matplotlib/feature_interface.html>`__
**matplotlib:**
- `matplotlib.pyplot() <https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html>`__
- `matplotlib.pyplot.figure() <https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html>`__
- `matplotlib.pyplot.figure.add_subplot <https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure.add_subplot>`__
- `ax.set_extent <https://matplotlib.org/stable/api/image_api.html?highlight=set_extent#matplotlib.image.AxesImage.set_extent>`__
- `ax.set_title <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_title.html>`__
**metpy:**
- `metpy.calc.wind_components <https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.wind_components.html>`__
- `metpy.plots.StationPlot() <https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlot.html>`__
- `metpy.plots.StationPlotLayout() <https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html>`__
- `metpy.units <https://unidata.github.io/MetPy/latest/api/generated/metpy.units.html>`__
Top
--------------

View file

@ -66,7 +66,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -65,7 +65,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -57,7 +57,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -65,7 +65,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -56,7 +56,6 @@
</li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -69,7 +69,6 @@
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -20,7 +20,7 @@
<link rel="author" title="About these documents" href="../../about.html" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="METAR main" href="METAR_main.html" />
<link rel="next" title="Map Resources and Topography" href="Map_Resources_and_Topography.html" />
<link rel="prev" title="Grid Levels and Parameters" href="Grid_Levels_and_Parameters.html" />
</head>
@ -66,7 +66,6 @@
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>
@ -480,7 +479,7 @@ interface</a></p></li>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Grid_Levels_and_Parameters.html" class="btn btn-neutral float-left" title="Grid Levels and Parameters" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="METAR_main.html" class="btn btn-neutral float-right" title="METAR main" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="Map_Resources_and_Topography.html" class="btn btn-neutral float-right" title="Map Resources and Topography" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View file

@ -1,502 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>METAR main &mdash; python-awips documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="author" title="About these documents" href="../../about.html" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Map Resources and Topography" href="Map_Resources_and_Topography.html" />
<link rel="prev" title="METAR Station Plot with MetPy" href="METAR_Station_Plot_with_MetPy.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home"> python-awips
</a>
<div class="version">
18.1.8
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../api/index.html">API Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../datatypes.html">Available Data Types</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Data Plotting Examples</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="Colored_Surface_Temperature_Plot.html">Colored Surface Temperature Plot</a></li>
<li class="toctree-l2"><a class="reference internal" href="Colorized_Grid_Data.html">Colorized Grid Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="Forecast_Model_Vertical_Sounding.html">Forecast Model Vertical Sounding</a></li>
<li class="toctree-l2"><a class="reference internal" href="GOES_CIRA_Product_Writer.html">GOES CIRA Product Writer</a></li>
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">METAR main</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#objectives">Objectives</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#imports">Imports</a></li>
<li class="toctree-l4"><a class="reference internal" href="#function-get-cloud-cover">Function: get_cloud_cover()</a></li>
<li class="toctree-l4"><a class="reference internal" href="#initial-setup">Initial Setup</a></li>
<li class="toctree-l4"><a class="reference internal" href="#filter-by-time">Filter by Time</a></li>
<li class="toctree-l4"><a class="reference internal" href="#use-the-data">Use the Data!</a></li>
<li class="toctree-l4"><a class="reference internal" href="#plot-the-data">Plot the Data!</a></li>
<li class="toctree-l4"><a class="reference internal" href="#see-also">See Also</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>
<li class="toctree-l2"><a class="reference internal" href="Precip_Accumulation-Region_Of_Interest.html">Precip Accumulation-Region Of Interest</a></li>
<li class="toctree-l2"><a class="reference internal" href="Regional_Surface_Obs_Plot.html">Regional Surface Obs Plot</a></li>
<li class="toctree-l2"><a class="reference internal" href="Satellite_Imagery.html">Satellite Imagery</a></li>
<li class="toctree-l2"><a class="reference internal" href="Upper_Air_BUFR_Soundings.html">Upper Air BUFR Soundings</a></li>
<li class="toctree-l2"><a class="reference internal" href="Watch_Warning_and_Advisory_Plotting.html">Watch Warning and Advisory Plotting</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../dev.html">Development Guide</a></li>
<li class="toctree-l1"><a class="reference external" href="http://unidata.github.io/awips2/appendix/appendix-grid-parameters/">AWIPS Grid Parameters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../about.html">About Unidata AWIPS</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">python-awips</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="../index.html">Data Plotting Examples</a> &raquo;</li>
<li>METAR main</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/examples/generated/METAR_main.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="metar-main">
<h1>METAR main<a class="headerlink" href="#metar-main" title="Permalink to this heading"></a></h1>
<p><a class="reference external" href="http://nbviewer.ipython.org/github/Unidata/python-awips/blob/master/examples/notebooks/METAR_main.ipynb">Notebook</a>
.. container:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">container</span><span class="p">::</span>
<span class="o">..</span> <span class="n">rubric</span><span class="p">::</span> <span class="n">METAR</span> <span class="n">Staion</span> <span class="n">Plot</span> <span class="k">with</span> <span class="n">MetPy</span>
<span class="p">:</span><span class="n">name</span><span class="p">:</span> <span class="n">metar</span><span class="o">-</span><span class="n">staion</span><span class="o">-</span><span class="n">plot</span><span class="o">-</span><span class="k">with</span><span class="o">-</span><span class="n">metpy</span>
<span class="o">**</span><span class="n">Python</span><span class="o">-</span><span class="n">AWIPS</span> <span class="n">Tutorial</span> <span class="n">Notebook</span><span class="o">**</span>
<span class="o">..</span> <span class="n">container</span><span class="p">::</span>
</pre></div>
</div>
<hr class="docutils" />
<section id="objectives">
<h2>Objectives<a class="headerlink" href="#objectives" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p>Use python-awips to connect to an edex server</p></li>
<li><p>Define and filter data request for METAR surface obs</p></li>
<li><p>Extract necessary data and reformat it for plotting</p></li>
<li><p>Stylize and plot METAR station data using Cartopy, Matplotlib, and
MetPy</p></li>
</ul>
<hr class="docutils" />
<h1><p>Table of Contents</p>
</h1><div class="toc docutils container">
<ul class="toc-item"><li><p>1  Imports</p>
</li><li><p>2  Function: get_cloud_cover()</p>
</li><li><p>3  Initial Setup</p>
<ul class="toc-item"><li><p>3.1  Initial EDEX Connection</p>
</li><li><p>3.2  Setting Connection Location Names</p>
</li></ul></li><li><p>4  Filter by Time</p>
</li><li><p>5  Use the Data!</p>
<ul class="toc-item"><li><p>5.1  Get the Data!</p>
</li><li><p>5.2  Extract all Parameters</p>
</li><li><p>5.3  Populate the Data Dictionary</p>
</li></ul></li><li><p>6  Plot the Data!</p>
</li><li><p>7  See Also</p>
<ul class="toc-item"><li><p>7.1  Related Notebooks</p>
</li><li><p>7.2  Additional Documentation</p>
</li></ul></li></ul></div>
<section id="imports">
<h3>Imports<a class="headerlink" href="#imports" title="Permalink to this heading"></a></h3>
<p>The imports below are used throughout the notebook. Note the first two
imports are coming directly from python-awips and allow us to connect to
an EDEX server, and define a timrange used for filtering the data. The
subsequent imports are for data manipulation and visualization.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">awips.dataaccess</span> <span class="kn">import</span> <span class="n">DataAccessLayer</span>
<span class="kn">from</span> <span class="nn">dynamicserialize.dstypes.com.raytheon.uf.common.time</span> <span class="kn">import</span> <span class="n">TimeRange</span>
<span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">timedelta</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">cartopy.crs</span> <span class="k">as</span> <span class="nn">ccrs</span>
<span class="kn">import</span> <span class="nn">cartopy.feature</span> <span class="k">as</span> <span class="nn">cfeature</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">from</span> <span class="nn">metpy.calc</span> <span class="kn">import</span> <span class="n">wind_components</span>
<span class="kn">from</span> <span class="nn">metpy.plots</span> <span class="kn">import</span> <span class="n">StationPlot</span><span class="p">,</span> <span class="n">StationPlotLayout</span><span class="p">,</span> <span class="n">sky_cover</span>
<span class="kn">from</span> <span class="nn">metpy.units</span> <span class="kn">import</span> <span class="n">units</span>
</pre></div>
</div>
<p>Top</p>
</section>
<hr class="docutils" />
<section id="function-get-cloud-cover">
<h3>Function: get_cloud_cover()<a class="headerlink" href="#function-get-cloud-cover" title="Permalink to this heading"></a></h3>
<p>Returns the cloud fraction values as integer codes (0 through 8).</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">get_cloud_cover</span><span class="p">(</span><span class="n">code</span><span class="p">):</span>
<span class="k">if</span> <span class="s1">&#39;OVC&#39;</span> <span class="ow">in</span> <span class="n">code</span><span class="p">:</span>
<span class="k">return</span> <span class="mi">8</span>
<span class="k">elif</span> <span class="s1">&#39;BKN&#39;</span> <span class="ow">in</span> <span class="n">code</span><span class="p">:</span>
<span class="k">return</span> <span class="mi">6</span>
<span class="k">elif</span> <span class="s1">&#39;SCT&#39;</span> <span class="ow">in</span> <span class="n">code</span><span class="p">:</span>
<span class="k">return</span> <span class="mi">4</span>
<span class="k">elif</span> <span class="s1">&#39;FEW&#39;</span> <span class="ow">in</span> <span class="n">code</span><span class="p">:</span>
<span class="k">return</span> <span class="mi">2</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="mi">0</span>
</pre></div>
</div>
<p>Top</p>
</section>
<hr class="docutils" />
<section id="initial-setup">
<h3>Initial Setup<a class="headerlink" href="#initial-setup" title="Permalink to this heading"></a></h3>
<section id="initial-edex-connection">
<h4>Initial EDEX Connection<a class="headerlink" href="#initial-edex-connection" title="Permalink to this heading"></a></h4>
<p>First we establish a connection to Unidatas public EDEX server. With
that connection made, we can create a <a class="reference external" href="http://unidata.github.io/python-awips/api/IDataRequest.html">new data request
object</a>
and set the data type to <strong>obs</strong>.</p>
<p>Then, because were going to uses MetPys
<a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlot.html">StationPlot</a>
and
<a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html">StationPlotLayout</a>
we need to define several parameters, and then set them on the data
request object.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># EDEX Request</span>
<span class="n">edexServer</span> <span class="o">=</span> <span class="s2">&quot;edex-cloud.unidata.ucar.edu&quot;</span>
<span class="n">DataAccessLayer</span><span class="o">.</span><span class="n">changeEDEXHost</span><span class="p">(</span><span class="n">edexServer</span><span class="p">)</span>
<span class="n">request</span> <span class="o">=</span> <span class="n">DataAccessLayer</span><span class="o">.</span><span class="n">newDataRequest</span><span class="p">(</span><span class="s2">&quot;obs&quot;</span><span class="p">)</span>
<span class="c1"># define desired parameters</span>
<span class="n">single_value_params</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;timeObs&quot;</span><span class="p">,</span> <span class="s2">&quot;stationName&quot;</span><span class="p">,</span> <span class="s2">&quot;longitude&quot;</span><span class="p">,</span> <span class="s2">&quot;latitude&quot;</span><span class="p">,</span>
<span class="s2">&quot;temperature&quot;</span><span class="p">,</span> <span class="s2">&quot;dewpoint&quot;</span><span class="p">,</span> <span class="s2">&quot;windDir&quot;</span><span class="p">,</span>
<span class="s2">&quot;windSpeed&quot;</span><span class="p">]</span>
<span class="n">multi_value_params</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;skyCover&quot;</span><span class="p">]</span>
<span class="n">params</span> <span class="o">=</span> <span class="n">single_value_params</span> <span class="o">+</span> <span class="n">multi_value_params</span>
<span class="c1"># set all parameters on the request</span>
<span class="n">request</span><span class="o">.</span><span class="n">setParameters</span><span class="p">(</span><span class="o">*</span><span class="p">(</span><span class="n">params</span><span class="p">))</span>
</pre></div>
</div>
</section>
<section id="setting-connection-location-names">
<h4>Setting Connection Location Names<a class="headerlink" href="#setting-connection-location-names" title="Permalink to this heading"></a></h4>
<p>We are also going to define specific station IDs so that our plot is not
too cluttered.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Define a list of station IDs to plot</span>
<span class="n">selected</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;KPDX&#39;</span><span class="p">,</span> <span class="s1">&#39;KOKC&#39;</span><span class="p">,</span> <span class="s1">&#39;KICT&#39;</span><span class="p">,</span> <span class="s1">&#39;KGLD&#39;</span><span class="p">,</span> <span class="s1">&#39;KMEM&#39;</span><span class="p">,</span> <span class="s1">&#39;KBOS&#39;</span><span class="p">,</span> <span class="s1">&#39;KMIA&#39;</span><span class="p">,</span> <span class="s1">&#39;KMOB&#39;</span><span class="p">,</span> <span class="s1">&#39;KABQ&#39;</span><span class="p">,</span> <span class="s1">&#39;KPHX&#39;</span><span class="p">,</span> <span class="s1">&#39;KTTF&#39;</span><span class="p">,</span>
<span class="s1">&#39;KORD&#39;</span><span class="p">,</span> <span class="s1">&#39;KBIL&#39;</span><span class="p">,</span> <span class="s1">&#39;KBIS&#39;</span><span class="p">,</span> <span class="s1">&#39;KCPR&#39;</span><span class="p">,</span> <span class="s1">&#39;KLAX&#39;</span><span class="p">,</span> <span class="s1">&#39;KATL&#39;</span><span class="p">,</span> <span class="s1">&#39;KMSP&#39;</span><span class="p">,</span> <span class="s1">&#39;KSLC&#39;</span><span class="p">,</span> <span class="s1">&#39;KDFW&#39;</span><span class="p">,</span> <span class="s1">&#39;KNYC&#39;</span><span class="p">,</span> <span class="s1">&#39;KPHL&#39;</span><span class="p">,</span>
<span class="s1">&#39;KPIT&#39;</span><span class="p">,</span> <span class="s1">&#39;KIND&#39;</span><span class="p">,</span> <span class="s1">&#39;KOLY&#39;</span><span class="p">,</span> <span class="s1">&#39;KSYR&#39;</span><span class="p">,</span> <span class="s1">&#39;KLEX&#39;</span><span class="p">,</span> <span class="s1">&#39;KCHS&#39;</span><span class="p">,</span> <span class="s1">&#39;KTLH&#39;</span><span class="p">,</span> <span class="s1">&#39;KHOU&#39;</span><span class="p">,</span> <span class="s1">&#39;KGJT&#39;</span><span class="p">,</span> <span class="s1">&#39;KLBB&#39;</span><span class="p">,</span> <span class="s1">&#39;KLSV&#39;</span><span class="p">,</span>
<span class="s1">&#39;KGRB&#39;</span><span class="p">,</span> <span class="s1">&#39;KCLT&#39;</span><span class="p">,</span> <span class="s1">&#39;KLNK&#39;</span><span class="p">,</span> <span class="s1">&#39;KDSM&#39;</span><span class="p">,</span> <span class="s1">&#39;KBOI&#39;</span><span class="p">,</span> <span class="s1">&#39;KFSD&#39;</span><span class="p">,</span> <span class="s1">&#39;KRAP&#39;</span><span class="p">,</span> <span class="s1">&#39;KRIC&#39;</span><span class="p">,</span> <span class="s1">&#39;KJAN&#39;</span><span class="p">,</span> <span class="s1">&#39;KHSV&#39;</span><span class="p">,</span> <span class="s1">&#39;KCRW&#39;</span><span class="p">,</span>
<span class="s1">&#39;KSAT&#39;</span><span class="p">,</span> <span class="s1">&#39;KBUY&#39;</span><span class="p">,</span> <span class="s1">&#39;K0CO&#39;</span><span class="p">,</span> <span class="s1">&#39;KZPC&#39;</span><span class="p">,</span> <span class="s1">&#39;KVIH&#39;</span><span class="p">,</span> <span class="s1">&#39;KBDG&#39;</span><span class="p">,</span> <span class="s1">&#39;KMLF&#39;</span><span class="p">,</span> <span class="s1">&#39;KELY&#39;</span><span class="p">,</span> <span class="s1">&#39;KWMC&#39;</span><span class="p">,</span> <span class="s1">&#39;KOTH&#39;</span><span class="p">,</span> <span class="s1">&#39;KCAR&#39;</span><span class="p">,</span>
<span class="s1">&#39;KLMT&#39;</span><span class="p">,</span> <span class="s1">&#39;KRDM&#39;</span><span class="p">,</span> <span class="s1">&#39;KPDT&#39;</span><span class="p">,</span> <span class="s1">&#39;KSEA&#39;</span><span class="p">,</span> <span class="s1">&#39;KUIL&#39;</span><span class="p">,</span> <span class="s1">&#39;KEPH&#39;</span><span class="p">,</span> <span class="s1">&#39;KPUW&#39;</span><span class="p">,</span> <span class="s1">&#39;KCOE&#39;</span><span class="p">,</span> <span class="s1">&#39;KMLP&#39;</span><span class="p">,</span> <span class="s1">&#39;KPIH&#39;</span><span class="p">,</span> <span class="s1">&#39;KIDA&#39;</span><span class="p">,</span>
<span class="s1">&#39;KMSO&#39;</span><span class="p">,</span> <span class="s1">&#39;KACV&#39;</span><span class="p">,</span> <span class="s1">&#39;KHLN&#39;</span><span class="p">,</span> <span class="s1">&#39;KBIL&#39;</span><span class="p">,</span> <span class="s1">&#39;KOLF&#39;</span><span class="p">,</span> <span class="s1">&#39;KRUT&#39;</span><span class="p">,</span> <span class="s1">&#39;KPSM&#39;</span><span class="p">,</span> <span class="s1">&#39;KJAX&#39;</span><span class="p">,</span> <span class="s1">&#39;KTPA&#39;</span><span class="p">,</span> <span class="s1">&#39;KSHV&#39;</span><span class="p">,</span> <span class="s1">&#39;KMSY&#39;</span><span class="p">,</span>
<span class="s1">&#39;KELP&#39;</span><span class="p">,</span> <span class="s1">&#39;KRNO&#39;</span><span class="p">,</span> <span class="s1">&#39;KFAT&#39;</span><span class="p">,</span> <span class="s1">&#39;KSFO&#39;</span><span class="p">,</span> <span class="s1">&#39;KNYL&#39;</span><span class="p">,</span> <span class="s1">&#39;KBRO&#39;</span><span class="p">,</span> <span class="s1">&#39;KMRF&#39;</span><span class="p">,</span> <span class="s1">&#39;KDRT&#39;</span><span class="p">,</span> <span class="s1">&#39;KFAR&#39;</span><span class="p">,</span> <span class="s1">&#39;KBDE&#39;</span><span class="p">,</span> <span class="s1">&#39;KDLH&#39;</span><span class="p">,</span>
<span class="s1">&#39;KHOT&#39;</span><span class="p">,</span> <span class="s1">&#39;KLBF&#39;</span><span class="p">,</span> <span class="s1">&#39;KFLG&#39;</span><span class="p">,</span> <span class="s1">&#39;KCLE&#39;</span><span class="p">,</span> <span class="s1">&#39;KUNV&#39;</span><span class="p">]</span>
<span class="c1"># set the location names to the desired station IDs</span>
<span class="n">request</span><span class="o">.</span><span class="n">setLocationNames</span><span class="p">(</span><span class="o">*</span><span class="p">(</span><span class="n">selected</span><span class="p">))</span>
</pre></div>
</div>
<p>Top</p>
</section>
</section>
<hr class="docutils" />
<section id="filter-by-time">
<h3>Filter by Time<a class="headerlink" href="#filter-by-time" title="Permalink to this heading"></a></h3>
<p>Here we decide how much data we want to pull from EDEX. By default well
request 1 hour, but that value can easily be modified by <cite>adjusting the
``timedelta(hours = 1)`</cite> &lt;<a class="reference external" href="https://docs.python.org/3/library/datetime.html#timedelta-objects">https://docs.python.org/3/library/datetime.html#timedelta-objects</a>&gt;`__
in line <code class="docutils literal notranslate"><span class="pre">2</span></code>. The more data we request, the longer this section will
take to run.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Time range</span>
<span class="n">lastHourDateTime</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcnow</span><span class="p">()</span> <span class="o">-</span> <span class="n">timedelta</span><span class="p">(</span><span class="n">hours</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">lastHourDateTime</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%m-</span><span class="si">%d</span><span class="s1"> %H&#39;</span><span class="p">)</span>
<span class="n">beginRange</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span> <span class="n">start</span> <span class="o">+</span> <span class="s2">&quot;:00:00&quot;</span><span class="p">,</span> <span class="s2">&quot;%Y-%m-</span><span class="si">%d</span><span class="s2"> %H:%M:%S&quot;</span><span class="p">)</span>
<span class="n">endRange</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span> <span class="n">start</span> <span class="o">+</span> <span class="s2">&quot;:59:59&quot;</span><span class="p">,</span> <span class="s2">&quot;%Y-%m-</span><span class="si">%d</span><span class="s2"> %H:%M:%S&quot;</span><span class="p">)</span>
<span class="n">timerange</span> <span class="o">=</span> <span class="n">TimeRange</span><span class="p">(</span><span class="n">beginRange</span><span class="p">,</span> <span class="n">endRange</span><span class="p">)</span>
</pre></div>
</div>
<p>Top</p>
</section>
<hr class="docutils" />
<section id="use-the-data">
<h3>Use the Data!<a class="headerlink" href="#use-the-data" title="Permalink to this heading"></a></h3>
<section id="get-the-data">
<h4>Get the Data!<a class="headerlink" href="#get-the-data" title="Permalink to this heading"></a></h4>
<p>Now that we have our <code class="docutils literal notranslate"><span class="pre">request</span></code> and TimeRange <code class="docutils literal notranslate"><span class="pre">timerange</span></code> objects
ready, were ready to get the data array from EDEX.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Get response</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">DataAccessLayer</span><span class="o">.</span><span class="n">getGeometryData</span><span class="p">(</span><span class="n">request</span><span class="p">,</span><span class="n">timerange</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="extract-all-parameters">
<h4>Extract all Parameters<a class="headerlink" href="#extract-all-parameters" title="Permalink to this heading"></a></h4>
<p>In this section we start gathering all the information well need to
properly display our data. First we create an empty dictionary and array
to keep track of all data and unique station IDs. We also create a
boolean to help us only grab the first entry for <code class="docutils literal notranslate"><span class="pre">skyCover</span></code> related to
a station id.</p>
<div class="alert-info docutils container">
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">b</span><span class="o">&gt;</span><span class="n">Note</span><span class="p">:</span><span class="o">&lt;/</span><span class="n">b</span><span class="o">&gt;</span> <span class="n">The</span> <span class="n">way</span> <span class="n">the</span> <span class="n">data</span> <span class="n">responses</span> <span class="n">are</span> <span class="n">returned</span><span class="p">,</span> <span class="n">we</span> <span class="n">recieve</span> <span class="n">many</span> <span class="o">&lt;</span><span class="n">code</span><span class="o">&gt;</span><span class="n">skyCover</span><span class="o">&lt;/</span><span class="n">code</span><span class="o">&gt;</span> <span class="n">entries</span> <span class="k">for</span> <span class="n">each</span> <span class="n">station</span> <span class="n">ID</span><span class="p">,</span> <span class="n">but</span> <span class="n">we</span> <span class="n">only</span> <span class="n">want</span> <span class="n">to</span> <span class="n">keep</span> <span class="n">track</span> <span class="n">of</span> <span class="n">the</span> <span class="n">most</span> <span class="n">recent</span> <span class="n">one</span> <span class="p">(</span><span class="n">first</span> <span class="n">one</span> <span class="n">returned</span><span class="p">)</span><span class="o">.</span>
</pre></div>
</div>
</div>
<p>After defining these variables, we are ready to start looping through
our response data. If the response is an entry of <code class="docutils literal notranslate"><span class="pre">skyCover</span></code>, and this
is a new station id, then set the skyCover value in the obs dictionary.
If this is not a skyCover entry, then explicitly set the <code class="docutils literal notranslate"><span class="pre">timeObs</span></code>
variable (because we have to manipulate it slightly), and dynamically
set all the remaining parameters.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># define a dictionary and array that will be populated from our for loop below</span>
<span class="n">obs</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">({</span><span class="n">params</span><span class="p">:</span> <span class="p">[]</span> <span class="k">for</span> <span class="n">params</span> <span class="ow">in</span> <span class="n">params</span><span class="p">})</span>
<span class="n">station_names</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">time_title</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="c1"># cycle through all the data in the response, in reverse order to get the most recent data first</span>
<span class="k">for</span> <span class="n">ob</span> <span class="ow">in</span> <span class="nb">reversed</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="n">avail_params</span> <span class="o">=</span> <span class="n">ob</span><span class="o">.</span><span class="n">getParameters</span><span class="p">()</span>
<span class="c1">#print(avail_params)</span>
<span class="c1"># if it has cloud information, we want the last of the 6 entries (most recent)</span>
<span class="k">if</span> <span class="s2">&quot;skyCover&quot;</span> <span class="ow">in</span> <span class="n">avail_params</span><span class="p">:</span>
<span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="mi">5</span><span class="p">:</span>
<span class="c1"># store the associated cloud cover int for the skyCover string</span>
<span class="n">obs</span><span class="p">[</span><span class="s1">&#39;skyCover&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">get_cloud_cover</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getString</span><span class="p">(</span><span class="s2">&quot;skyCover&quot;</span><span class="p">)))</span>
<span class="n">i</span> <span class="o">=</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">elif</span> <span class="s2">&quot;stationName&quot;</span> <span class="ow">in</span> <span class="n">avail_params</span><span class="p">:</span>
<span class="c1"># If we already have a record for this stationName, skip</span>
<span class="k">if</span> <span class="n">ob</span><span class="o">.</span><span class="n">getString</span><span class="p">(</span><span class="s1">&#39;stationName&#39;</span><span class="p">)</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">station_names</span><span class="p">:</span>
<span class="n">station_names</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getString</span><span class="p">(</span><span class="s1">&#39;stationName&#39;</span><span class="p">))</span>
<span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">for</span> <span class="n">param</span> <span class="ow">in</span> <span class="n">single_value_params</span><span class="p">:</span>
<span class="k">if</span> <span class="n">param</span> <span class="ow">in</span> <span class="n">avail_params</span><span class="p">:</span>
<span class="k">if</span> <span class="n">param</span> <span class="o">==</span> <span class="s1">&#39;timeObs&#39;</span><span class="p">:</span>
<span class="n">obs</span><span class="p">[</span><span class="n">param</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">fromtimestamp</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getNumber</span><span class="p">(</span><span class="n">param</span><span class="p">)</span><span class="o">/</span><span class="mf">1000.0</span><span class="p">))</span>
<span class="k">if</span> <span class="n">time_title</span> <span class="o">==</span> <span class="s2">&quot;&quot;</span><span class="p">:</span>
<span class="n">time_title</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getDataTime</span><span class="p">())</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">obs</span><span class="p">[</span><span class="n">param</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getNumber</span><span class="p">(</span><span class="n">param</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
<span class="n">obs</span><span class="p">[</span><span class="n">param</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ob</span><span class="o">.</span><span class="n">getString</span><span class="p">(</span><span class="n">param</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">obs</span><span class="p">[</span><span class="n">param</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="populate-the-data-dictionary">
<h4>Populate the Data Dictionary<a class="headerlink" href="#populate-the-data-dictionary" title="Permalink to this heading"></a></h4>
<p>Next grab the variables out of the obs dictionary we just populated,
attach correct units, (calculate their components, in the instance of
wind) and put them into a new dictionary that we will hand the plotting
function later.</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;stid&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;stationName&#39;</span><span class="p">])</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;latitude&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;latitude&#39;</span><span class="p">])</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;longitude&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;longitude&#39;</span><span class="p">])</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;air_temperature&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;temperature&#39;</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">float</span><span class="p">)</span><span class="o">*</span> <span class="n">units</span><span class="o">.</span><span class="n">degC</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;dew_point_temperature&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;dewpoint&#39;</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">float</span><span class="p">)</span><span class="o">*</span> <span class="n">units</span><span class="o">.</span><span class="n">degC</span>
<span class="n">direction</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;windDir&#39;</span><span class="p">])</span>
<span class="n">direction</span><span class="p">[</span><span class="n">direction</span> <span class="o">==</span> <span class="o">-</span><span class="mf">9999.0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;nan&#39;</span>
<span class="n">u</span><span class="p">,</span> <span class="n">v</span> <span class="o">=</span> <span class="n">wind_components</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;windSpeed&#39;</span><span class="p">])</span> <span class="o">*</span> <span class="n">units</span><span class="p">(</span><span class="s1">&#39;knots&#39;</span><span class="p">),</span>
<span class="n">direction</span> <span class="o">*</span> <span class="n">units</span><span class="o">.</span><span class="n">degree</span><span class="p">)</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;eastward_wind&#39;</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;northward_wind&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">u</span><span class="p">,</span> <span class="n">v</span>
<span class="n">data</span><span class="p">[</span><span class="s1">&#39;cloud_coverage&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;skyCover&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>Top</p>
</section>
</section>
<hr class="docutils" />
<section id="plot-the-data">
<h3>Plot the Data!<a class="headerlink" href="#plot-the-data" title="Permalink to this heading"></a></h3>
<p>Now we have all the data we need to create our plot! First well assign
a projection and create our figure and axes.</p>
<p>Next, we use Cartopy to add common features (land, ocean, lakes,
borders, etc) to help give us a more contextual map of the United States
to plot the METAR stations on. We create and add a title for our figure
as well.</p>
<p>Additionally, we use <a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html">MetPys
StationPlotLayout</a>
to instantiate a custom layout and define all the attributes we want
displayed. We need to then set the data dictionary (containing all of
our data values) on the custom layout so it knows what to draw.</p>
<p>Finally, we display the plot!</p>
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">proj</span> <span class="o">=</span> <span class="n">ccrs</span><span class="o">.</span><span class="n">LambertConformal</span><span class="p">(</span><span class="n">central_longitude</span><span class="o">=-</span><span class="mi">95</span><span class="p">,</span> <span class="n">central_latitude</span><span class="o">=</span><span class="mi">35</span><span class="p">,</span>
<span class="n">standard_parallels</span><span class="o">=</span><span class="p">[</span><span class="mi">35</span><span class="p">])</span>
<span class="c1"># Create the figure</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_subplot</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">projection</span><span class="o">=</span><span class="n">proj</span><span class="p">)</span>
<span class="c1"># Add various map elements</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">LAND</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">OCEAN</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">LAKES</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">COASTLINE</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">STATES</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_feature</span><span class="p">(</span><span class="n">cfeature</span><span class="o">.</span><span class="n">BORDERS</span><span class="p">,</span> <span class="n">linewidth</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="c1"># Set plot bounds</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_extent</span><span class="p">((</span><span class="o">-</span><span class="mi">118</span><span class="p">,</span> <span class="o">-</span><span class="mi">73</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">50</span><span class="p">))</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="n">time_title</span> <span class="o">+</span> <span class="s2">&quot; | METAR | &quot;</span> <span class="o">+</span> <span class="n">edexServer</span><span class="p">)</span>
<span class="c1"># Winds, temps, dewpoint, station id</span>
<span class="n">custom_layout</span> <span class="o">=</span> <span class="n">StationPlotLayout</span><span class="p">()</span>
<span class="n">custom_layout</span><span class="o">.</span><span class="n">add_barb</span><span class="p">(</span><span class="s1">&#39;eastward_wind&#39;</span><span class="p">,</span> <span class="s1">&#39;northward_wind&#39;</span><span class="p">,</span> <span class="n">units</span><span class="o">=</span><span class="s1">&#39;knots&#39;</span><span class="p">)</span>
<span class="n">custom_layout</span><span class="o">.</span><span class="n">add_value</span><span class="p">(</span><span class="s1">&#39;NW&#39;</span><span class="p">,</span> <span class="s1">&#39;air_temperature&#39;</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;.0f&#39;</span><span class="p">,</span> <span class="n">units</span><span class="o">=</span><span class="s1">&#39;degF&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;darkred&#39;</span><span class="p">)</span>
<span class="n">custom_layout</span><span class="o">.</span><span class="n">add_value</span><span class="p">(</span><span class="s1">&#39;SW&#39;</span><span class="p">,</span> <span class="s1">&#39;dew_point_temperature&#39;</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;.0f&#39;</span><span class="p">,</span> <span class="n">units</span><span class="o">=</span><span class="s1">&#39;degF&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;darkgreen&#39;</span><span class="p">)</span>
<span class="n">custom_layout</span><span class="o">.</span><span class="n">add_symbol</span><span class="p">(</span><span class="s1">&#39;C&#39;</span><span class="p">,</span> <span class="s1">&#39;cloud_coverage&#39;</span><span class="p">,</span> <span class="n">sky_cover</span><span class="p">)</span>
<span class="n">stationplot</span> <span class="o">=</span> <span class="n">StationPlot</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;longitude&#39;</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;latitude&#39;</span><span class="p">],</span> <span class="n">clip_on</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">transform</span><span class="o">=</span><span class="n">ccrs</span><span class="o">.</span><span class="n">PlateCarree</span><span class="p">(),</span> <span class="n">fontsize</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="n">stationplot</span><span class="o">.</span><span class="n">plot_text</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;stid&#39;</span><span class="p">])</span>
<span class="n">custom_layout</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">stationplot</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
<img alt="../../_images/METAR_main_25_0.png" src="../../_images/METAR_main_25_0.png" />
<p>Top</p>
</section>
<hr class="docutils" />
<section id="see-also">
<h3>See Also<a class="headerlink" href="#see-also" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><a class="reference external" href="https://www.aviationweather.gov/metar/help?page=plot">Aviation Weather Center Static METAR Plots
Information</a></p></li>
</ul>
<section id="related-notebooks">
<h4>Related Notebooks<a class="headerlink" href="#related-notebooks" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html">Grid Levels and
Parameters</a></p></li>
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/examples/generated/Colored_Surface_Temperature_Plot.html">Colored Surface Temperature
Plot</a></p></li>
</ul>
</section>
<section id="additional-documentation">
<h4>Additional Documentation<a class="headerlink" href="#additional-documentation" title="Permalink to this heading"></a></h4>
<p><strong>python-awips:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.changeEDEXHost">DataAccessLayer.changeEDEXHost()</a></p></li>
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.newDataRequest">DataAccessLayer.newDataRequest()</a></p></li>
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/api/IDataRequest.html">IDataRequest</a></p></li>
<li><p><a class="reference external" href="http://unidata.github.io/python-awips/api/PyGeometryData.html">DataAccessLayer.getGeometryData</a></p></li>
</ul>
<p><strong>datetime:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime-objects">datetime.datetime</a></p></li>
<li><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html?#datetime.datetime.utcnow">datetime.utcnow()</a></p></li>
<li><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#timedelta-objects">datetime.timedelta</a></p></li>
<li><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior">datetime.strftime() and
datetime.strptime()</a></p></li>
</ul>
<p><strong>numpy:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.array.html">np.array</a></p></li>
</ul>
<p><strong>cartopy:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://scitools.org.uk/cartopy/docs/v0.14/crs/projections.html?#cartopy-projection-list">cartopy projection
list</a></p></li>
<li><p><a class="reference external" href="https://scitools.org.uk/cartopy/docs/v0.14/matplotlib/feature_interface.html">cartopy feature
interface</a></p></li>
</ul>
<p><strong>matplotlib:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html">matplotlib.pyplot()</a></p></li>
<li><p><a class="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html">matplotlib.pyplot.figure()</a></p></li>
<li><p><a class="reference external" href="https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure.add_subplot">matplotlib.pyplot.figure.add_subplot</a></p></li>
<li><p><a class="reference external" href="https://matplotlib.org/stable/api/image_api.html?highlight=set_extent#matplotlib.image.AxesImage.set_extent">ax.set_extent</a></p></li>
<li><p><a class="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_title.html">ax.set_title</a></p></li>
</ul>
<p><strong>metpy:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.wind_components.html">metpy.calc.wind_components</a></p></li>
<li><p><a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlot.html">metpy.plots.StationPlot()</a></p></li>
<li><p><a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html">metpy.plots.StationPlotLayout()</a></p></li>
<li><p><a class="reference external" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.units.html">metpy.units</a></p></li>
</ul>
<p>Top</p>
<hr class="docutils" />
</section>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="METAR_Station_Plot_with_MetPy.html" class="btn btn-neutral float-left" title="METAR Station Plot with MetPy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Map_Resources_and_Topography.html" class="btn btn-neutral float-right" title="Map Resources and Topography" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2018, Unidata.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -21,7 +21,7 @@
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Model Sounding Data" href="Model_Sounding_Data.html" />
<link rel="prev" title="METAR main" href="METAR_main.html" />
<link rel="prev" title="METAR Station Plot with MetPy" href="METAR_Station_Plot_with_MetPy.html" />
</head>
<body class="wy-body-for-nav">
@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Map Resources and Topography</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#objectives">Objectives</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#table-of-contents">Table of Contents</a></li>
@ -525,7 +524,7 @@ for available database tables, column names, and types.</p>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="METAR_main.html" class="btn btn-neutral float-left" title="METAR main" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="METAR_Station_Plot_with_MetPy.html" class="btn btn-neutral float-left" title="METAR Station Plot with MetPy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Model_Sounding_Data.html" class="btn btn-neutral float-right" title="Model Sounding Data" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Model Sounding Data</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#available-locations">Available Locations</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

View file

@ -53,7 +53,6 @@
<li class="toctree-l2"><a class="reference internal" href="generated/GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/METAR_main.html">METAR main</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="generated/NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>
@ -104,7 +103,6 @@
<li class="toctree-l1"><a class="reference internal" href="generated/GOES_Geostationary_Lightning_Mapper.html">GOES Geostationary Lightning Mapper</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/Grid_Levels_and_Parameters.html">Grid Levels and Parameters</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/METAR_Station_Plot_with_MetPy.html">METAR Station Plot with MetPy</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/METAR_main.html">METAR main</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/Map_Resources_and_Topography.html">Map Resources and Topography</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/Model_Sounding_Data.html">Model Sounding Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/NEXRAD_Level3_Radar.html">NEXRAD Level3 Radar</a></li>

Binary file not shown.

File diff suppressed because one or more lines are too long