CTrees toolkit for geospatial analysis and forest carbon monitoring. Core features include xarray-based analysis tools.
Project description
CTrees Tools - Beta Version
CTreesKit is a public package used split into two sections, "arraylake_tools" which allows a simplified way of converting from geotiffs -> zarr format and saving the data into arraylake (by Earthmover). "xr_analyzer" is a small wrapper for xarray functions used for zonal stats that use the arraylake datasource as the input. These can also be used with Earthmover's opensource icechunk format as well! Tutorials to come in May 2025 with additional functionality. Slide Deck for CNG Conference about this pip package
Open Source Components (ctreeskit-core)
Current:
pip install git+https://github.com/ctrees-products/ctreeskit.git
(( Future -> To Be Implemented June 2025))
pip install ctreeskit
Quick Links
Table of Contents
Installation
You can install ctreeskit either from PyPI or directly from GitHub:
From PyPI
pip install ctreeskit
From GitHub
pip install git+https://github.com/ctrees-products/ctreeskit.git
Development Installation
For development, you can install with all dependencies:
# Clone the repository
git clone https://github.com/ctrees-products/ctreeskit.git
cd ctreeskit
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On macOS/Linux
# Install in editable mode with all dependencies
pip install -e ".[all]"
Dependencies
- xarray
- rioxarray (for spatial operations)
- numpy
- shapely
- pyproj
- s3fs (for Amazon S3 storage access)
- python > 3.11
Testing
To run the tests for the ctreeskit package, navigate to the project directory and execute:
pytest -m tests
Contributing
Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bug fixes.
Features
- Spatial processing with xarray DataArrays
- Area calculations and geometry data
- Arraylake Ingestion tools
A Python module for efficient geospatial operations on raster data using xarray, with support for integrating vector geometries and calculating areas.
API Reference
XrSpatialProcessor
This module provides tools to:
- Process geospatial vector data (from files or objects) into standardized geometry containers
- Clip rasters to geometries or bounding boxes
- Align and resample rasters to match reference grids
- Calculate accurate cell areas for geographic rasters
- Create weighted masks based on geometry-pixel intersections
XrZonalStats
This module provides tools to:
- Calculate area statistics for different classes in categorical rasters
- Calculate area statistics for a combination of two categorical rasters combined
- Support both time-series and static (non-temporal) raster data
- Offer flexible area calculation options (pixel counts, constant values, or spatially-variable areas)
- Generate tabular summaries as pandas DataFrames
ArraylakeTools
This module provides tools to:
- Calculate area statistics for different classes in categorical rasters
- Support both time-series and static (non-temporal) raster data
- Offer flexible area calculation options (pixel counts, constant values, or spatially-variable areas)
- Generate tabular summaries as pandas DataFrames
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ctreeskit-0.1.2.tar.gz.
File metadata
- Download URL: ctreeskit-0.1.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e92347574284a2cba1dcfd2c51b238114c033da734f2d9c0891492e13f84f7
|
|
| MD5 |
3dd8805b1537b53bee289e933c285086
|
|
| BLAKE2b-256 |
43590a8017a07a7bc948cf7869a229550303cb530443d216bd8ca54e1648129d
|
File details
Details for the file ctreeskit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ctreeskit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 34.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c3457bd9ba3eaa424d55b079e8b2d5e46461733df29d65b4ccde2a1666ea4ca
|
|
| MD5 |
4e24ce866e353897a12e8adedd272156
|
|
| BLAKE2b-256 |
359412c473a429973f02320d0c66a8f33dc5a88883988c872a5807cf83f6051e
|