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

0.2.5 (2023-08-23)

  • adding new region: counties_merged (merge counties less than 400m2)

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.5.tar.gz (10.0 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xweights-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 b4f558f3aa1f2e685f12cb41482aca980f12dbc74213fe425f456e6b1a1b6ae3
MD5 03da1aefd716616f3c1c36b35c911e27
BLAKE2b-256 be9a93075ed9a4d1d66d9ddc8e3dbde1e2e4872e760a62010c6f7e33f619d6cb

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xweights-0.2.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ea011641ce2ec6fd939ac7c994609763c85a988df9dd964f6cadac4127eb5a98
MD5 372605a2c8e26e998197edddc6552852
BLAKE2b-256 48c9eb89a51aafbdfdb75ec26289981a00393616318891fe00a5a8664bb4d313

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