python package to compute finite-amplitude local wave activity (Huang and Nakamura 2016, JAS)
Project description
Python Library: falwa (v2.0.0)
Important: this python package has been renamed from hn2016_falwa
to falwa
since version v1.0.0.
Compute from gridded climate data the Finite-amplitude Local Wave Activity (FALWA) and flux terms introduced in:
- Huang and Nakamura (2016, JAS)
- Huang and Nakamura (2017, GRL).
- Nakamura and Huang (2018, Science) Atmospheric Blocking as a Traffic Jam in the Jet Stream.
- Neal et al (2022, GRL) The 2021 Pacific Northwest Heat Wave and Associated Blocking: Meteorology and the Role of an Upstream Cyclone as a Diabatic Source of Wave Activity
Package Installation
Attention: substantial changes took place in release v2.0.0. Installation in develop mode is no longer available.
Since release v2.0.0, the F2PY modules in falwa
is compiled with meson
(See Issue #95 for details) to cope with the deprecation of numpy.disutils
in python 3.12.
First-time installation
- To build the package from source, you need a fortran compiler (e.g., gfortran) to implement the installation.
- Clone the package repo by
git clone https://github.com/csyhuang/hn2016_falwa.git
. - Navigate into the repository and set up a python environment satisfying the installation requirement by
conda env create -f environment.yml
. The environment name in the file is set to befalwa_env
(which users can change). - Install the package with the command
python -m pip install .
- If the installation is successful, you should be able to run through all unit tests in the folder
tests/
by executingpytest tests/
.
Get updated code from new releases
- To incorporate updates, first, pull the new version of the code from GitHub by
git pull
. - Uninstall existing version of
falwa
:pip uninstall falwa
- If there is change in
environment.yml
, remove the existing environment byconda remove --name falwa_env --all
and create the environment again from the updated YML file:conda env create -f environment.yml
. - Reinstall the updated version by
python -m pip install .
. - Run through all unit tests in the folder
tests/
by executingpytest tests/
to make sure the package has been properly installed.
Quick start
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 ofQGField
. 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.
Inquiries / Issues reporting
- If you are interested in getting email message related to update of this package, please leave your contact here such that I can keep you updated of any changes made.
- If you encounter coding issues/bugs when using the package, please create an Issue ticket.
- If you have scientific questions, please create a thread in the Discussion Board with the category "General" or "Q&A" according to the circumstance.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file falwa-2.0.0.tar.gz
.
File metadata
- Download URL: falwa-2.0.0.tar.gz
- Upload date:
- Size: 46.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab85813cbec50a2ea1a62fa5396cbd79b8031aebe5196a32e29ec6be02b3be8 |
|
MD5 | c8121cb4a71495476ab11cd13af84e14 |
|
BLAKE2b-256 | 4c156e11ec1dbf42cf3b1b21ce806b378676a13f23f3c81becbd8c75baf3b5ea |