Skip to main content

Calculate the entraining CAPE (ECAPE) of a parcel.

Project description

ecape

ecape is a simple module that contains an entraining CAPE, or ECAPE, calculation described by Peters et. al. 2023. Peters-provided MatLab scripts serve as a reference and test verification data. The module leans heavily on MetPy for meteorological calculations.

PyPI - Version PyPI - Python Version

Installation & Use

In console:

pip install ecape

See the example in linked documentation.

   from ecape.calc import calc_ecape
   ...
   ecape = calc_ecape(height, pressure, temperature, specific_humidity, u_wind, v_wind)

Documentation & Source

https://github.com/citylikeamradio/ecape

https://citylikeamradio.github.io/ecape

Contact

Questions, comments, and feedback are certainly welcome. This project is a personal exercise in learning how to publish packages to Github & PyPI, so excuse the excessive documentation for one function.

Future Work

  • add support for other water content variables
  • if useful, incorporate into MetPy
  • provide cli .nc, .csv, & aws support

A note on undiluted CAPE & calculation accuracy

If users prefer their own CAPE calculations, use the undiluted_cape parameter:

When comparing calc_ecape.py & COMPUTE_ECAPE.m run on Peters 2023 sample data, there is a ~10% difference in the resultant ECAPE. This is almost entirely due to a difference in calculated MUCAPE. The tests describe other sources of variation (~1%).

Given:

  • the methods here are within ~1% of Peters' calculations when undiluted CAPE is equivalent
  • Peters et. al. specifically mention MetPy for determining undiluted CAPE
  • MetPy is a reliable, open-source, and frequently used meteorological calculation package

MetPy's undiluted CAPE calculations were chosen for ease of readability and implementation.

References

Ryan M. May, Sean C. Arms, Patrick Marsh, Eric Bruning, John R. Leeman, Kevin Goebbert, Jonathan E. Thielen, Zachary S Bruick, and M. Drew. Camron. Metpy: a Python package for meteorological data. 2023. URL: Unidata/MetPy, doi:10.5065/D6WW7G29.

John Peters. ECAPE scripts. 2 2023. URL: https://figshare.com/articles/software/ECAPE_scripts/21859818, doi:10.6084/m9.figshare.21859818.v4.

John M. Peters, Daniel R. Chavas, Hugh Morrison, Chun-Yian Su, and Brice E. Coffer. An analytic formula for entraining cape in mid-latitude storm environments. 2023. arXiv:2301.04712.

Licence

ecape is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecape-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecape-0.1.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file ecape-0.1.0.tar.gz.

File metadata

  • Download URL: ecape-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for ecape-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23592dc8753da36fcb7e8db7472f2ea8a9e6ba25d3784a1778d5be67a486c7f8
MD5 324f660d4536e35a04174de7516ebc0f
BLAKE2b-256 8d2b6c823203d4305364b2f32163300b3ad8df193893470aaff626700a19d795

See more details on using hashes here.

File details

Details for the file ecape-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ecape-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for ecape-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb19ec022f31084e9931814b8e6fb374df607a659ca00dd56339d1e168a8d8bc
MD5 90b772edc93cdc955a69ce9e8228bfeb
BLAKE2b-256 e4aa90933a19f3e799860183fc056bb560531844fb38aedaa22a5b61f5fb24f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page