MetPy Mondays #26 - MetPy 0.7

In this week’s MetPy Monday, we talk about the most recent release of MetPy, 0.7. This release saw a lot of work put into calculations, including some changes and new capabilities for kinematics functions that involve taking derivatives of fields. We also want to thank all of the community members (9 in total!) who contributed Pull Requests to this release.

In this release, many functions in kinematics have been updated or changed. First, the dim_order keyword argument, which controls the assumed order of x and y dimensions for arrays, has been changed to assume a default ordering of ‘yx’ rather than ‘xy’. This change allows many data sources to work correctly by default now. Also to simplify MetPy’s API, the functions h_convergence and v_vorticity have been renamed to divergence and vorticity, respectively; these new names are easier to find and better reflect the underlying calculations. The old names are still available, but are deprecated and slated for removal in 0.9.

New to this release are generic derivative (and related) functions for MetPy: first_derivative, second_derivative, gradient, and laplacian. These functions use three points to estimate the derivatives, and are compatible with grids that have variable spacing; for grids with fixed spacing, they are 2nd-order accurate. MetPy has also added code to calculate Cartesian spacing between points on a latitude/longitude grid. These additions mean that it is now possible to use MetPy to calculate quantities like vorticity advection natively on latitude/longitude grids, like those used by the GFS.

Vorticity Advection

In addition to the derivative calculations, MetPy has gained functions to calculate: thickness (using hypsometric formula), geopotential to/from height, mixing ratio from relative humidity, moist static energy, and dry static energy. Besides calculations, MetPy has also had some updates to the documentation and plots. In the documentation, MetPy now has a table to aid in conversion from GEMPAK:

GEMPAK Table

This table is a work in progress, trying to provide equivalencies between functionality in GEMPAK and Python. For functions in GEMPAK that currently have no comparable functionality in Python, there is a link to an open issue in MetPy. We are grateful to several community members who have submitted Pull Requests to add some of these functions, and we are very happy to take more community submissions!

Lastly, in 0.7 the add_timestamp function gained the ability to add outlined text to a plot. So calling add_timestamp(ax, high_contrast=True) will add a timestamp to an axes in white text with a black outline. This helps to ensure the timestamp is legible regardless of what is displayed beneath.

add_timestamp example

You can find a complete set of release notes over at the MetPy release page on GitHub. You can also see what is planned for the next release of MetPy by visiting the 0.8 milestone page. Questions or comments? Visit the Contact Us section of the MetPy documentation.

Comments:

thanks you for the information

Posted by dompetpoker on April 18, 2018 at 04:04 PM MDT #

Post a Comment:
Comments are closed for this entry.
Unidata Developer's Blog
A weblog about software development by Unidata developers*
Unidata Developer's Blog
A weblog about software development by Unidata developers*

Welcome

FAQs

News@Unidata blog

Take a poll!

What if we had an ongoing user poll in here?

Browse By Topic
Browse by Topic
« November 2024
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
       
Today