Home

Awesome

tcpyPI: Potential Intensity Calculations in Python

<p align="center"> <img src="./figures/readme_image.png" alt="" width="720" height="480"> </p>

tcpyPI, 'pyPI' for short, is a set of scripts and notebooks that compute and validate tropical cyclone (TC) potential intensity (PI) calculations in Python. It is a fully documented and improved port of the Bister and Emanuel 2002 algorithm (hereafter BE02) which was originally written in FORTRAN---and then MATLAB---by Prof. Kerry Emanuel (MIT). Kerry's original MATLAB code (pcmin.m) is found at:

The goals in developing and maintaining pyPI are to:

If you have any questions, comments, or feedback, please contact the developer or open an Issue in the repository. A paper detailing pyPI is published at Geoscientific Model Development.

Citation

pyPI was developed by Daniel Gilford and has been archived on Zenodo:

DOI

If you use pyPI in your work, please include the citations:

Gilford, D. M.: pyPI (v1.3): Tropical Cyclone Potential Intensity Calculations in Python, Geosci. Model Dev., 14, 2351–2369, https://doi.org/10.5194/gmd-14-2351-2021, 2021.

and

Gilford, D. M. 2020: pyPI: Potential Intensity Calculations in Python, pyPI v1.3. Zenodo. http://doi.org/10.5281/zenodo.3985975

Full pyPI Description

Please read pyPI_Users_Guide_v1.3.pdf for a full overview and details on pyPI. The description includes the pyPI background, a PI computation derivation, validation against the commonly-used MATLAB algorithm (pcmin), and a set of sample analyses.

Getting Started

pyPI requires Python version 3.7+ to run. It was originally written and tested with Python 3.7.6 and has been recently validated with Python 3.8.8 (as of 10 August 2022). To get pyPI up and running on your system, clone the repository and ensure that you have the required dependencies.

Installation

pyPI is packaged using the python package manager pip.

PyPI version

To install tcpypi from the command line:

pip install tcpypi

tcpyPI Dependencies

Not required by tcpyPI---but highly recommended!---is the versatility in calculating PI over large datasets provided by xarray. Dependancy versions were originally handled by Dependabot, but the code was not resilient to these changes so they are currently defunct (as of 10 August 2022). Please notify me immediately if installation problems persist.

Python Implementation of "pc_min" (BE02 PI Calculator)

pi.py is the Python function which directly computes PI given atmospheric and ocean state variables (akin to the BE02 algorithm MATLAB implementation pc_min.m). Given input vector columns of environmental atmospheric temperatures (T) and mixing ratios (R) on a pressure grid (P), sea surface temperatures (SST), and mean sea-level pressures (MSL), the algorithm outputs potential intensity, the outflow level, the outflow temperature, and the minimum central pressure, and a flag that shows the status of the completed PI calculation. pyPI is an improvement on pcmin in that it handles missing values depending on user input flags.

Users who want to apply the PI calculation to a set of local environmental conditions need only to download pi.py, organize their data appropriately, and call the function to return outputs, e.g.:

(VMAX,PMIN,IFL,TO,LNB)=pi(SST,MSL,P,T,R)

Running a pyPI Sample

Included in the pyPI release is a sample script run_sample.py which runs global sample data from MERRA2 (in 2004) through pi.py, vectorizes the output, and performs several simple analyses. To run, simply:

python run_sample.py

and examine the outputs locally produced in full_sample_output.nc.

File Descriptions

Key files

Data

Validation and Testing Notebooks

Misc.

Author

Contributor(s)

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments