LMXB / hn2016_falwa

Python library for computing Finite-Amplitude Local Wave Activity from climate data.

Home Page:https://csyhuang.github.io/hn2016_falwa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Library: hn2016_falwa (v0.4.1)

Build Statuscodecov.ioDocumentation Status

hn2016_falwa_diagram

Compute from gridded climate data the Finite-amplitude Local Wave Activity (FALWA) and flux terms introduced in:

To users

If you are interested in using the package, please leave your contact here such that I can keep you updated of any changes made.

Important update (for release after May 24, 2018)

The most updated version v0.3.0 enhanced the methods in the class QGField (in hn2016_falwa.oopinterface) with functionality to compute (the barotropic components of) LWA and flux terms present in Nakamura and Huang (2018, Science). Please refer to the scripts in examples/nh2018_science/ for details.

Installation

This current version works in both Python 2.7 and 3.6. Note that since v0.3.0, some functions are having backend in Fortran. You will 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:

git clone https://github.com/csyhuang/hn2016_falwa.git
cd hn2016_falwa
python setup.py develop

To incorporate updates, pull the new version of the code by:

git pull

There are two interfaces for this library. One is the developer interface; the other is the object-oriented interface, which is a wrapper for the basis functions in the developer interface and also compiled fortran modules.

Object-oriented interface

The object-oriented interface is an easy-to-use interface that takes in the climate field and coordinates as the attributes of an object, and implement the wrapper functions above as methods.

There are two classes in the interface, QGField and BarotropicField. Please refer to the example/ directory:

Sample Script Description
nh2018_science/demo_script_for_nh2018.ipynb Compute wave activity and flux terms in the QG framework presented in Nakamura and Huang (2018, Science). Sample data can be retrieved with download_example.py in the same directory.
simple/oopinterface_example_BarotropicField.ipynb Same as Example_barotropic.ipynb.

Developer Interface

The developer interface contains separate functions that users can alter the inputs more flexibly. Functions are added upon users' request on new functionalities to test hypotheses (also see the test branch). The developer interface consists of 4 types of functions:

  • The basis functions are smallest unit of functions that make up the wrapper functions and object-oriented interface.

  • The wrapper functions implement particular analysis tasks for published work/manuscripts in preparation

  • The utility functions compute general quantities, such as static stability or quasi-geostrophic potential vorticity that are not specific to the finite-amplitude wave theory.

  • The beta-version functions include utilities that are not fully documented but has been used in research.

Sample Script Description
Example_qgpv.ipynb It reads in a sample datasets u_QGPV_240hPa_2012Oct28to31.nc", which contains zonal velocity and QGPV field at 240hPa derived form ERA-Interim reanalysis data. Similar to fig. 9 in Huang and Nakamura (2016), a hemispheric domain is used here.
Example_barotropic.ipynb It reads in a sample datasets "barotropic_vorticity.nc", which contains absolute vorticity field snapsnots from a barotropic decay model (Held and Phillips 1987). It computes both the equivalent-latitude relationship (e.g. Nakamura 1996) and local wave activity (Huang and Nakamura 2016) in a global domain.

Inquiries / Issues reporting

Please make inquiries about / report issues with the package on the Issues page. If you need help analyzing output from particular model/analysis with our techniques, feel free to email me csyhuang@uchicago.edu with sample datasets and I can configure the code for you.

About

Python library for computing Finite-Amplitude Local Wave Activity from climate data.

https://csyhuang.github.io/hn2016_falwa

License:MIT License


Languages

Language:Python 86.6%Language:Fortran 13.4%