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.
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.
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.
pipenv is used for managing dependencies in this project.
pipenv install trefoil
On Windows, install the ones that require compiling from Python Windows Packages.
Then install the remainder using pip
This is currently undergoing heavy development.
See CLI docs for more information.
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
With inspiration from Tim Sheehan and Ken Ferschweiler.
- 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