jsmetrics


Namejsmetrics JSON
Version 0.2.7 PyPI version JSON
download
home_pagehttps://github.com/Thomasjkeel/jsmetrics
SummaryLibrary of algorithms and metrics used to characterise jet-streams.
upload_time2024-09-24 15:29:48
maintainerNone
docs_urlNone
authorThomas Keel
requires_python>=3.8.0
licenseMIT License
keywords jet-stream climate metrics algorithms xarray
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/Thomasjkeel/jsmetrics/blob/main/docs/logos/jsmetrics_logo_tiny.png
   :target: https://coveralls.io/github/Thomasjkeel/jsmetrics?branch=main
   :align: center
   :alt: jsmetrics

============================================
jsmetrics: Jet-stream metrics and algorithms
============================================
|pypi| |pre-commit| |codefactor| |coveralls| |openssf| |docs| |license| |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 <https://docs.xarray.dev/en/stable/>`_ and currently contains 17 methods,
consisting of jet statistics, waviness metrics and jet core algorithms (described `here <https://jsmetrics.readthedocs.io/en/latest/metrics.html>`_).
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 <https://jsmetrics.readthedocs.io/en/latest/index.html>`_.

--------------------------------------------------------------------------------------------------

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 <https://github.com/Thomasjkeel/jsmetrics-examples>`_

----

Installation
-------------
.. code-block:: bash

    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: thomas.keel.18@ucl.ac.uk. Please feel free to email me if you would like some help working with this package.

Usage
-------------
:code:`jsmetrics` is designed to be easy to use and should integrate seemlessly with `*xarray* <https://docs.xarray.dev/en/stable/>`_.
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.

.. code-block:: python

 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 <https://github.com/Thomasjkeel/jsmetrics-examples>`_

**Example of jet latitude statistic:**

.. image:: docs/_static/images/example_jet_lat.png
  :width: 350
  :align: center
  :alt: 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:**

.. image:: docs/_static/images/jetcore_example_m11.png
  :width: 450
  :align: center
  :alt: 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:**

.. image:: docs/_static/images/jet_core_algorithm_comparions_NA_5_texas2021.png
  :width: 450
  :align: center
  :alt: 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:**

.. image:: docs/_static/images/jet_shift_violin.png
  :width: 450
  :align: center
  :alt: 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:**

.. image:: docs/_static/images/all_jet_lats_stj_pfj_npac_maps_more_metrics.png
  :width: 450
  :align: center
  :alt: 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.*

.. *Why use jsmetrics?:*
.. ---------------------
.. The planet's jet streams are complex and not well defined at any one scale (see `what are jet streams <https://jsmetrics.readthedocs.io/en/latest/statement.html#what-are-jet-streams>`_),
.. and as such there are a wide range of metrics, algorithms and statistics which have been employed in research to help
.. identify and characterise them. However, it has been generally quite difficult to reconcile various types of information provided
.. by different techniques. The motivation for this package was thus to standardise the most common methods developed for the
.. identification and characterisation of jet streams, so that various techniques are immediately available for anyone wishing to
.. look at jet streams in data. Also, it is hoped that *jsmetrics* provides a foundation for new metrics and for researchers to be
.. able to quantitatively compare differences provided by existing techniques.


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!

.. _issue tracker: https://github.com/Thomasjkeel/jsmetrics/issues
.. _Contributing Guidelines: https://jsmetrics.readthedocs.io/en/latest/contributing.html

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.

.. |license| image:: https://img.shields.io/github/license/thomasjkeel/jsmetrics
        :target: https://github.com/Thomasjkeel/jsmetrics/blob/master/LICENSE
        :alt: License

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
        :target: https://github.com/python/black
        :alt: Python Black

.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/Thomasjkeel/jsmetrics/main.svg
   :target: https://results.pre-commit.ci/latest/github/Thomasjkeel/jsmetrics/main
   :alt: pre-commit.ci status

.. |codefactor| image:: https://www.codefactor.io/repository/github/thomasjkeel/jsmetrics/badge
   :target: https://www.codefactor.io/repository/github/thomasjkeel/jsmetrics
   :alt: CodeFactor

.. |coveralls| image:: https://coveralls.io/repos/github/Thomasjkeel/jsmetrics/badge.svg?branch=main
   :target: https://coveralls.io/github/Thomasjkeel/jsmetrics?branch=main

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10822662.svg
        :target: https://doi.org/10.5281/zenodo.10822662
        :alt: Zenodo

.. |docs| image:: https://readthedocs.org/projects/jsmetrics/badge/?version=latest
       :target: https://jsmetrics.readthedocs.io/en/latest/?badge=latest
       :alt: Documentation Status

.. |pypi| image:: https://img.shields.io/pypi/v/jsmetrics.svg
        :target: https://pypi.org/project/jsmetrics/
        :alt: Python Package Index Build

.. |openssf| image:: https://api.scorecard.dev/projects/github.com/Thomasjkeel/jsmetrics/badge
            :target: https://scorecard.dev/viewer/?uri=github.com/Thomasjkeel/jsmetrics
            :alt: OpenSSF scorecard

