Coupling Metrics Toolkit (CoMeT)
Calculate various state-of-the-art land-atmosphere coupling metrics
Free software: MIT license
Installation
pip install coupling-metrics
You can also install the in-development version with:
pip install https://github.com/abtawfik/coupling-metrics/archive/master.zip
Documentation
To use CoMeT either on the command-line or in your python code check out the docs.
Example Usage
There are two ways to use CoMeT after installation. Using the python API or on the command-line. See both uses below.
CLI Example
Say you are trying to compute the terrestrial coupling index for NARR data (North American Regional Reanalysis) between latent heat flux and soil moisture for a single year. You invoke this one the command-line:
comet coupling --xname=soilm --yname=lhtfl --averaging=season --outname=NARR_lhf_vs_soilm_2017.nc lhtfl.2017.nc soilm.2017.nc
Be mindful of memory in this case because currently all the data need to be loaded into memory. This might change in the future.
If you want to see a list of metrics:
comet --help
To see the arguments for a list of metrics:
comet mixing --help
Python API
Each metric can also be called directly from python.
import comet as cm
import xarray as xr
from glob import glob
# Load data using xarray
latent_heat_files = glob('lhtfl.????.nc')
soilm_files = glob('soilm.????.nc')
ds = xr.open_mfdataset(latent_heat_files + soilm_files)
# Compute coupling index
terra_coupling = cm.CouplingIndex()
terra_coupling = terra_coupling.compute(ds, xname='soilm', yname='lhtfl', averaging='month')
# Output it to a file (may take a while depending on how much data is being processed)
terra_coupling.to_netcdf('My_new_NARR_Terra_coupling_lhf_vs_soilm.nc')
To see a list of metrics
import comet as cm print(cm.list_metrics)
When to Use CoMeT?
The metrics are meant to facilitate use of the most common land-atmosphere coupling metrics for research purposes.
List of available metrics
1. Convective Triggering Potential (aka CTP-HiLow or just CTP) Evaluates morning atmospheric profiles to determine whether dry or wet soils are more likely to trigger convection
2. Mixing Diagrams Uses the diurnal covariation of temperature and humidity to quantify heat and moisture fluxes into the planetary boundary layer
3. Terrestrial Coupling Index (aka terrestrial coupling parameter) Quantifies the degree to which soil moisture variations control changes in surface energy fluxes. Can be latent or sensible heat flux and is generally enough to apply to other surface variables such as the relationship between LAI and sensible heat flux.
4. Heated Condensation Framework Assesses the atmospheric background state with respect to convective initiation and identifies local versus non-locally triggered moist convection.
5. Relative Humidity Tendency Returns the contribution of surface energy fluxes, dry air entrainment, heat entrainment, and boundary layer growth to changes in top of boundary layer relative humidity.
6. Soil Moisture Memory (the statisitcal form) Determines the timescale at which initial soil moisture anomalies are retained over time. The lagged autocorrelation of soil moisture is used to make the determination of memory.
Development
To run the all tests run:
tox
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
|---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Changelog
1.0.0 (2020-01-10)
First release on PyPI.
Metadata
Release files for coupling-metrics 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| coupling-metrics-1.0.0.tar.gz | 38.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coupling_metrics-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 73.9 kB
Release files / coupling-metrics-1.0.0.tar.gz
| Download URL | coupling-metrics-1.0.0.tar.gz |
|---|---|
| Size | 38.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e267e83cad2dae810eeeaee547eebb787a2311304df307e12d9b952ede4fe9a6
|
|
BLAKE2b-256 checksum How to use checksums |
ba524a75ed2db473eb6746af40511c2fc18d4eafb33a5d341e10b59177291168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
|
Release files / coupling_metrics-1.0.0-py2.py3-none-any.whl
| Download URL | coupling_metrics-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 35.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4d76a904979281f0dc73efe73334b64281979a6732a86e39c1baa629d7411b02
|
|
BLAKE2b-256 checksum How to use checksums |
acbf1956bc47a800a43093b8e9ec05ee0cebbea762ed6a9fcfc992dd2e97a0d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
|
Security for coupling-metrics 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.