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)

0.2.6 (2023-08-30)

  • optionally: wite variable attributes to dataframe

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xweights-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 80299634442928830579e276466b3d4c48c88949ba08fabf50627566481bb47e
MD5 a199b970162b30d6ffb46fde72a07bda
BLAKE2b-256 0d87464fce802fd0d00590b9bc7254b9b87153e2dc3f844ad135fe8d5fabdf29

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xweights-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0e1f914e1788d3fd2a9375690229f8ead2985693e03f0bc7083734b079a2068b
MD5 bcb64e5e6d7bb3d04c2b623f1158f4bc
BLAKE2b-256 023138e4b1351c9ae90f8c9d52b7729c920d9cc1b91dc216ffccf004f2481d3f

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