.. .. |conda| image:: https://img.shields.io/conda/vn/conda-forge/jsmetrics.svg
..         :target: https://anaconda.org/conda-forge/jsmetrics
..         :alt: Conda-forge Build Version


=======
History
=======

0.2.7 (2024-09-24)
-------------------------
* Fix scipy.ndimage maximum filter error
* Corrects Kuang et al. 2014 and Schiemann et al. 2009 methods

0.2.6 (2024-09-23)
-------------------------
* Add expand_dims and squeeze to time dimensions of 'run_jet_core_and_region_algorithm_on_one_day' to fix manney_et_al_2011


0.2.4 (2024-09-23)
-------------------------
* Fix scipy.ndimage depreciation warning
* Change argmax to nanargmax
* update max numpy version to 1.26 so 'np.RankWarning' still exists (in future prepare for np v2.0)
* Make sure requirement files have same versions


0.2.3 (2024-05-10)
-------------------------
* Add example of assigning units to plev in for docstrings in data_utils
* Add step-security-bot and dependenabot for OSSF scorecard
* Update dependencies and workflows


0.2.3-alpha (2024-04-08)
-------------------------
* Add example of assigning units to plev in data_utils


0.2.2 (2024-03-15)
-------------------------
* Overhaul Kuang et al. 2014 method to work with plev-lat center check rather than lat-long jet center check.
* Use maximum filter from scipy ndimage for diagonal check from 'find_local_maxima_in_2d_dataarray_with_diagonals' used in M11 and K14
* Also makes a change to Manney et al. 2011 method if using diagonal check (should not affect results as it was working before)


0.2.2-beta (2024-03-13)
-------------------------
* Fix error when checking for plev units in data_utils
* Reduce README content


0.2.1 (2023-12-01)
-------------------------
* Update Manney et al. 2011 method to include 'check_diagonals' parameter
* Update Manney et al. 2011 method to select maximum windspeed if no cores found above threshold
* Add 'slice_array_by_index_breaks' to data utils
* Update examples of use and quick start table in docs
* Add check for plev units to data_utils
* Update Archer & Calidera to more properly check for whether data plev coords are Pa or hPa.
* Fix typos and clarify writing in docs


0.2.0 (2023-10-12)
-------------------------
* Fix CI and Github actions
* Finish overhaul the ReadTheDocs documentation in the package
* Confirm completed and to verify metrics
* Update Schiemann et al. 2009 method to run faster and introduce u_threshold parameter default
* Add more complete inline 'Steps' to each metric in the package for readability.
* Remove Screen & Simmonds and Local Wave Activity leftover code
* Update Manney et al. 2011 further with padding to capture cores near the edge of dataset

0.1.7 (2023-10-10)
-------------------------
* Changes:
* **MAJOR:** Rename to Barnes & Polvani 2014 and update tests and all mentions of
* Update Cattiaux method to deal with Matplotlib depreciation warning about using 'allsegs' or 'collections' in contour plot
* Add tests for new spatial utils method 'seperate_one_contour_into_line_segments'
* Add readthedocs.yml

0.1.7-beta (2023-10-05)
-------------------------
* Rename to Barnes & Polvani 2014 and update tests and all mentions of

0.1.7-alpha (2023-09-19)
-------------------------
* Update Cattiaux method to deal with Matplotlib depreciation warning about using 'allsegs' or 'collections' in contour plot
* Add tests for new spatial utils method 'seperate_one_contour_into_line_segments'

0.1.6 (2023-09-14)
-------------------------
* Overhaul the ReadTheDocs documentation in the package
    * Write a more detailed description of each metric
    * Add examples and implementation notes to each metric
    * Update listing in 'details_for_all_metrics.py'
    * Update the 'Why jsmetrics' section with notes about what jets are and quick start help
    * Add some Examples of Use for each type of metric
* Add ws_threshold parameter to Pena-Ortiz method
* Rename Pena-Ortiz method to 'pena_ortiz_et_al_2016' (as earlier paper)

0.1.6-alpha (2023-08-19)
-------------------------
* Fix Manney et al. 2011 implementation
* Correct Manney 2011 method
* Move old method to new metric: 'jet_core_identification_algorithm'
* Update docs for Manney 2011 and sub-components

0.1.5-beta (2023-08-16)
-------------------------
* Update Schiemann method with new variable name (jet occurence), docstring and changes to sub-component function names
* Add ws_threshold parameter to Schiemann
* Update methods that work on one time unit of data and add squeeze method to properly deal if time not in dims
* Add basic outline of jet core algorithm docstrings

0.1.5-alpha (2023-08-15)
-------------------------
* Begin overhaul of ReadTheDocs documentation
* Add notes and example to Koch et al. 2006 metric
* Rename variable returned by K06 to jet_events_ws

0.1.4 (2023-08-02)
-------------------------
* Add new metric to package: Zappa et al. 2018 (This method builds on Ceppi et al. 2018)
* Raise KeyError if no time coordinate is passed to a given metrics

0.1.4-alpha (2023-07-21)
-------------------------
* add KeyError raise if no time coordinate is passed to various metrics

0.1.3 (2023-07-07)
-------------------------
* Add "method='nearest'" to jet statistics and core algorithms for cases when coords cannot be represented within float precision range.

