sitsfeats.py ⌛
Python package for extracting metrics from satellite image time series.
Installation
The package builds from source with no system dependencies. The C++ extension uses nanobind and the header-only Eigen library, both resolved automatically at build time:
pip install sitsfeats
Usage
The sitsfeats.py package is designed for simplicity. It is simple to get started with it. Here's a quick example:
from sitsfeats import feats
# Each row of the input array is a time-series
result = feats(your_numpy_data, ['median', 'skew'])
result.names
#> ['median', 'skew']
# A stacked (n_series, n_metrics) array; column j is result.names[j]
result.data
#> array([[ 5.5850e+03, -8.2705e-01],
#> [ 5.0490e+03, 3.9131e-02],
#> [ 6.6015e+03, -3.6274e-01],
#> [ 6.0470e+03, -3.0612e-01],
#> [ 4.6960e+03, 3.4300e-01]])
# Or a {name: column} mapping.
result.to_dict()
Working with data cubes (xarray)
The feats function also supports xarray data as input. To use this feature, first install the xarray dependencies:
pip install sitsfeats[xarray]
Then, you can use the xarray data as input:
from sitsfeats import feats
# cube: an xarray.DataArray with dims like (time, y, x)
features = feats(cube, ["mean", "skew", "iqr"], dim="time")
# A Dataset with one variable per metric, each shaped (y, x)
features["skew"]
To learn more, work through the step-by-step jupytext tutorials in the examples directory (ts-numpy.py for arrays and ts-xarray.py for data cubes - run them as scripts or open them as notebooks). Check also the documentation.
Metrics available
To see the metrics available in sitsfeats.py, it is possible to use the command metrics:
from sitsfeats import metrics
metrics() # all metrics
metrics(group="polar") # just one family
# name group description
# abs_sum basic Sum of absolute values
# amd basic Mean absolute first difference
# amplitude basic Range (max - min)
# ...
# area_ts polar Area of the polar-plot polygon
# polar_balance polar Std-dev of the four quadrant areas
Development
The project uses uv. After cloning:
uv sync # builds the C++ extension and installs dev tools
uv run pytest # run the test suite
uvx ruff check . # lint
uv run mkdocs serve # preview the docs
Contributing
We welcome contributions! If you have suggestions for improvements or bug fixes, please feel free to fork the repository and submit a pull request.
Acknowledgments
We would like to thank the developers and contributors of the sitsfeats (R) and stmetrics for their work that is the basis of this package.
License
sitsfeats.py is distributed under the MIT license. See LICENSE for more details.
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 sitsfeats-0.2.0.tar.gz.
File metadata
- Download URL: sitsfeats-0.2.0.tar.gz
- Upload date:
- Size: 153.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da9dc484f4dccdc262db5964089504ad53a9cdffd0bd675055974e446c555241
|
|
| MD5 |
27f498b83d093b6184d70830865fd7e6
|
|
| BLAKE2b-256 |
46df3c496005050018fddd21b258d2bb2a0859daab46808a2f71f8800216f62a
|
File details
Details for the file sitsfeats-0.2.0-cp313-cp313-macosx_26_0_arm64.whl.
File metadata
- Download URL: sitsfeats-0.2.0-cp313-cp313-macosx_26_0_arm64.whl
- Upload date:
- Size: 70.4 kB
- Tags: CPython 3.13, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdb03fbdbe46e8e4a5ecd24e6b1fe157e2aeb3e7a8c4a9d6137e32e4abe7af1a
|
|
| MD5 |
965696b984ef4a324c5d0a4c629503da
|
|
| BLAKE2b-256 |
8090e7b94e869d46cea34010d3439259665cb919ce4ffcba6979b7d42daf871f
|