tcpyPI
A set of scripts and notebooks that compute and validate tropical cyclone (TC) potential intensity (PI) calculations in Python.
https://github.com/dgilford/tcpypi
Category: Climate Change
Sub Category: Natural Hazard and Storm
Keywords
climate climate-data hurricane-calculations hurricanes potential-intensity tropical-cyclone tropical-cyclone-variability weather-conditions
Keywords from Contributors
transforms measur compose archiving observation reporting sharing optimize numerics animals
Last synced: about 12 hours ago
JSON representation
Repository metadata
tcpyPI, aka "pyPI": Tropical Cyclone Potential Intensity Calculations in Python
- Host: GitHub
- URL: https://github.com/dgilford/tcpypi
- Owner: dgilford
- License: mit
- Created: 2020-03-16T14:37:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-04T17:22:38.000Z (about 2 months ago)
- Last Synced: 2025-04-10T06:04:41.066Z (17 days ago)
- Topics: climate, climate-data, hurricane-calculations, hurricanes, potential-intensity, tropical-cyclone, tropical-cyclone-variability, weather-conditions
- Language: Jupyter Notebook
- Homepage:
- Size: 56.3 MB
- Stars: 86
- Watchers: 2
- Forks: 33
- Open Issues: 5
- Releases: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
tcpyPI: Potential Intensity Calculations in Python
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:
- supply a freely available validated Python potential intensity calculator,
- carefully document the BE02 algorithm and its Python implementation, and to
- demonstrate and encourage the use of potential intensity theory in tropical cyclone climatology analysis.
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:
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.
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.
To install tcpypi from the command line:
pip install tcpypi
tcpyPI Dependencies
- NumPy
- Numba
Not required by tcpyPI---but highly recommended!---is the versatility in calculating PI over large datasets provided by xarray.
Dependency 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
- pi.py - The primary function of pyPI, that computes and outputs PI (and associated variables) given atmospheric and ocean state variables.
- run_sample.py - Example script that computes PI and accompanying analyses over the entire sample dataset
Data
- sample_data.nc - Sample atmospheric and ocean state variable data and BE02 MATLAB output data; values are monthly averages over the globe from MERRA2 in 2004.
- mdr.json - Main Development Region definitions from Gilford et al. (2017)
- raw_sample_output.nc - Sample outputs from pi.py only created by run_sample.py
- full_sample_output.nc - Full set of sample outputs from pi.py as well as sample analyses such as PI decomposition
Validation and Testing Notebooks
- test_pi_calc.ipynb - Simple code showing a single call of pi.py and testing the speed of the algorithm
- verify_pi.ipynb - Notebook validating/verifying pyPI outputs against BE02 MATLAB output data
- sample_output_analyses.ipynb - Notebook showing examples of pyPI outputs and simple PI analyses
Misc.
- utilities.py - Set of functions used in the pyPI codebase
- constants.py - Set of meteorological constants used in the pyPI codebase
- reference_calculations.m - Script used to generate sample BE02 MATLAB output data from original MERRA2 files monthly mean; included for posterity and transparency
- pc_min.m - Original BE02 algorithm from MATLAB, adapted and used to produce analyses of Gilford et al. (2017; 2019)
- clock_pypi.ipynb - Notebook estimating the time it takes to run pyPI on a laptop
Author
- Daniel M. Gilford, PhD - Creation, Development, & Maintenance - GitHub
Contributor(s)
- Ben Mares - Modernization - GitHub
- Daniel Rothenberg, PhD - Numba Optimization & Sample Code - GitHub
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
- Kerry Emanuel (MIT) - Development of potential intensity theory; encouragement and permission to pursue Python implementation
- Susan Solomon (MIT), Paul O'Gorman (MIT), Allison Wing (FSU) - Helpful conversations, advice, and suggestions on TC PI research
- Dan Chavas (Purdue), Jonathan Lin (MIT), Raphael Rousseau-Rizzi (MIT) - Feedback on pyPI code and documentation
Owner metadata
- Name: Daniel Gilford
- Login: dgilford
- Email:
- Kind: user
- Description: Climate Scientist at Climate Central studying climate attribution, sea-level rise, and tropical cyclones. I'm also interested in open science and communication!
- Website: http://www.danielgilford.com
- Location: Orlando, FL
- Twitter: danielgilford
- Company: Climate Central
- Icon url: https://avatars.githubusercontent.com/u/8387331?u=2fff5a51ab1c89b2ee49b61e8b2ff5b8bd558a60&v=4
- Repositories: 2
- Last ynced at: 2023-03-08T23:47:04.801Z
- Profile URL: https://github.com/dgilford
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 7
- Watch event: 13
- Delete event: 2
- Issue comment event: 16
- Member event: 1
- Push event: 7
- Pull request event: 15
- Fork event: 2
Last Year
- Create event: 1
- Release event: 1
- Issues event: 7
- Watch event: 13
- Delete event: 2
- Issue comment event: 16
- Member event: 1
- Push event: 7
- Pull request event: 15
- Fork event: 2
Committers metadata
Last synced: 6 days ago
Total Commits: 181
Total Committers: 6
Avg Commits per committer: 30.167
Development Distribution Score (DDS): 0.392
Commits in past year: 36
Committers in past year: 2
Avg Commits per committer in past year: 18.0
Development Distribution Score (DDS) in past year: 0.056
Name | Commits | |
---|---|---|
Daniel Gilford | d****d | 110 |
Ben Mares | s****1@t****m | 34 |
dependabot[bot] | 4****] | 29 |
dependabot-preview[bot] | 2****] | 4 |
Daniel Gilford | d****d@d****l | 2 |
Daniel Gilford | d****d@d****l | 2 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 16
Total pull requests: 62
Average time to close issues: about 1 year
Average time to close pull requests: 3 months
Total issue authors: 12
Total pull request authors: 5
Average comments per issue: 2.0
Average comments per pull request: 0.47
Merged pull request: 41
Bot issues: 0
Bot pull requests: 51
Past year issues: 2
Past year pull requests: 6
Past year average time to close issues: N/A
Past year average time to close pull requests: 3 days
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.5
Past year average comments per pull request: 0.83
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- aramirezreyes (3)
- maresb (2)
- msnaidu7 (2)
- jbednar (1)
- codesssss (1)
- CongGao-CG (1)
- laurrrel (1)
- Wamashudu (1)
- pauladigun (1)
- rabernat (1)
- burlen (1)
- ktyle (1)
Top Pull Request Authors
- dependabot[bot] (47)
- maresb (6)
- dgilford (4)
- dependabot-preview[bot] (4)
- aramirezreyes (1)
Top Issue Labels
- bug (3)
- documentation (3)
- enhancement (2)
- not critical (2)
- duplicate (1)
- help wanted (1)
Top Pull Request Labels
- dependencies (50)
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 1,083 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 7
- Total maintainers: 1
pypi.org: tcpypi
tcpyPI: Tropical cyclone potential intensity calculations in Python
- Homepage: https://github.com/dgilford/tcpyPI
- Documentation: https://tcpypi.readthedocs.io/
- Licenses: MIT License Copyright (c) 2020 Daniel Gilford Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Latest release: 1.3.5 (published over 2 years ago)
- Last Synced: 2025-04-25T13:32:16.810Z (1 day ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 1
- Downloads: 1,083 Last month
-
Rankings:
- Dependent packages count: 7.31%
- Forks count: 7.395%
- Stargazers count: 8.752%
- Average: 15.26%
- Dependent repos count: 22.088%
- Downloads: 30.757%
- Maintainers (1)
Dependencies
- actions/checkout v4 composite
- prefix-dev/setup-pixi v0.8.3 composite
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- hynek/build-and-inspect-python-package v2 composite
- pypa/gh-action-pypi-publish release/v1 composite
- numba >=0.51.2
- numpy >=1.19.5
Score: 13.291954241719464