0.1.2 (2023-06-06)
-------------------------
* Fix  Barnes & Polvani 2013 to better deal when min max jet lat is at edge data
* Add check for NoLeapDatetime

0.1.2-alpha (2023-05-27)
-------------------------
* Add check for NoLeapDatetime

0.1.1 (2023-05-26)
-------------------------
* Fix Woollings et al. 2010 and filter windows to use day timeunits for window to stop it removing too much data.
* Add data util function to add number of days to 360Day Datetime type

0.1.1-beta (2023-04-07)
-------------------------
* add parameter for Kerr et al. 2020
* Add Ceppi et al jet speed adaptation from Screen et al. 2022
* Add fix for sort_xarray_data_coords so it works when only one coord value in coordinate (i.e. so each metric can work when only one longitude)
* Supress warning for quadratic func


0.1.1-alpha (2023-03-31)
-------------------------
* Add fix for Kuang to run when there is no time dim
* Add fix for BP15 to except errors where all nan data
* Add warning for BS17 when more than 10 days resolution

0.1.0 (2023-01-22)
-------------------------
* MAJOR UPDATE: re-organise the structure of the package into core, metrics and utils
* rename jet statistics, waviness metrics and jet core algorithm files
* add wrappers to check data is xarray and is sorted in descending order (in core/check_data.py)
* move waviness metrics to new file
* Update appropriate tests

0.0.19-alpha (2022-12-21)
-------------------------
* Update JetStreamOccurenceAndCentreAlgorithm to skip longitude values outside lon range in data
* Make changes to work with Shapely version 1.8/2.0. Means changes to Cattiaux et al. 2016

0.0.18 (2022-11-23)
-------------------------
* update fitted parabola func for Barnes & Polvani 2015
* Add Blackport & Fyfe 2022
* update Barnes & Simpson 2017 to drop all NaN slices
* update to check for more than one time step for time groupby methods
* add test to check all metrics when input is one time step

0.0.17 (2022-11-13)
-------------------------
* add try and except for Grise & Polvani 2017 to account for missing vals

0.0.16 (2022-11-09)
-------------------------
* skipna=True for calc_latitude_and_speed_where_max_ws
* Barnes and Simpson mean over longitude for jet lat

0.0.15 (2022-11-09)
-------------------------
* rename max_lat_0.01 to jet_lat for Grise & Polvani 2017
* Fix get_3_latitudes_and_speed_around_max_ws to work with isel around lon
* Fix barnes polvani parabola to deal with nan values

0.0.14 (2022-11-09)
-------------------------
* add plev mean to Bracegirdle

0.0.14-alpha (2022-10-25)
-------------------------
* update Pena Ortiz so that it returns monthyear and by day local wind maxima
* remove make_empty_local_wind_maxima_data func
* Fix CI
* Add millibars to get_all_hPa_list

0.0.13 (2022-10-19)
-------------------------
* fix workflow for publish to PyPi and TestPyPi

0.0.12 (2022-10-19)
-------------------------
* fix kuang to work for southern hemisphere as well
* add workflow for publish to PyPi

0.0.12-alpha (2022-10-18)
-------------------------
* Update calc_latitude_and_speed_where_max_ws to use numpy methods
* Fix Barnes and Simpson 2017 method so it runs on each longitude

0.0.11 (2022-09-15)
-------------------------
* Update and fix the JetStreamOccurenceAndCentreAlgorithm method for Kuang
* Change LICENSE
* Upload to Zenodo

0.0.10 (2022-08-21)
-------------------
* First release to pypi
* Clean up rst docs

0.0.9 (2022-08-16)
------------------
* Finish tests
* Remove TODOs
* Outline metric_verification notebooks
* Improve docs

0.0.8 (2022-07-18)
------------------
* Format the readme
* seperate metrics into metrics and algorithms
* Reorder and write better docstrings for the utils files
* Update year on LICENSE

0.0.7-beta (2022-06-30)
-----------------------
* swap 'plev' and 'lat' in manney_et_al_2011 method so that it groups cores better
* rename 'sinouisity' to 'sinuosity'

0.0.7-alpha (2022-06-10)
------------------------
* update spatial_utils with lazy method for guessing bounds and assuming a regular grid (func is "_standardise_diffs_by_making_all_most_common_diff")
* update Pena-Ortiz method to seperate into subtropical and polar front jet
* remove prints from windspeed utils
* rename bp13 jet lat

0.0.6 (2022-06-09)
------------------
* add Barnes & Polvani 2015
* add Kerr et al. 2020
* add nearest method function to general utils
* Speed up Ceppi and fix integration method within (still need to verify)
* Add spatial utils for grid cell m2 method

0.0.6-beta (2022-05-31)
-----------------------
* Fix 'get_latitude_and_speed_where_max_ws_at_reduced_resolution' with check for np.nans

0.0.6-alpha (2022-05-25)
------------------------
* add Barnes & Polvani 2013
* Fix 'get_latitude_and_speed_where_max_ws' so it can take one value
* Fix Barnes & Simpson 2017 and Woollings et al. 2010 and change name of col
* Fix Barnes & Polvani neighbouring lats  and speed

0.0.5 (2022-05-23)
------------------
* add Barnes & Simpson 2017
* Update 'get_latitude_and_speed_where_max_ws' function
* Update calc_mass_weighted wind

BIG CHANGES
^^^^^^^^^^^
* Change the 'get_latitude_and_speed_where_max_ws' function to take abs() max -> will mean that negative u-wind values can be considered the jet lat


0.0.5-beta (2022-05-03)
-----------------------
* update Woollings et al. 2010 with seasonal cycle
* update metric details dict with 'plev_units' argument
* fix archer and caldiera call to mass weighted ws (STILL TODO: better plev understanding)

0.0.5-alpha (2022-04-24)
------------------------
* add metric verification notebooks

0.0.4-beta (2022-02-09)
-----------------------
* add description, name and DOI to metric details dict

0.0.4-alpha (2022-01-26)
------------------------
* remove Docker
* remove get data scripts

0.0.3-gamma (2022-01-14)
------------------------
* remove python 3.6 compatibility
* update environment yml (still broken)

0.0.3-beta (2022-01-14)
-----------------------
* Use real part from fourier filter to Woollings and its tests

0.0.3-alpha (2022-01-14)
------------------------
* Remove main and experiment related files (moved to another directory so this one is cleaner)

0.0.2 (2022-01-10)
------------------
* First release on github

0.0.2-beta (2022-01-10)
-----------------------

* Add docstrings to all metrics and sub-components

0.0.2-alpha (2022-01-04)
------------------------

* Add docstrings to Archer & Calidera metric

0.0.1 (2022-01-04)
------------------

* Allow jsmetric to call jetstream_metrics and utils

0.0.1-beta (2021-12-30)
-----------------------

