Skip to main content

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

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.3.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.3-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trefoil-0.4.3.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

File hashes

Hashes for trefoil-0.4.3.tar.gz
Algorithm Hash digest
SHA256 6e0a7d3d07d678e86da05fb2c82ff4f00619ead461de14a5e167438e94645e2f
MD5 0e06895fa025173ad58d20aa1e1957c8
BLAKE2b-256 b909be5a7392865aa23eaa06d07c3775d1f6a27c221394339ec264d0a7e762e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trefoil-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

File hashes

Hashes for trefoil-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d88c739eb8e9df121c6747c7a554030298b9536135197d013ecbff9e66f1f26c
MD5 b9bc4484d3e7c6303c1aac48a2fdda46
BLAKE2b-256 1e098eee0dd1f04299522f679d5424e79c53287397189e9f1a837610e27e7cff

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1.1

2 files

0.3.1

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page