miniufo / xcontour

diagnostic analyses and calculations in contour-based coordinates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xcontour

DOI GitHub

diagnostic analyses in contour-based coordinate

1. Introduction

xcontour is a python package built on xarray (starts with an x), targeting at performing diagnostic analyses and calculations in contour-based coordinates. The new coordinates are built based on iso-surfaces of any quasi-conservative tracers (passive or active), mostly through a conservative rearrangement (or adiabatic sorting in a particular direction). Such rearrangement allows one to isolate the adiabatic advective process of a fluid and focus on non-conservative processes. Therefore, it simplifies the relavent dynamical view and interpretation of many phenomena.

The most well-known contour-based coordinates are 1) isentropic coordinate used in the atmosphere and 2) isopycnal coordinate used in the ocean, both of which are based on quasi-conservative variables of potential temperature and potential density. However, traditional coordinate transform requires a one-to-one relation between z-coordinate and isentropic/isopycnal surfaces. This can not be ensured in nonhydrostatic regions (heavier fluid is laid over lighter fluid). The adiabatic sorting process used here eliminates such constraint. For example, after the sorting in the vertical plane, the fluid will be completely stably stratified.

Basically, this package is usually used to accomplish the following tasks:

The calculations mostly take advantages of xarray's functionalities rather than writing explicit loops or algorithms, including contour-coordinate expansion, conditional accumulation or integration, coordinate transform and interpolation... One would see that xarray 1) supports multi-dimensional calculations, 2) simplifies a great deal of work in programming the very details, and 3) applies to different cases in a unified fashion.


2. How to install

Requirements xcontour is developed under the environment with numpy (=version 1.15.4), xarray (=version 0.15.1), xgcm(=version 0.5.2), and xhistogram(=version 0.3.0). Older versions of these packages are not well tested.

Install from github

git clone https://github.com/miniufo/xcontour.git

3. Examples

3.1 calculate effective diffusivity in the atmosphere

effective diffusivity

Here is a complete notebook example on Nakamura's effective diffusivity.

3.2 calculate local wave activiy in the atmosphere

local wave activity density

Here is a complete notebook example on local wave activity.

3.3 calculate local APE density in the ocean

local APE density

Here is a complete notebook example on local APE.

3.4 calculate tracer contour length in the ocean

contour length

Here is a complete notebook example on contour length.

About

diagnostic analyses and calculations in contour-based coordinates

License:MIT License


Languages

Language:Jupyter Notebook 96.4%Language:Python 3.6%