Skip to main content
jsmetrics

jsmetrics: Jet-stream metrics and algorithms

Python Package Index Build pre-commit.ci status CodeFactor coveralls OpenSSF scorecard Documentation Status License Python Black Zenodo

jsmetrics is an open-source Python package containing implementations of various statistics and algorithms which have been developed to identify or characterise jet streams.

The package is built using xarray and currently contains 17 methods, consisting of jet statistics, waviness metrics and jet core algorithms (described here). As this is an ongoing project, we are always in the process of finding and implementing new methods. You can find a full list of methods and their current state in the docs.


GMD article describing jsmetrics v0.2.0:

Keel, T., Brierley, C., and Edwards, T.: jsmetrics v0.2.0: a Python package for metrics and algorithms used to identify or characterise atmospheric jet streams, Geosci. Model Dev., 17, 1229–1247, https://doi.org/10.5194/gmd-17-1229-2024, 2024

example notebooks


Installation

pip install jsmetrics

Let me know if you have any problems installing this package, as I have not extensively tested for Mac-OS and Windows versions.

Documentation

The official documentation is at https://jsmetrics.readthedocs.io/en/latest/

My email is: thomasjames.keel@gmail.com. Please feel free to email me if you would like some help working with this package.

Usage

jsmetrics is designed to be easy to use and should integrate seemlessly with *xarray*. An extensive knowledge of Python or xarray is not required to use jsmetrics, although it will help you use the package more effectively if you wish to run some of the more advanced use cases.

Below we introduce a simple use of the package to run a single jet statistic.

import xarray as xr
import jsmetrics

# load windspeed data with u- and v- component wind.
uv_data = xr.open_dataset(filename)

# run Woollings et al. 2010 metric
w10 = jsmetrics.metrics.jet_statistics.woollings_et_al_2010(uv_data)

print(w10['jet_lat'])
print(w10['jet_speed'])

Examples

For examples please check out the examples here: https://jsmetrics.readthedocs.io/en/latest/usage.html

Some example notebooks are available on GitHub

Example of jet latitude statistic:

Example of jet statistic from K20

Example output of the jet latitude statistic from Ceppi et al. 2018 for 00:00 1st January 2021. Data is ERA5 850 hPa u-wind.

Example of jet core algorithm:

Example of jet core algorithm from M11

Example output of the jet core algorithm from Manney et al. 2011. The cores shown are extracted from a windspeed slice at 32E longitude at 12:00 on 1st January 2024. Data is 6-hourly ERA5 1000-50 hPa u-v-wind.

Compare jet core algorithms:

Comparison of jet core algorithms during Feb 2021 Texas Cold Wave

Comparison of jet core algorithms estimation of the 6-hourly jet position. Data is 6-hourly ERA5 500-100 hPa u-v-wind.

Ask questions with jet latitude statsitics:

Jet latitude circbars with errorbars

Estimation of mean jet latitude shift. Data is monthly ERA5 850-700 hPa u-wind between 1990-2020.

Extend the original jet metric definitions using jsmetrics flexibility:

STJ and PFJ by metric and longitude

By latitude estimation of the jet latitude of the subtropical and polar jet stream. Data is monthly ERA5 differenced-250 hPa (orange) and 850-700 hPa (blue) u-wind between 1980-2020.

How to cite this package

If you wish to cite jsmetrics in a research publication, we kindly ask that you use:

Keel, T., Brierley, C., and Edwards, T.: jsmetrics v0.2.0: a Python package for metrics and algorithms used to identify or characterise atmospheric jet streams, Geosci. Model Dev., 17, 1229–1247, https://doi.org/10.5194/gmd-17-1229-2024, 2024

A reference to a specific version of this software is also available through Zenodo e.g.:

Keel, T.: Thomasjkeel/jsmetrics: v0.2.2 (0.2.2), Zenodo [code], https://doi.org/10.5281/zenodo.10822662, 2024.

Contributing

jsmetrics is in active development.

  • If you’re interested in participating in the development of jsmetrics by suggesting new features, new metrics or algorithms or report bugs, please leave us a message on the issue tracker

  • If you would like to contribute code or documentation (which is greatly appreciated!), check out the Contributing Guidelines before you begin!

Credits

The layout and content of this project and was inspired by xclim (https://github.com/Ouranosinc/xclim) which contains other climate indices and metrics.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Disclaimer

We have tried to replicate the various metrics based on the equations and details in the methodology as accurately as possible. However, in some cases, we have chosen to exclude or alter parts of the methodology which reduce the resolution of the output (i.e. grouping into season or region) with the hope to preserve the parts of the method that specifically isolate a characteristics of the jet-stream at any inputted scale. Again, any further subsetting is passed onto the user. If data input is at a daily resolution, part of the output should also be daily resolution.

Also note that, the data we used to test these metrics may have a different resolution to the one it was developed with.

Finally, although these metric were found with a literature search, this is not an exaustive list of all methods used to identify or characterise the jet-stream or upper-level wind. This project is very much a work in progress, so contributors are very welcome.

Metadata

Release files for jsmetrics 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsmetrics 0.3.1
File Size Uploaded
jsmetrics-0.3.1.tar.gz 8.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsmetrics 0.3.1
File Interpreter ABI Platform
jsmetrics-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 MB

Release files / jsmetrics-0.3.1.tar.gz

Download URL jsmetrics-0.3.1.tar.gz
Size 8.4 MB
Tags Source
SHA-256 checksum
How to use checksums
bb59b863b31b6fc12bd0015e58af6444eb6ff4efaa32bdc9de6b27f6f4a3dee4
BLAKE2b-256 checksum
How to use checksums
32feadf72380772109343d952cfd0a32c3cf4486870745ddb68f11e520a5eebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / jsmetrics-0.3.1-py3-none-any.whl

Download URL jsmetrics-0.3.1-py3-none-any.whl
Size 73.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af78e7e9efda1a032ec177bf21580836296623c04750499ea71225fa08c1a87c
BLAKE2b-256 checksum
How to use checksums
c0fb9dd1e86761241f015c33ede934285683b9cf298a1116a3745f7c35b36e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page