falwa: Finite-amplitude local wave activity
falwa is a python library that provides tools to measure and study life cycle of large-scale extreme weather events. It implements the finite-amplitude local wave activity and flux diagnostic introduced in:
This current version works for Python 3.x. Note that since v0.3.0, some functions have backend in Fortran. To build the package from source, you need a fortran compiler (e.g. gfortran) to implement the installation.
Since the package is still being actively developed, please use the develop mode for installation.
To install the package for the first time, clone the GitHub repo and install via develop mode::
git clone https://github.com/csyhuang/hn2016_falwa.git
python setup.py develop
To incorporate updates, pull the new version of the code from GitHub. Remove any existing f2py modules and recompile.:
# Assume you are already in the falwa/ repo
python setup.py develop
pytest tests/ # to check if the package can be run properly
There are some readily run python scripts (in scripts/) and jupyter notebooks (in notebooks/) which you can start with. The netCDF files needed can be found in Clare’s Dropbox folder.
Depending on what you want to do, the methods to be use may be different.
If you solely want to compute equivalent latitude and local wave activity from a 2D field, you can refer to notebooks/simple/Example_barotropic.ipynb. This is useful for users who want to use LWA to quantify field anomalies.
If you want to compute zonal wind reference states and wave activity fluxes in QG Formalism, look at notebooks/nh2018_science/demo_script_for_nh2018.ipynb for the usage of QGField. This notebook demonstrates how to compute wave activity and reference states presented in Nakamura and Huang (2018). To make sure the package is properly installed in your environment, run through the notebook after installation to see if there is error.
THe conda environment for running the notebook can be found in environment.yml. To create the conda environment, execute::
conda env create -f environment.yml
This project is sponsored by JetBrains as one of the non-commercial open source projects. JetBrains provides core project contributors with a set of best-in-class developer tools free of charge. Please check out their Open Source Support page for details.
If you encounter coding issues/bugs when using the package, please create an Issue ticket.
If you have scientific questions, please contact Clare S. Y. Huang via email(firstname.lastname@example.org).
- Object Oriented Interface
- Xarray Interface
- Barotropic Field
- Basis Functions
- Plot Utilities
- Utility Functions
- Wrapper Functions
- Data Storage
- Example Notebooks
- Demo script for the analyses done in Nakamura and Huang (2018, Science)
- Demo script for the analyses done in Nakamura and Huang (2018, Science): using xarray
- Direct inversion algorithm for reference state computation (Neal et al 2023 GRL)
- Using the object-oriented interface (