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.1.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: trefoil-0.3.1.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

File hashes

Hashes for trefoil-0.3.1.tar.gz
Algorithm Hash digest
SHA256 483375fece52a5abdb119cc2cb09ddb4bc7e89ffd59d656fdf08f15edb8ec001
MD5 7902289f932ddd19a83aa4f265af5376
BLAKE2b-256 348e750b3782440c13e930638b65dc0c9ae7cc002ed5db27c4c521bec66075bc

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: trefoil-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 74.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

File hashes

Hashes for trefoil-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f0966dbf422cf374814aa811091d8f23c8e698b7565e72a227bd42fc0bed46a0
MD5 7dd58675710a13b942798b1ec6dbc6f0
BLAKE2b-256 230f27a01538889411ea2114b9603573a79ee88d78a8e261fa7c785b36ef3fa4

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