Skip to main content

A package to calculate gas emissions fluxes from natural and anthropogenic sources

Project description

License: AGPL v3 Tests linting - Ruff format - Black types - mypy

GasFlux

pip install gasflux
gasflux --help

GasFlux is a tool for processing atmospheric gas concentration data and windspeeds into mass emissions fluxes, with principle applications to greenhouse gas measurement and vulcanology. Currently it works with in situ ("sniffing") data from UAVs and other aircraft, using mass balance as a paradigm and kriging as an interpolation strategy, but the intention is to expand this to other kinds of sampling and processing strategies, such as open-path and tracer methods.

It is released under the AGPLv3 license as a free and open-source project - comments, pull requests, issues and co-development are warmly welcomed. Currently development is co-ordinated by Jamie McQuilkin (@pipari) at the UAV Greenhouse Gas group at the University of Manchester.

User Installation

The package is available on PyPi and can be installed using pip install gasflux.

Usage

The package interface is in active development. Currently it ingests a data csv file (or folder containing only data csv files) and a config file that dictates the parameters of the analysis.

This is done through the syntax gasflux process <input_file> --config <config_file>.

The config file

The default gasflux_config.yaml is located in the package source. It can be generated in a supplied directory using gasflux generate-config <path>. If a directory is supplied to gasflux process and a config is not also explicitly supplied, the package will look for one config file in that directory or its subdirectories and attempt to process all csv files in that directory and subdirectories. If multiple or no config is found, it will raise an error. If supplying a single csv file for processing (rather than a directory), only the parent directory will be searched for config files (not its subdirectories).

Through it, variables can be passed to the scikit-gstat package used for kriging and the pybaselines package used for background correction.

The data file

Input data files must be csv-type (i.e. readable by pandas) and have the following columns (all lower case):

  • timestamp (datetime)
  • latitude (float)
  • longitude (float)
  • height_ato (float) - height above takeoff
  • windspeed (float) - in m/s, as measured or inferred at each measurement point
  • winddir (float) - in standard 0-360 degree format, relative to the earth
  • temperature (float) in degrees celsius
  • pressure (float) - in hPa/mBar

At least one gas concentration in ppm is also required. The column name should be the gas name, e.g. co2, ch4, n2o, etc.

The gas should be entered in the gasflux_config.yaml file along with a range of concentrations in ppmv, e.g.:

gases:
  ch4: [1.5, 500]
  co2: [300, 5000]
  c2h6: [-0.5, 10]

Ensuring input data are sufficient and correctly formatted is non-trivial and important, but is left to the user. Data sources vary enormously so it is difficult to generalise this part of the analysis - in many cases these will be a mix of flight logs, GPS, one or more anemometers, one or more gas sensors, a thermometer, hygrometer, barometer.

Synchronisation and fusion of these data sources is important and should be given great attention - there are several ways to do this, including GPS logging on each sensor, recording everything on a single device, or NTP server synchronisation. Care should also be taken to avoid loss of data through resampling or interpolation.

One way to convert encoded DJI logs is to use djiparsetext, a C++ library available on github here and documented here.

Development

Installation

To install, clone the repository using e.g. git clone and use pip install -e . to install it as an editable python package.

It's highly recommended to use a virtual environment to manage dependencies. If you're not currently using one, virtualenvwrapper is a good option.

Then run pip install -r requirements.txt and pip install -r dev-requirements.txt to install the required dependencies.

User requirements.txt is generated using pigar generate rather than pip freeze.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gasflux-0.2.1rc1.tar.gz (291.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gasflux-0.2.1rc1-py3-none-any.whl (284.4 kB view details)

Uploaded Python 3

File details

Details for the file gasflux-0.2.1rc1.tar.gz.

File metadata

  • Download URL: gasflux-0.2.1rc1.tar.gz
  • Upload date:
  • Size: 291.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gasflux-0.2.1rc1.tar.gz
Algorithm Hash digest
SHA256 13024cd7fb5b4feb4bd3ab55cf5eaf20356e2d94cbff7eea1b78e8a30fe9f1f2
MD5 a3a815feaa74d6ee1624a2cf4ede75d8
BLAKE2b-256 afc78ce70fb6da6cb2c96d0b2c56658eae4afe041d0546cef2c6138b4bc954db

See more details on using hashes here.

Provenance

The following attestation bundles were made for gasflux-0.2.1rc1.tar.gz:

Publisher: deploy.yml on gasflux/gasflux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gasflux-0.2.1rc1-py3-none-any.whl.

File metadata

  • Download URL: gasflux-0.2.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 284.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gasflux-0.2.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee28576868cc62afe87d0c0c72038fee16c418fbea84a01f2f0b20f45a3c93e9
MD5 bd6a3434190f9df5c574507f339df7b2
BLAKE2b-256 f0504fec24a645a329349c6abc6659ef8aa8f48978c7d14d448b0db1a39b03aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for gasflux-0.2.1rc1-py3-none-any.whl:

Publisher: deploy.yml on gasflux/gasflux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page