Skip to main content

PyPI version Supported Python versions License Code Style Black

Coverage Vulnerabilities Bugs Lines of Code Duplicated Lines (%) Code Smells Security Rating Maintainability Rating

pyELQ

This repository contains the Python Emission Localization and Quantification software we call pyELQ. It is code used for gas dispersion modelling, in particular methane emissions detection, localization and quantification.


Background

The python Emission Localization and Quantification (pyELQ) code aims to maximize effective use of existing measurement data, especially from continuous monitoring solutions. The code has been developed to detect, localize, and quantify methane emissions from concentration and wind measurements. It can be used in combination with point or beam sensors that are placed strategically on an area of interest.

The algorithms in the pyELQ code are based a Bayesian statistics framework. pyELQ can ingest long-term concentration and wind data, and it performs an inversion to predict the likely strengths and locations of persistent methane sources. The goal is to arrive at a plausible estimate of methane emissions from an area of interest that matches the measured data. The predictions from pyELQ come with uncertainty ranges that are representative of probability density functions sampled by a Markov Chain Monte Carlo method. Time series of varying length can be processed by pyELQ: in general, the Bayesian inversion leads to a more constrained solution if more high-precision measurement data is available. We have tested our code under controlled conditions as well as in operating oil and gas facilities.

The information on the strength and the approximate location of methane emission sources provided by pyELQ can help operators with more efficient identification and quantification of (unexpected) methane sources, in order to start appropriate mitigating actions accordingly. The pyELQ code is being made available in an open-source environment, to support various assets in their quest to reduce methane emissions.

Use cases where the pyELQ code has been applied are described in the following papers:

  • IJzermans, R., Jones, M., Weidmann, D. et al. "Long-term continuous monitoring of methane emissions at an oil and gas facility using a multi-open-path laser dispersion spectrometer." Sci Rep 14, 623 (2024). (https://doi.org/10.1038/s41598-023-50081-9)

  • Weidmann, D., Hirst, B. et al. "Locating and Quantifying Methane Emissions by Inverse Analysis of Path-Integrated Concentration Data Using a Markov-Chain Monte Carlo Approach." ACS Earth and Space Chemistry 2022 6 (9), 2190-2198 (https://doi.org/10.1021/acsearthspacechem.2c00093)

Deployment design

The pyELQ code needs high-quality methane concentration and wind data to be able to provide reliable output on location and quantification of methane emission sources. This requires methane concentration sensors of sufficiently high precision in a layout that allows the detection of relevant methane emission sources, in combination with wind measurements of high enough frequency and accuracy. The optimal sensor layout typically depends on the prevailing meteorological conditions at the site of interest and requires multiple concentration sensors to cover the site under different wind directions.

pyELQ data interpretation

The results from pyELQ come with uncertainty ranges that are representative of probability density functions sampled by a Markov Chain Monte Carlo method. One should take these uncertainty ranges into account when interpreting the pyELQ output data. Remember that absence of evidence for methane emissions does not always imply evidence for absence of methane emissions; for instance, when meteorological conditions are such that there is no sensor downwind of a methane source during the selected monitoring period, then it will be impossible to detect, localize and quantify this particular source. Also, there are limitations to the forward dispersion model which is used in the analysis. For example, the performance of the Gaussian plume dispersion model will degrade at lower wind speeds. Therefore, careful interpretation of the data is always required.


Installing pyELQ as a package

Suppose you want to use this pyELQ package in a different project. You can install it from PyPi through pip pip install pyelq. Or you could clone the repository and install it from the source code. After activating the environment you want to install pyELQ in, open a terminal, move to the main pyELQ folder where pyproject.toml is located and run pip install ., optionally you can pass the -e flag is for editable mode. All the main options, info and settings for the package are found in the pyproject.toml file which sits in this repo as well.


Examples

For some examples on how to use this package please check out these Examples


Contribution

This project welcomes contributions and suggestions. If you have a suggestion that would make this better you can simply open an issue with a relevant title. Don't forget to give the project a star! Thanks again!

Contributor setup with uv

This repository now uses uv for contributor environment management.

  1. Install uv by following the official instructions.
  2. From the repository root (where pyproject.toml is located), create and sync the environment with contributor tools:
uv sync --group contributor --group dev
  1. Run commands in the project environment using uv:
uv run pytest .
uv run black . --check
uv run isort . --check
uv run pydocstyle .
uv run pylint src/

For more details on contributing to this repository, see the Contributing guide.


Licensing

Distributed under the Apache License Version 2.0. See the license file for more information.

Download files

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

Source Distribution

pyelq-1.2.7.tar.gz (135.2 kB view details)

Uploaded Source

Built Distribution

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

pyelq-1.2.7-py3-none-any.whl (115.0 kB view details)

Uploaded Python 3

File details

Details for the file pyelq-1.2.7.tar.gz.

File metadata

  • Download URL: pyelq-1.2.7.tar.gz
  • Upload date:
  • Size: 135.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for pyelq-1.2.7.tar.gz
Algorithm Hash digest
SHA256 9cfaacef20d2632abfd9968abebd0cc73fd760f8a4c9917228909bd3e63e8b15
MD5 6140cc0eff54bf581eca37c6499d381e
BLAKE2b-256 b3f1c03a15fb158661df12faf86b6e3d817ddddb7427bb6a66dcfecf44efe2d3

See more details on using hashes here.

File details

Details for the file pyelq-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: pyelq-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 115.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for pyelq-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6e0414c9d9f97606821a7f2483b42ee8a0733f7a6e890549670b364a0ccd9f1d
MD5 09dae3d9a18d6b0c7b0f0826382be5ad
BLAKE2b-256 c1a006b399fb8dc404b81212392c40c94b36a72cfc4e130601524372de8aabbc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

Supported by

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