Skip to main content

Useful tools for spatial analysis using numpy and NetCDF

Project description

Trefoil (formerly Clover)

Because today might be your lucky day.

**(note: this was renamed from clover on 4/20/2018 due to name conflicts on pypi)

Geospatial operations with NetCDF files and numpy arrays.

Build Status Coverage Status

Why?

We needed a library to consolidate a series of utility scripts and general geospatial operations on NetCDF and numpy arrays. We found we were creating a lot of purpose built scripts for other projects involving lots of processing of NetCDF climate and model outputs. Where possible, we have been pulling out general patterns and placing them here. When we looked for existing work, we didn't find anything that quite met our needs, with a clean API and no strong assertions about data model or compliance with CF-conventions (we aspire to conventions, but not all data meet them).

Specifically, we want to provide:

  • simple and fast API for rendering numpy arrays to images
  • simple API to provide utility functions that make working with NetCDF data easier
  • simple command line interface to make common operations easy and portable
  • analysis operations to simplify using geometries alongside raster data
  • analysis operations to summarize across various dimensions of spatial and temporal-spatial datasets (anything more than 3 dimensions makes our heads hurt!)

We are trying to avoid reimplementing anything well-handled elsewhere. Where possible, we contribute functionality to other libraries (e.g., rasterio) where we think that the functionality is general enough not to depend on living within trefoil.

Where is it being used?

This is a core dependency for ncdjango, our Django-based NetCDF map server.

We are using this on a variety of internal projects within the Conservation Biology Institute.

Installation

pipenv is used for managing dependencies in this project.

pipenv install trefoil

No longer directly maintained / supported:

On Windows, install the ones that require compiling from Python Windows Packages. Then install the remainder using pip

Command line interface

This is currently undergoing heavy development.
See CLI docs for more information.

Work in progress

This is still under active development, as we have time and need. All APIs are subject to change until we hit version 1.0.

Specifically, we need to work on:

  • standardizing API patterns
  • documentation
  • test coverage and correctness
  • roadmap

Contributors:

With inspiration from Tim Sheehan and Ken Ferschweiler.

See Also:

  • rasterio: Geospatial I/O and operations on rasters, done right.
  • OCGIS: Geoprocessing on CF compatible climate datasets.
  • scikit-image: Python image processing
  • python-rasterstats: Summary statistics of rasters using geometries

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

trefoil-0.3.2.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

trefoil-0.3.2-py2.py3-none-any.whl (74.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file trefoil-0.3.2.tar.gz.

File metadata

  • Download URL: trefoil-0.3.2.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.4

File hashes

Hashes for trefoil-0.3.2.tar.gz
Algorithm Hash digest
SHA256 db4d484cb7d425400459d9157aaac7c696deaa8a00194a168bf992d9d3b7e5ca
MD5 45e34dbb5e679a9ebb4302e21ebca31f
BLAKE2b-256 7de66d41d3fffe091fd6b5c1d9e3f3a640cac1897332714bc33142cb70c6928e

See more details on using hashes here.

File details

Details for the file trefoil-0.3.2-py2.py3-none-any.whl.

File metadata

  • Download URL: trefoil-0.3.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 74.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.4

File hashes

Hashes for trefoil-0.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8a009d5b473559c6d6385fa8752a54675d1fe9194b13501fe6d0c98d6cb60afe
MD5 61e507bce62ef0c8d5e5045ccb1d349f
BLAKE2b-256 d1e4e3a7734bd5c9998cd7f8137066f145315d80d540f38af9a750450fa8b57f

See more details on using hashes here.

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