* Add currently existing metrics



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Thomasjkeel/jsmetrics",
    "name": "jsmetrics",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.0",
    "maintainer_email": null,
    "keywords": "jet-stream climate metrics algorithms xarray",
    "author": "Thomas Keel",
    "author_email": "thomas.keel.18@ucl.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/77/44/df2b617a6c34bfd5a2f812971b6938f16748d721be36d8f11760fffb8a3e/jsmetrics-0.2.7.tar.gz",
    "platform": null,
    "description": ".. image:: https://github.com/Thomasjkeel/jsmetrics/blob/main/docs/logos/jsmetrics_logo_tiny.png\n   :target: https://coveralls.io/github/Thomasjkeel/jsmetrics?branch=main\n   :align: center\n   :alt: jsmetrics\n\n============================================\njsmetrics: Jet-stream metrics and algorithms\n============================================\n|pypi| |pre-commit| |codefactor| |coveralls| |openssf| |docs| |license| |black| |zenodo|\n\n*jsmetrics* is an open-source Python package containing implementations of various statistics and algorithms which have been\ndeveloped to identify or characterise jet streams.\n\nThe package is built using `xarray <https://docs.xarray.dev/en/stable/>`_ and currently contains 17 methods,\nconsisting of jet statistics, waviness metrics and jet core algorithms (described `here <https://jsmetrics.readthedocs.io/en/latest/metrics.html>`_).\nAs this is an ongoing project, we are always in the process of finding and implementing new methods.\nYou can find a full list of methods and their current state in the `docs <https://jsmetrics.readthedocs.io/en/latest/index.html>`_.\n\n--------------------------------------------------------------------------------------------------\n\nGMD article describing jsmetrics v0.2.0:\n   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\u20131247, https://doi.org/10.5194/gmd-17-1229-2024, 2024\n\nexample `notebooks <https://github.com/Thomasjkeel/jsmetrics-examples>`_\n\n----\n\nInstallation\n-------------\n.. code-block:: bash\n\n    pip install jsmetrics\n\nLet me know if you have any problems installing this package, as I have not extensively tested for Mac-OS and Windows versions.\n\nDocumentation\n-------------\nThe official documentation is at https://jsmetrics.readthedocs.io/en/latest/\n\nMy email is: thomas.keel.18@ucl.ac.uk. Please feel free to email me if you would like some help working with this package.\n\nUsage\n-------------\n:code:`jsmetrics` is designed to be easy to use and should integrate seemlessly with `*xarray* <https://docs.xarray.dev/en/stable/>`_.\nAn extensive knowledge of Python or *xarray* is **not** required to use *jsmetrics*, although it will help you use the package\nmore effectively if you wish to run some of the more advanced use cases.\n\nBelow we introduce a simple use of the package to run a single jet statistic.\n\n.. code-block:: python\n\n import xarray as xr\n import jsmetrics\n\n # load windspeed data with u- and v- component wind.\n uv_data = xr.open_dataset(filename)\n\n # run Woollings et al. 2010 metric\n w10 = jsmetrics.metrics.jet_statistics.woollings_et_al_2010(uv_data)\n\n print(w10['jet_lat'])\n print(w10['jet_speed'])\n\nExamples\n-------------\nFor examples please check out the examples here: https://jsmetrics.readthedocs.io/en/latest/usage.html\n\nSome example notebooks are available on `GitHub <https://github.com/Thomasjkeel/jsmetrics-examples>`_\n\n**Example of jet latitude statistic:**\n\n.. image:: docs/_static/images/example_jet_lat.png\n  :width: 350\n  :align: center\n  :alt: Example of jet statistic from K20\n\n*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.*\n\n\n**Example of jet core algorithm:**\n\n.. image:: docs/_static/images/jetcore_example_m11.png\n  :width: 450\n  :align: center\n  :alt: Example of jet core algorithm from M11\n\n*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.*\n\n\n**Compare jet core algorithms:**\n\n.. image:: docs/_static/images/jet_core_algorithm_comparions_NA_5_texas2021.png\n  :width: 450\n  :align: center\n  :alt: Comparison of jet core algorithms during Feb 2021 Texas Cold Wave\n\n*Comparison of jet core algorithms estimation of the 6-hourly jet position. Data is 6-hourly ERA5 500-100 hPa u-v-wind.*\n\n\n**Ask questions with jet latitude statsitics:**\n\n.. image:: docs/_static/images/jet_shift_violin.png\n  :width: 450\n  :align: center\n  :alt: Jet latitude circbars with errorbars\n\n*Estimation of mean jet latitude shift. Data is monthly ERA5 850-700 hPa u-wind between 1990-2020.*\n\n\n**Extend the original jet metric definitions using jsmetrics flexibility:**\n\n.. image:: docs/_static/images/all_jet_lats_stj_pfj_npac_maps_more_metrics.png\n  :width: 450\n  :align: center\n  :alt: STJ and PFJ by metric and longitude\n\n*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.*\n\n.. *Why use jsmetrics?:*\n.. ---------------------\n.. The planet's jet streams are complex and not well defined at any one scale (see `what are jet streams <https://jsmetrics.readthedocs.io/en/latest/statement.html#what-are-jet-streams>`_),\n.. and as such there are a wide range of metrics, algorithms and statistics which have been employed in research to help\n.. identify and characterise them. However, it has been generally quite difficult to reconcile various types of information provided\n.. by different techniques. The motivation for this package was thus to standardise the most common methods developed for the\n.. identification and characterisation of jet streams, so that various techniques are immediately available for anyone wishing to\n.. look at jet streams in data. Also, it is hoped that *jsmetrics* provides a foundation for new metrics and for researchers to be\n.. able to quantitatively compare differences provided by existing techniques.\n\n\nHow to cite this package\n------------------------\nIf you wish to cite `jsmetrics` in a research publication, we kindly ask that you use:\n\n   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\u20131247, https://doi.org/10.5194/gmd-17-1229-2024, 2024\n\n\nA reference to a specific version of this software is also available through Zenodo e.g.:\n\n   Keel, T.: Thomasjkeel/jsmetrics: v0.2.2 (0.2.2), Zenodo [code], https://doi.org/10.5281/zenodo.10822662, 2024.\n\nContributing\n------------\njsmetrics is in active development.\n\n* 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`_\n\n* If you would like to contribute code or documentation (which is greatly appreciated!), check out the `Contributing Guidelines`_ before you begin!\n\n.. _issue tracker: https://github.com/Thomasjkeel/jsmetrics/issues\n.. _Contributing Guidelines: https://jsmetrics.readthedocs.io/en/latest/contributing.html\n\nCredits\n-------------\nThe layout and content of this project and was inspired by xclim (https://github.com/Ouranosinc/xclim)\nwhich contains other climate indices and metrics.\n\nThis package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.\n\nDisclaimer\n-------------\nWe have tried to replicate the various metrics based on the equations and details in the methodology as accurately as possible.\nHowever, 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.\nAgain, any further subsetting is passed onto the user.\n*If data input is at a daily resolution, part of the output should also be daily resolution.*\n\nAlso note that, the data we used to test these metrics may have a different resolution to the one it was developed with.\n\nFinally, 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.\nThis project is very much a work in progress, so contributors are very welcome.\n\n.. |license| image:: https://img.shields.io/github/license/thomasjkeel/jsmetrics\n        :target: https://github.com/Thomasjkeel/jsmetrics/blob/master/LICENSE\n        :alt: License\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n        :target: https://github.com/python/black\n        :alt: Python Black\n\n.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/Thomasjkeel/jsmetrics/main.svg\n   :target: https://results.pre-commit.ci/latest/github/Thomasjkeel/jsmetrics/main\n   :alt: pre-commit.ci status\n\n.. |codefactor| image:: https://www.codefactor.io/repository/github/thomasjkeel/jsmetrics/badge\n   :target: https://www.codefactor.io/repository/github/thomasjkeel/jsmetrics\n   :alt: CodeFactor\n\n.. |coveralls| image:: https://coveralls.io/repos/github/Thomasjkeel/jsmetrics/badge.svg?branch=main\n   :target: https://coveralls.io/github/Thomasjkeel/jsmetrics?branch=main\n\n.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10822662.svg\n        :target: https://doi.org/10.5281/zenodo.10822662\n        :alt: Zenodo\n\n.. |docs| image:: https://readthedocs.org/projects/jsmetrics/badge/?version=latest\n       :target: https://jsmetrics.readthedocs.io/en/latest/?badge=latest\n       :alt: Documentation Status\n\n.. |pypi| image:: https://img.shields.io/pypi/v/jsmetrics.svg\n        :target: https://pypi.org/project/jsmetrics/\n        :alt: Python Package Index Build\n\n.. |openssf| image:: https://api.scorecard.dev/projects/github.com/Thomasjkeel/jsmetrics/badge\n            :target: https://scorecard.dev/viewer/?uri=github.com/Thomasjkeel/jsmetrics\n            :alt: OpenSSF scorecard\n\n.. .. |conda| image:: https://img.shields.io/conda/vn/conda-forge/jsmetrics.svg\n..         :target: https://anaconda.org/conda-forge/jsmetrics\n..         :alt: Conda-forge Build Version\n\n\n=======\nHistory\n=======\n\n0.2.7 (2024-09-24)\n-------------------------\n* Fix scipy.ndimage maximum filter error\n* Corrects Kuang et al. 2014 and Schiemann et al. 2009 methods\n\n0.2.6 (2024-09-23)\n-------------------------\n* Add expand_dims and squeeze to time dimensions of 'run_jet_core_and_region_algorithm_on_one_day' to fix manney_et_al_2011\n\n\n0.2.4 (2024-09-23)\n-------------------------\n* Fix scipy.ndimage depreciation warning\n* Change argmax to nanargmax\n* update max numpy version to 1.26 so 'np.RankWarning' still exists (in future prepare for np v2.0)\n* Make sure requirement files have same versions\n\n\n0.2.3 (2024-05-10)\n-------------------------\n* Add example of assigning units to plev in for docstrings in data_utils\n* Add step-security-bot and dependenabot for OSSF scorecard\n* Update dependencies and workflows\n\n\n0.2.3-alpha (2024-04-08)\n-------------------------\n* Add example of assigning units to plev in data_utils\n\n\n0.2.2 (2024-03-15)\n-------------------------\n* Overhaul Kuang et al. 2014 method to work with plev-lat center check rather than lat-long jet center check.\n* Use maximum filter from scipy ndimage for diagonal check from 'find_local_maxima_in_2d_dataarray_with_diagonals' used in M11 and K14\n* Also makes a change to Manney et al. 2011 method if using diagonal check (should not affect results as it was working before)\n\n\n0.2.2-beta (2024-03-13)\n-------------------------\n* Fix error when checking for plev units in data_utils\n* Reduce README content\n\n\n0.2.1 (2023-12-01)\n-------------------------\n* Update Manney et al. 2011 method to include 'check_diagonals' parameter\n* Update Manney et al. 2011 method to select maximum windspeed if no cores found above threshold\n* Add 'slice_array_by_index_breaks' to data utils\n* Update examples of use and quick start table in docs\n* Add check for plev units to data_utils\n* Update Archer & Calidera to more properly check for whether data plev coords are Pa or hPa.\n* Fix typos and clarify writing in docs\n\n\n0.2.0 (2023-10-12)\n-------------------------\n* Fix CI and Github actions\n* Finish overhaul the ReadTheDocs documentation in the package\n* Confirm completed and to verify metrics\n* Update Schiemann et al. 2009 method to run faster and introduce u_threshold parameter default\n* Add more complete inline 'Steps' to each metric in the package for readability.\n* Remove Screen & Simmonds and Local Wave Activity leftover code\n* Update Manney et al. 2011 further with padding to capture cores near the edge of dataset\n\n0.1.7 (2023-10-10)\n-------------------------\n* Changes:\n* **MAJOR:** Rename to Barnes & Polvani 2014 and update tests and all mentions of\n* Update Cattiaux method to deal with Matplotlib depreciation warning about using 'allsegs' or 'collections' in contour plot\n* Add tests for new spatial utils method 'seperate_one_contour_into_line_segments'\n* Add readthedocs.yml\n\n0.1.7-beta (2023-10-05)\n-------------------------\n* Rename to Barnes & Polvani 2014 and update tests and all mentions of\n\n0.1.7-alpha (2023-09-19)\n-------------------------\n* Update Cattiaux method to deal with Matplotlib depreciation warning about using 'allsegs' or 'collections' in contour plot\n* Add tests for new spatial utils method 'seperate_one_contour_into_line_segments'\n\n0.1.6 (2023-09-14)\n-------------------------\n* Overhaul the ReadTheDocs documentation in the package\n    * Write a more detailed description of each metric\n    * Add examples and implementation notes to each metric\n    * Update listing in 'details_for_all_metrics.py'\n    * Update the 'Why jsmetrics' section with notes about what jets are and quick start help\n    * Add some Examples of Use for each type of metric\n* Add ws_threshold parameter to Pena-Ortiz method\n* Rename Pena-Ortiz method to 'pena_ortiz_et_al_2016' (as earlier paper)\n\n0.1.6-alpha (2023-08-19)\n-------------------------\n* Fix Manney et al. 2011 implementation\n* Correct Manney 2011 method\n* Move old method to new metric: 'jet_core_identification_algorithm'\n* Update docs for Manney 2011 and sub-components\n\n0.1.5-beta (2023-08-16)\n-------------------------\n* Update Schiemann method with new variable name (jet occurence), docstring and changes to sub-component function names\n* Add ws_threshold parameter to Schiemann\n* Update methods that work on one time unit of data and add squeeze method to properly deal if time not in dims\n* Add basic outline of jet core algorithm docstrings\n\n0.1.5-alpha (2023-08-15)\n-------------------------\n* Begin overhaul of ReadTheDocs documentation\n* Add notes and example to Koch et al. 2006 metric\n* Rename variable returned by K06 to jet_events_ws\n\n0.1.4 (2023-08-02)\n-------------------------\n* Add new metric to package: Zappa et al. 2018 (This method builds on Ceppi et al. 2018)\n* Raise KeyError if no time coordinate is passed to a given metrics\n\n0.1.4-alpha (2023-07-21)\n-------------------------\n* add KeyError raise if no time coordinate is passed to various metrics\n\n0.1.3 (2023-07-07)\n-------------------------\n* Add \"method='nearest'\" to jet statistics and core algorithms for cases when coords cannot be represented within float precision range.\n\n0.1.2 (2023-06-06)\n-------------------------\n* Fix  Barnes & Polvani 2013 to better deal when min max jet lat is at edge data\n* Add check for NoLeapDatetime\n\n0.1.2-alpha (2023-05-27)\n-------------------------\n* Add check for NoLeapDatetime\n\n0.1.1 (2023-05-26)\n-------------------------\n* Fix Woollings et al. 2010 and filter windows to use day timeunits for window to stop it removing too much data.\n* Add data util function to add number of days to 360Day Datetime type\n\n0.1.1-beta (2023-04-07)\n-------------------------\n* add parameter for Kerr et al. 2020\n* Add Ceppi et al jet speed adaptation from Screen et al. 2022\n* Add fix for sort_xarray_data_coords so it works when only one coord value in coordinate (i.e. so each metric can work when only one longitude)\n* Supress warning for quadratic func\n\n\n0.1.1-alpha (2023-03-31)\n-------------------------\n* Add fix for Kuang to run when there is no time dim\n* Add fix for BP15 to except errors where all nan data\n* Add warning for BS17 when more than 10 days resolution\n\n0.1.0 (2023-01-22)\n-------------------------\n* MAJOR UPDATE: re-organise the structure of the package into core, metrics and utils\n* rename jet statistics, waviness metrics and jet core algorithm files\n* add wrappers to check data is xarray and is sorted in descending order (in core/check_data.py)\n* move waviness metrics to new file\n* Update appropriate tests\n\n0.0.19-alpha (2022-12-21)\n-------------------------\n* Update JetStreamOccurenceAndCentreAlgorithm to skip longitude values outside lon range in data\n* Make changes to work with Shapely version 1.8/2.0. Means changes to Cattiaux et al. 2016\n\n0.0.18 (2022-11-23)\n-------------------------\n* update fitted parabola func for Barnes & Polvani 2015\n* Add Blackport & Fyfe 2022\n* update Barnes & Simpson 2017 to drop all NaN slices\n* update to check for more than one time step for time groupby methods\n* add test to check all metrics when input is one time step\n\n0.0.17 (2022-11-13)\n-------------------------\n* add try and except for Grise & Polvani 2017 to account for missing vals\n\n0.0.16 (2022-11-09)\n-------------------------\n* skipna=True for calc_latitude_and_speed_where_max_ws\n* Barnes and Simpson mean over longitude for jet lat\n\n0.0.15 (2022-11-09)\n-------------------------\n* rename max_lat_0.01 to jet_lat for Grise & Polvani 2017\n* Fix get_3_latitudes_and_speed_around_max_ws to work with isel around lon\n* Fix barnes polvani parabola to deal with nan values\n\n0.0.14 (2022-11-09)\n-------------------------\n* add plev mean to Bracegirdle\n\n0.0.14-alpha (2022-10-25)\n-------------------------\n* update Pena Ortiz so that it returns monthyear and by day local wind maxima\n* remove make_empty_local_wind_maxima_data func\n* Fix CI\n* Add millibars to get_all_hPa_list\n\n0.0.13 (2022-10-19)\n-------------------------\n* fix workflow for publish to PyPi and TestPyPi\n\n0.0.12 (2022-10-19)\n-------------------------\n* fix kuang to work for southern hemisphere as well\n* add workflow for publish to PyPi\n\n0.0.12-alpha (2022-10-18)\n-------------------------\n* Update calc_latitude_and_speed_where_max_ws to use numpy methods\n* Fix Barnes and Simpson 2017 method so it runs on each longitude\n\n0.0.11 (2022-09-15)\n-------------------------\n* Update and fix the JetStreamOccurenceAndCentreAlgorithm method for Kuang\n* Change LICENSE\n* Upload to Zenodo\n\n0.0.10 (2022-08-21)\n-------------------\n* First release to pypi\n* Clean up rst docs\n\n0.0.9 (2022-08-16)\n------------------\n* Finish tests\n* Remove TODOs\n* Outline metric_verification notebooks\n* Improve docs\n\n0.0.8 (2022-07-18)\n------------------\n* Format the readme\n* seperate metrics into metrics and algorithms\n* Reorder and write better docstrings for the utils files\n* Update year on LICENSE\n\n0.0.7-beta (2022-06-30)\n-----------------------\n* swap 'plev' and 'lat' in manney_et_al_2011 method so that it groups cores better\n* rename 'sinouisity' to 'sinuosity'\n\n0.0.7-alpha (2022-06-10)\n------------------------\n* update spatial_utils with lazy method for guessing bounds and assuming a regular grid (func is \"_standardise_diffs_by_making_all_most_common_diff\")\n* update Pena-Ortiz method to seperate into subtropical and polar front jet\n* remove prints from windspeed utils\n* rename bp13 jet lat\n\n0.0.6 (2022-06-09)\n------------------\n* add Barnes & Polvani 2015\n* add Kerr et al. 2020\n* add nearest method function to general utils\n* Speed up Ceppi and fix integration method within (still need to verify)\n* Add spatial utils for grid cell m2 method\n\n0.0.6-beta (2022-05-31)\n-----------------------\n* Fix 'get_latitude_and_speed_where_max_ws_at_reduced_resolution' with check for np.nans\n\n0.0.6-alpha (2022-05-25)\n------------------------\n* add Barnes & Polvani 2013\n* Fix 'get_latitude_and_speed_where_max_ws' so it can take one value\n* Fix Barnes & Simpson 2017 and Woollings et al. 2010 and change name of col\n* Fix Barnes & Polvani neighbouring lats  and speed\n\n0.0.5 (2022-05-23)\n------------------\n* add Barnes & Simpson 2017\n* Update 'get_latitude_and_speed_where_max_ws' function\n* Update calc_mass_weighted wind\n\nBIG CHANGES\n^^^^^^^^^^^\n* Change the 'get_latitude_and_speed_where_max_ws' function to take abs() max -> will mean that negative u-wind values can be considered the jet lat\n\n\n0.0.5-beta (2022-05-03)\n-----------------------\n* update Woollings et al. 2010 with seasonal cycle\n* update metric details dict with 'plev_units' argument\n* fix archer and caldiera call to mass weighted ws (STILL TODO: better plev understanding)\n\n0.0.5-alpha (2022-04-24)\n------------------------\n* add metric verification notebooks\n\n0.0.4-beta (2022-02-09)\n-----------------------\n* add description, name and DOI to metric details dict\n\n0.0.4-alpha (2022-01-26)\n------------------------\n* remove Docker\n* remove get data scripts\n\n0.0.3-gamma (2022-01-14)\n------------------------\n* remove python 3.6 compatibility\n* update environment yml (still broken)\n\n0.0.3-beta (2022-01-14)\n-----------------------\n* Use real part from fourier filter to Woollings and its tests\n\n0.0.3-alpha (2022-01-14)\n------------------------\n* Remove main and experiment related files (moved to another directory so this one is cleaner)\n\n0.0.2 (2022-01-10)\n------------------\n* First release on github\n\n0.0.2-beta (2022-01-10)\n-----------------------\n\n* Add docstrings to all metrics and sub-components\n\n0.0.2-alpha (2022-01-04)\n------------------------\n\n* Add docstrings to Archer & Calidera metric\n\n0.0.1 (2022-01-04)\n------------------\n\n* Allow jsmetric to call jetstream_metrics and utils\n\n0.0.1-beta (2021-12-30)\n-----------------------\n\n* Add currently existing metrics\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Library of algorithms and metrics used to characterise jet-streams.",
    "version": "0.2.7",
    "project_urls": {
        "Homepage": "https://github.com/Thomasjkeel/jsmetrics"
    },
    "split_keywords": [
        "jet-stream",
        "climate",
        "metrics",
        "algorithms",
        "xarray"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcbc61712b6869bda49f8d9dc07507de0cbe096b31ca7053cf4ba5723e71fe94",
                "md5": "0f8c3f719324591e910ee906711e1c7c",
                "sha256": "0817f14f09d2e29f65538c680cb9bf1dd2346375025901ddb90988ded5af2a98"
            },
            "downloads": -1,
            "filename": "jsmetrics-0.2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f8c3f719324591e910ee906711e1c7c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0",
            "size": 3578618,
            "upload_time": "2024-09-24T15:29:46",
            "upload_time_iso_8601": "2024-09-24T15:29:46.239506Z",
            "url": "https://files.pythonhosted.org/packages/dc/bc/61712b6869bda49f8d9dc07507de0cbe096b31ca7053cf4ba5723e71fe94/jsmetrics-0.2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7744df2b617a6c34bfd5a2f812971b6938f16748d721be36d8f11760fffb8a3e",
                "md5": "e4f2d163bfc4efb5556609488c4a7eb6",
                "sha256": "d78051ab350be435095d7babd6f2a54301ec3c1c5fb851e682c532aced11fc30"
            },
            "downloads": -1,
            "filename": "jsmetrics-0.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "e4f2d163bfc4efb5556609488c4a7eb6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0",
            "size": 8383787,
            "upload_time": "2024-09-24T15:29:48",
            "upload_time_iso_8601": "2024-09-24T15:29:48.726413Z",
            "url": "https://files.pythonhosted.org/packages/77/44/df2b617a6c34bfd5a2f812971b6938f16748d721be36d8f11760fffb8a3e/jsmetrics-0.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-24 15:29:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Thomasjkeel",
    "github_project": "jsmetrics",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "jsmetrics"
}
        
Elapsed time: 0.90799s