Skip to main content

Geospatial operations with NetCDF files and numpy arrays.

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

Trefoil is available on PyPi. To install, use:

$ pip install trefoil

Development

Poetry is used for managing dependencies in this project. To develop this project, install its dependencies with:

$ poetry install

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trefoil-0.4.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trefoil-0.4.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.11.0-1015-azure

File hashes

Hashes for trefoil-0.4.0.tar.gz
Algorithm Hash digest
SHA256 19eca8984eabb1d126bb3b8aa2c3432c2ebe6d3c4fec5bf3d5b48e4456c5d227
MD5 bd45919afd618e3831c84f7952576bd5
BLAKE2b-256 e0345293871d754213dce682f39fc798bfe30e5eeb08f1f57694075398aa20fd

See more details on using hashes here.

File details

Details for the file trefoil-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: trefoil-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.11.0-1015-azure

File hashes

Hashes for trefoil-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cecedf8746911ee5efc48838c572c5dbfa5c5ec0349b0e1016cebb2b0d3bcd1d
MD5 3390c3001ef5fa4dbc9b90a88565c4f4
BLAKE2b-256 0e91ded004c3b37ecd1a581bfef88a8ebe66a723261e70baf9aca68c2912b5ea

See more details on using hashes here.

Supported by

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