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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trefoil-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ced50d6d30469939bdd9a0e4684ec140da234d9ac3ca9dc1352ce2985e847154
MD5 27e406ad11648d9eb14cfe54b99bb268
BLAKE2b-256 bbaa30ce78eb62e41bbe26ddbb030682e01657efe94fbfddd5532913f685ece4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trefoil-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed3ff9be4aa2f37bd71888cb49b63d062a50c8c6c955572430cf0438f4a0d909
MD5 ecb29063ccdd45e5584feaff9ff9394a
BLAKE2b-256 2e334495fe63da205af6937d20223a363db78f5b9688d9517044b69de65571bf

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