1266 lines
No EOL
33 KiB
HTML
1266 lines
No EOL
33 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html class="no-js">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<meta name="description" content="Documentation for all things AWIPS.">
|
|
|
|
|
|
<link rel="canonical" href="http://unidata.github.io/awips2/python/surface-obs-plot-metpy/">
|
|
|
|
|
|
<meta name="author" content="mjames@ucar.edu">
|
|
|
|
|
|
<link rel="shortcut icon" href="../../images/favicon.ico">
|
|
|
|
<meta name="generator" content="mkdocs-0.16.3, mkdocs-unidata-1.5.4">
|
|
|
|
|
|
|
|
<title>Surface Obs Plot with MetPy - Unidata AWIPS User Manual</title>
|
|
|
|
|
|
|
|
<script src="../../assets/javascripts/modernizr-56ade86843.js"></script>
|
|
|
|
|
|
<link rel="stylesheet" href="../../assets/stylesheets/application-b1a1975878.css">
|
|
|
|
<link rel="stylesheet" href="../../assets/stylesheets/application-f78e5cb881.palette.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
|
|
|
|
<link rel="stylesheet" href="../../css/extra.css">
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body data-md-color-primary="blue-grey" data-md-color-accent="light-blue">
|
|
|
|
<svg class="md-svg">
|
|
<defs>
|
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
|
|
|
</defs>
|
|
</svg>
|
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
|
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
|
|
|
<header class="md-header" data-md-component="header">
|
|
<nav class="md-header-nav md-grid">
|
|
|
|
<a href="../.."><div class="background-logo" style="background-image: url(../../images/cave.png);"></div>
|
|
|
|
<div class="md-flex">
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
|
|
<a href="../.." title="Unidata AWIPS User Manual" class="md-icon md-icon--home md-header-nav__button">
|
|
</a>
|
|
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--stretch">
|
|
<span class="md-flex__ellipsis md-header-nav__title">
|
|
|
|
|
|
|
|
|
|
<span class="md-header-nav__parent">
|
|
Python API
|
|
</span>
|
|
|
|
|
|
|
|
Surface Obs Plot with MetPy
|
|
|
|
|
|
|
|
|
|
</span>
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
|
|
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
|
|
|
<div class="md-search" data-md-component="search" role="dialog">
|
|
<label class="md-search__overlay" for="search"></label>
|
|
<div class="md-search__inner">
|
|
<form class="md-search__form" name="search">
|
|
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
|
<label class="md-icon md-search__icon" for="search"></label>
|
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
|
</form>
|
|
<div class="md-search__output">
|
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
|
<div class="md-search-result" data-md-component="result" data-md-lang-search="" data-md-lang-tokenizer="[\s\-]+">
|
|
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
|
Type to start searching
|
|
</div>
|
|
<ol class="md-search-result__list"></ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
<div class="md-header-nav__source">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/Unidata/awips2" title="Go to repository" class="md-source" data-md-source="github">
|
|
|
|
<div class="md-source__icon">
|
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
|
<use xlink:href="#github" width="24" height="24"></use>
|
|
</svg>
|
|
</div>
|
|
|
|
<div class="md-source__repository">
|
|
GitHub
|
|
</div>
|
|
</a>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<div class="md-container">
|
|
|
|
|
|
<main class="md-main">
|
|
<div class="md-main__inner md-grid" data-md-component="container">
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
|
<label class="md-nav__title md-nav__title--site" for="drawer">
|
|
<div class="md-nav__button md-logo">
|
|
|
|
<i class="md-icon md-icon--home"></i>
|
|
|
|
</div>
|
|
Unidata AWIPS User Manual
|
|
</label>
|
|
|
|
<div class="md-nav__source">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/Unidata/awips2" title="Go to repository" class="md-source" data-md-source="github">
|
|
|
|
<div class="md-source__icon">
|
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
|
<use xlink:href="#github" width="24" height="24"></use>
|
|
</svg>
|
|
</div>
|
|
|
|
<div class="md-source__repository">
|
|
GitHub
|
|
</div>
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../.." title="Home" class="md-nav__link">
|
|
Home
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../install/install-cave/" title="Install CAVE" class="md-nav__link">
|
|
Install CAVE
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../install/install-edex/" title="Install EDEX" class="md-nav__link">
|
|
Install EDEX
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
|
|
|
|
<label class="md-nav__link" for="nav-4">
|
|
CAVE User Manual
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-4">
|
|
CAVE User Manual
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-perspective/" title="D2D Perspective" class="md-nav__link">
|
|
D2D Perspective
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/maps-views-projections/" title="Maps, Views, Projections" class="md-nav__link">
|
|
Maps, Views, Projections
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/bundles-and-procedures/" title="Bundles and Procedures" class="md-nav__link">
|
|
Bundles and Procedures
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/import-export/" title="Import/Export" class="md-nav__link">
|
|
Import/Export
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/localization-perspective/" title="Localization Perspective" class="md-nav__link">
|
|
Localization Perspective
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/ncp-perspective/" title="NCP Perspective" class="md-nav__link">
|
|
NCP Perspective
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/nsharp/" title="NSHARP" class="md-nav__link">
|
|
NSHARP
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/warngen/" title="WarnGen Walkthrough" class="md-nav__link">
|
|
WarnGen Walkthrough
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/goes-16-satellite/" title="GOES-16 (GOES-R)" class="md-nav__link">
|
|
GOES-16 (GOES-R)
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-gis-shapefiles/" title="GIS and Shapefiles" class="md-nav__link">
|
|
GIS and Shapefiles
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-gridded-models/" title="Volume Browser" class="md-nav__link">
|
|
Volume Browser
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-tools/" title="Display Tools" class="md-nav__link">
|
|
Display Tools
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-radar-tools/" title="Radar Tools" class="md-nav__link">
|
|
Radar Tools
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-edit-menus/" title="Editing Menus" class="md-nav__link">
|
|
Editing Menus
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/cave-localization/" title="Change Localization" class="md-nav__link">
|
|
Change Localization
|
|
</a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
|
|
|
<label class="md-nav__link" for="nav-5">
|
|
EDEX User Manual
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-5">
|
|
EDEX User Manual
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/distributed-computing/" title="Distributed EDEX" class="md-nav__link">
|
|
Distributed EDEX
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../install/start-edex/" title="EDEX Start and Stop" class="md-nav__link">
|
|
EDEX Start and Stop
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/ldm/" title="LDM Feeds" class="md-nav__link">
|
|
LDM Feeds
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/data-distribution-files/" title="Data Distribution Files" class="md-nav__link">
|
|
Data Distribution Files
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/new-grid/" title="Ingest a New Grid" class="md-nav__link">
|
|
Ingest a New Grid
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/data-purge/" title="Purging and Retention" class="md-nav__link">
|
|
Purging and Retention
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/edex-users/" title="Monitor Users" class="md-nav__link">
|
|
Monitor Users
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/data-plugins/" title="Data Plugins" class="md-nav__link">
|
|
Data Plugins
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../edex/case-studies/" title="Archive Case Studies" class="md-nav__link">
|
|
Archive Case Studies
|
|
</a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
|
|
|
|
<label class="md-nav__link" for="nav-6">
|
|
Supported Data Types
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-6">
|
|
Supported Data Types
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-grids/" title="Gridded Model Display" class="md-nav__link">
|
|
Gridded Model Display
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-pointdata-surface-obs/" title="Surface Obs" class="md-nav__link">
|
|
Surface Obs
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-satellite/" title="Satellite Imagery" class="md-nav__link">
|
|
Satellite Imagery
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-radar/" title="NEXRAD Radar" class="md-nav__link">
|
|
NEXRAD Radar
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-uair/" title="Upper Air" class="md-nav__link">
|
|
Upper Air
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-hydro/" title="NCEP/Hydro" class="md-nav__link">
|
|
NCEP/Hydro
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/d2d-map-resources/" title="Map Overlays" class="md-nav__link">
|
|
Map Overlays
|
|
</a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7" checked>
|
|
|
|
<label class="md-nav__link" for="nav-7">
|
|
Python API
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-7">
|
|
Python API
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../python-awips-data-access/" title="Overview" class="md-nav__link">
|
|
Overview
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../maps-database/" title="Maps Database" class="md-nav__link">
|
|
Maps Database
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../awips-grids-and-cartopy/" title="AWIPS Grids and Cartopy" class="md-nav__link">
|
|
AWIPS Grids and Cartopy
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../satellite-imagery/" title="Satellite Imagery" class="md-nav__link">
|
|
Satellite Imagery
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../nexrad-level-3-radar/" title="NEXRAD Level 3 Radar" class="md-nav__link">
|
|
NEXRAD Level 3 Radar
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../upper-air-bufr-soundings/" title="Upper air BUFR Soundings" class="md-nav__link">
|
|
Upper air BUFR Soundings
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../model-sounding-data/" title="Model Sounding Data" class="md-nav__link">
|
|
Model Sounding Data
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../map-resources-and-topography/" title="Map Resources and Topography" class="md-nav__link">
|
|
Map Resources and Topography
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--active">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
|
|
|
|
|
<a href="./" title="Surface Obs Plot with MetPy" class="md-nav__link md-nav__link--active">
|
|
Surface Obs Plot with MetPy
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8">
|
|
|
|
<label class="md-nav__link" for="nav-8">
|
|
Development
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-8">
|
|
Development
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../dev/awips-development-environment/" title="AWIPS Development Environment (ADE)" class="md-nav__link">
|
|
AWIPS Development Environment (ADE)
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../dev/build-nsharp-macos/" title="Building NSHARP for macOS" class="md-nav__link">
|
|
Building NSHARP for macOS
|
|
</a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9">
|
|
|
|
<label class="md-nav__link" for="nav-9">
|
|
Appendix
|
|
</label>
|
|
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
|
<label class="md-nav__title" for="nav-9">
|
|
Appendix
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../appendix/appendix-grid-parameters/" title="AWIPS Grid Parameters" class="md-nav__link">
|
|
AWIPS Grid Parameters
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../appendix/appendix-acronyms/" title="Acronyms and Abbreviations" class="md-nav__link">
|
|
Acronyms and Abbreviations
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../appendix/appendix-cots/" title="COTS and FOSS" class="md-nav__link">
|
|
COTS and FOSS
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../appendix/appendix-wsr88d/" title="WSR-88D Product Table" class="md-nav__link">
|
|
WSR-88D Product Table
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../cave/cave-keyboard-shortcuts/" title="Keyboard Shortcuts" class="md-nav__link">
|
|
Keyboard Shortcuts
|
|
</a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
<nav class="md-nav md-nav--secondary">
|
|
|
|
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="md-content">
|
|
<article class="md-content__inner md-typeset">
|
|
|
|
|
|
<a href="https://github.com/Unidata/awips2/edit/unidata_17.1.1/docs/python/surface-obs-plot-metpy.md" title="Edit this page" class="md-icon md-content__icon">edit</a>
|
|
|
|
|
|
<h1>Surface Obs Plot with MetPy</h1>
|
|
|
|
<p>Based on the MetPy example <a href="http://metpy.readthedocs.org/en/latest/examples/generated/Station_Plot_with_Layout.html">"Station Plot with Layout"</a></p>
|
|
<pre><code class="python">import datetime
|
|
import pandas
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
import pprint
|
|
from awips.dataaccess import DataAccessLayer
|
|
from metpy.calc import get_wind_components
|
|
from metpy.cbook import get_test_data
|
|
from metpy.plots.wx_symbols import sky_cover, current_weather
|
|
from metpy.plots import StationPlot, StationPlotLayout, simple_layout
|
|
from metpy.units import units
|
|
|
|
def get_cloud_cover(code):
|
|
if 'OVC' in code:
|
|
return 1.0
|
|
elif 'BKN' in code:
|
|
return 6.0/8.0
|
|
elif 'SCT' in code:
|
|
return 4.0/8.0
|
|
elif 'FEW' in code:
|
|
return 2.0/8.0
|
|
else:
|
|
return 0
|
|
|
|
state_capital_wx_stations = {'Washington':'KOLM', 'Oregon':'KSLE', 'California':'KSAC',
|
|
'Nevada':'KCXP', 'Idaho':'KBOI', 'Montana':'KHLN',
|
|
'Utah':'KSLC', 'Arizona':'KDVT', 'New Mexico':'KSAF',
|
|
'Colorado':'KBKF', 'Wyoming':'KCYS', 'North Dakota':'KBIS',
|
|
'South Dakota':'KPIR', 'Nebraska':'KLNK', 'Kansas':'KTOP',
|
|
'Oklahoma':'KPWA', 'Texas':'KATT', 'Louisiana':'KBTR',
|
|
'Arkansas':'KLIT', 'Missouri':'KJEF', 'Iowa':'KDSM',
|
|
'Minnesota':'KSTP', 'Wisconsin':'KMSN', 'Illinois':'KSPI',
|
|
'Mississippi':'KHKS', 'Alabama':'KMGM', 'Nashville':'KBNA',
|
|
'Kentucky':'KFFT', 'Indiana':'KIND', 'Michigan':'KLAN',
|
|
'Ohio':'KCMH', 'Georgia':'KFTY', 'Florida':'KTLH',
|
|
'South Carolina':'KCUB', 'North Carolina':'KRDU',
|
|
'Virginia':'KRIC', 'West Virginia':'KCRW',
|
|
'Pennsylvania':'KCXY', 'New York':'KALB', 'Vermont':'KMPV',
|
|
'New Hampshire':'KCON', 'Maine':'KAUG', 'Massachusetts':'KBOS',
|
|
'Rhode Island':'KPVD', 'Connecticut':'KHFD', 'New Jersey':'KTTN',
|
|
'Delaware':'KDOV', 'Maryland':'KNAK'}
|
|
single_value_params = ["timeObs", "stationName", "longitude", "latitude",
|
|
"temperature", "dewpoint", "windDir",
|
|
"windSpeed", "seaLevelPress"]
|
|
multi_value_params = ["presWeather", "skyCover", "skyLayerBase"]
|
|
all_params = single_value_params + multi_value_params
|
|
obs_dict = dict({all_params: [] for all_params in all_params})
|
|
pres_weather = []
|
|
sky_cov = []
|
|
sky_layer_base = []
|
|
</code></pre>
|
|
|
|
<pre><code class="python">from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
|
|
from datetime import datetime, timedelta
|
|
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)
|
|
</code></pre>
|
|
|
|
<pre><code class="python">DataAccessLayer.changeEDEXHost("edex-cloud.unidata.ucar.edu")
|
|
request = DataAccessLayer.newDataRequest()
|
|
request.setDatatype("obs")
|
|
request.setParameters(*(all_params))
|
|
request.setLocationNames(*(state_capital_wx_stations.values()))
|
|
</code></pre>
|
|
|
|
<pre><code class="python">response = DataAccessLayer.getGeometryData(request,timerange)
|
|
for ob in response:
|
|
avail_params = ob.getParameters()
|
|
if "presWeather" in avail_params:
|
|
pres_weather.append(ob.getString("presWeather"))
|
|
elif "skyCover" in avail_params and "skyLayerBase" in avail_params:
|
|
sky_cov.append(ob.getString("skyCover"))
|
|
sky_layer_base.append(ob.getNumber("skyLayerBase"))
|
|
else:
|
|
for param in single_value_params:
|
|
if param in avail_params:
|
|
if param == 'timeObs':
|
|
obs_dict[param].append(datetime.fromtimestamp(ob.getNumber(param)/1000.0))
|
|
else:
|
|
try:
|
|
obs_dict[param].append(ob.getNumber(param))
|
|
except TypeError:
|
|
obs_dict[param].append(ob.getString(param))
|
|
else:
|
|
obs_dict[param].append(None)
|
|
|
|
obs_dict['presWeather'].append(pres_weather);
|
|
obs_dict['skyCover'].append(sky_cov);
|
|
obs_dict['skyLayerBase'].append(sky_layer_base);
|
|
pres_weather = []
|
|
sky_cov = []
|
|
sky_layer_base = []
|
|
</code></pre>
|
|
|
|
<p>We can now use pandas to retrieve desired subsets of our observations.</p>
|
|
<p>In this case, return the most recent observation for each station.</p>
|
|
<pre><code class="python">df = pandas.DataFrame(data=obs_dict, columns=all_params)
|
|
#sort rows with the newest first
|
|
df = df.sort_values(by='timeObs', ascending=False)
|
|
#group rows by station
|
|
groups = df.groupby('stationName')
|
|
#create a new DataFrame for the most recent values
|
|
df_recent = pandas.DataFrame(columns=all_params)
|
|
#retrieve the first entry for each group, which will
|
|
#be the most recent observation
|
|
for rid, station in groups:
|
|
row = station.head(1)
|
|
df_recent = pandas.concat([df_recent, row])
|
|
</code></pre>
|
|
|
|
<p>Convert DataFrame to something metpy-readable by
|
|
attaching units and calculating derived values</p>
|
|
<pre><code class="python">data = dict()
|
|
data['stid'] = np.array(df_recent["stationName"])
|
|
data['latitude'] = np.array(df_recent['latitude'])
|
|
data['longitude'] = np.array(df_recent['longitude'])
|
|
data['air_temperature'] = np.array(df_recent['temperature'], dtype=float)* units.degC
|
|
data['dew_point'] = np.array(df_recent['dewpoint'], dtype=float)* units.degC
|
|
data['slp'] = np.array(df_recent['seaLevelPress'])* units('mbar')
|
|
u, v = get_wind_components(np.array(df_recent['windSpeed']) * units('knots'),
|
|
np.array(df_recent['windDir']) * units.degree)
|
|
data['eastward_wind'], data['northward_wind'] = u, v
|
|
data['cloud_frac'] = [int(get_cloud_cover(x)*8) for x in df_recent['skyCover']]
|
|
</code></pre>
|
|
|
|
<pre><code class="python">%matplotlib inline
|
|
import cartopy.crs as ccrs
|
|
import cartopy.feature as feat
|
|
from matplotlib import rcParams
|
|
rcParams['savefig.dpi'] = 100
|
|
proj = ccrs.LambertConformal(central_longitude=-95, central_latitude=35,
|
|
standard_parallels=[35])
|
|
state_boundaries = feat.NaturalEarthFeature(category='cultural',
|
|
name='admin_1_states_provinces_lines',
|
|
scale='110m', facecolor='none')
|
|
# Create the figure
|
|
fig = plt.figure(figsize=(20, 15))
|
|
ax = fig.add_subplot(1, 1, 1, projection=proj)
|
|
|
|
# Add map elements
|
|
ax.add_feature(feat.LAND, zorder=-1)
|
|
ax.add_feature(feat.OCEAN, zorder=-1)
|
|
ax.add_feature(feat.LAKES, zorder=-1)
|
|
ax.coastlines(resolution='110m', zorder=2, color='black')
|
|
ax.add_feature(state_boundaries)
|
|
ax.add_feature(feat.BORDERS, linewidth='2', edgecolor='black')
|
|
ax.set_extent((-120, -70, 20, 50))
|
|
|
|
# Start the station plot by specifying the axes to draw on, as well as the
|
|
# lon/lat of the stations (with transform). We also set the fontsize to 12 pt.
|
|
stationplot = StationPlot(ax, data['longitude'], data['latitude'],
|
|
transform=ccrs.PlateCarree(), fontsize=12)
|
|
|
|
# The layout knows where everything should go, and things are standardized using
|
|
# the names of variables. So the layout pulls arrays out of `data` and plots them
|
|
# using `stationplot`.
|
|
simple_layout.plot(stationplot, data)
|
|
|
|
# Plot the temperature and dew point to the upper and lower left, respectively, of
|
|
# the center point. Each one uses a different color.
|
|
stationplot.plot_parameter('NW', np.array(data['air_temperature']), color='red')
|
|
stationplot.plot_parameter('SW', np.array(data['dew_point']), color='darkgreen')
|
|
|
|
# A more complex example uses a custom formatter to control how the sea-level pressure
|
|
# values are plotted. This uses the standard trailing 3-digits of the pressure value
|
|
# in tenths of millibars.
|
|
stationplot.plot_parameter('NE', np.array(data['slp']),
|
|
formatter=lambda v: format(10 * v, '.0f')[-3:])
|
|
|
|
# Plot the cloud cover symbols in the center location. This uses the codes made above and
|
|
# uses the `sky_cover` mapper to convert these values to font codes for the
|
|
# weather symbol font.
|
|
stationplot.plot_symbol('C', data['cloud_frac'], sky_cover)
|
|
|
|
# Also plot the actual text of the station id. Instead of cardinal directions,
|
|
# plot further out by specifying a location of 2 increments in x and 0 in y.
|
|
stationplot.plot_text((2, 0), np.array(obs_dict["stationName"]))
|
|
|
|
plt.title("Most Recent Observations for State Capitals")
|
|
</code></pre>
|
|
|
|
<p><img alt="png" src="../../images/output_9_1.png" /></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
|
|
<footer class="md-footer">
|
|
|
|
<div class="md-footer-nav">
|
|
<nav class="md-footer-nav__inner md-grid">
|
|
|
|
<a href="../map-resources-and-topography/" title="Map Resources and Topography" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
|
<span class="md-flex__ellipsis">
|
|
<span class="md-footer-nav__direction">
|
|
Previous
|
|
</span>
|
|
Map Resources and Topography
|
|
</span>
|
|
</div>
|
|
</a>
|
|
|
|
|
|
<a href="../../dev/awips-development-environment/" title="AWIPS Development Environment (ADE)" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
|
<span class="md-flex__ellipsis">
|
|
<span class="md-footer-nav__direction">
|
|
Next
|
|
</span>
|
|
AWIPS Development Environment (ADE)
|
|
</span>
|
|
</div>
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
|
</div>
|
|
</a>
|
|
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="md-footer-meta md-typeset">
|
|
<div class="md-footer-meta__inner md-grid">
|
|
<div class="md-footer-copyright">
|
|
|
|
<div class="md-footer-copyright__highlight">
|
|
Copyright © 2017 Unidata Program Center.
|
|
</div>
|
|
|
|
powered by
|
|
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
|
|
and
|
|
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
|
Material for MkDocs</a>
|
|
</div>
|
|
|
|
|
|
<div class="md-footer-social">
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
|
|
<a href="http://www.unidata.ucar.edu/software/awips2" class="md-footer-social__link fa fa-globe"></a>
|
|
|
|
<a href="https://github.com/Unidata/awips2" class="md-footer-social__link fa fa-github-alt"></a>
|
|
|
|
<a href="https://twitter.com/Unidata" class="md-footer-social__link fa fa-twitter"></a>
|
|
|
|
<a href="https://facebook.com/Unidata" class="md-footer-social__link fa fa-facebook"></a>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
<script src="../../assets/javascripts/application-0b7df094bf.js"></script>
|
|
<script>app.initialize({url:{base:"../.."}})</script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html> |