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
Metadata
Release files for ctreeskit 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ctreeskit-0.1.2.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ctreeskit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.4 kB
Release files / ctreeskit-0.1.2.tar.gz
| Download URL | ctreeskit-0.1.2.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8e92347574284a2cba1dcfd2c51b238114c033da734f2d9c0891492e13f84f7
|
|
BLAKE2b-256 checksum How to use checksums |
43590a8017a07a7bc948cf7869a229550303cb530443d216bd8ca54e1648129d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / ctreeskit-0.1.2-py3-none-any.whl
| Download URL | ctreeskit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 34.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c3457bd9ba3eaa424d55b079e8b2d5e46461733df29d65b4ccde2a1666ea4ca
|
|
BLAKE2b-256 checksum How to use checksums |
359412c473a429973f02320d0c66a8f33dc5a88883988c872a5807cf83f6051e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|