Skip to main content

Python xweights contains functionsto create grid weighted area means

Project description

xweights

https://github.com/ludwiglierhammer/xweights/actions/workflows/ci.yml/badge.svg https://codecov.io/gh/ludwiglierhammer/xweights/branch/main/graph/badge.svg https://img.shields.io/pypi/v/xweights.svg Documentation Status pre-commit.ci status

Python “xweights” contains functions to calculate grid weighted area means from predefined regions or from an user-given shapefile. This tool is a wrapper around the python package xesmf https://xesmf.readthedocs.io

Features

  • Calculate grid-weighted-means and save the output as CSV file

  • As input you can choose between files on disk and intake-esm catalogues. Xarray dataset input is under development.

  • Use all these features as an command-line tool too

Installation

Note: Before building xweights from source, you nedd first install cartopy by using conda:

conda install -c conda-forge cartopy

You can install the package directly with pip:

pip install xweights

If you want to contribute, I recommend cloning the repository and installing the package in development mode, e.g.

git clone https://github.com/ludwiglierhammer/xweights.git
cd xweights
pip install -e .

In additon you have to install xESMF using _Conda:

conda install -c conda-forge xesmf

This will install the package but you can still edit it and you don’t need the package in your PYTHONPATH

Requirements

  • python3.6 or higher

  • numpy

  • pandas

  • geopandas

  • intake-esm

  • xarray

  • py-cordex

  • xesmf

Contact

In cases of any problems, needs or wishes do not hesitate to contact:

ludwig.lierhammer@hereon.de

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2022-03-04)

  • First release on PyPI.

0.1.1 (2022-07-01)

  • adjusted to pre-commit

  • use functions from pyhomogenize

0.1.2 (2022-07-08)

  • change pyhomogenize version requirements

0.2.0 (2022-07-11)

  • rename spatial_averager

  • keep geometry attributes

0.2.1 (2022-07-11)

  • read and write column name to attributes

0.2.2 (2022-07-12)

  • add data and tables via pip install

0.2.3 (2023-01-26)

  • remove cartopy from requirements.txt

0.2.4 (2023-03-13)

  • using pycordex >= 0.5.1

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

xweights-0.2.4.tar.gz (10.0 MB view details)

Uploaded Source

Built Distribution

xweights-0.2.4-py3-none-any.whl (10.0 MB view details)

Uploaded Python 3

File details

Details for the file xweights-0.2.4.tar.gz.

File metadata

  • Download URL: xweights-0.2.4.tar.gz
  • Upload date:
  • Size: 10.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for xweights-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8a6309d439273dedc9a2f5e68f8fe63e60e839663798d6ed5655ec9c5112e619
MD5 a59caafc8aafd8786c469ec9a41cd155
BLAKE2b-256 ad7fcc0b137e83293f231d62ee1a98e8db8c90ebea0b1c8bf3b79583e540ffd8

See more details on using hashes here.

Provenance

File details

Details for the file xweights-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: xweights-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for xweights-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b86a33567db438a062baeb9795cfafa9bf63c3219be4c6bf33c59f59b8fa86c0
MD5 7178f705b24f8abc88dc6d8f85257edd
BLAKE2b-256 ab34d564be1ef5ec5b2fba7ae13ba4986a6b11b5b3b1404ca58659cbb86fcf1d

See more details on using hashes here.

Provenance

Supported by

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