API Reference¶
Every public function and class, with its signature, parameters and an example. Signatures on these pages are generated from the code, so they always match the installed version.
How to import
import zeit gives you the most used functions at the top level (zeit.landtrendr, zeit.save_raster, …) and registers the .zeit xarray accessor. Everything else lives in submodules (zeit.twdtw, zeit.segmentation, zeit.ai, …), shown in each signature.
-
STAC and Earth Engine cubes, local files, compositing, GeoTIFF I/O, QA weights.
-
TESSERA and AlphaEarth yearly embeddings as cubes; similarity search; change from year to year.
-
Tmask cloud masking, Whittaker and Savitzky-Golay smoothing, spike removal.
-
LandTrendr, CCDC, BFAST, BFAST Monitor, BFAST Lite, CODED, event extraction and agreement.
-
Mann-Kendall trends, phenology, TWDTW, SNIC segmentation, SOM clustering.
-
Spatial filters, CCDC classification, water masks.
-
Stratified samples, labelling points by eye, accuracies and error-adjusted areas with confidence intervals.
-
zeit.plot: a fast time-series viewer, pixel inspector, basemaps and static figures. -
TempCNN, LightTAE, U-TAE, Siamese and foundation models; datasets and losses.
-
DataArray.zeit.*: every algorithm on lazy Dask cubes, and Zarr output. -
A folder of tiles on this computer and on others of the local network, resumable.
-
The core algorithms as
zeitsubcommands, for scripts and HPC jobs.
All functions¶
| Function | What it does |
|---|---|
| Data & I/O | |
build_time_series |
Lazy cube from a STAC catalog |
build_annual_composites |
Cloud-masked annual composites from a STAC catalog (LandTrendr input) |
download_gee_timeseries |
Harmonised Landsat composites from Earth Engine |
download_gee_image / resolve_roi |
Download any ee.Image; turn tile ids, files or boxes into an area |
regularize_time_series |
Median or medoid composites at a fixed step |
load_raster / save_raster |
Read any time series as a georeferenced cube / write GeoTIFFs |
get_georef |
CRS and transform of a raster or cube |
qc_sentinel2_scl, qc_modis_summary, qc_modis_state |
QA bands to observation weights |
| Embeddings | |
load_embeddings |
TESSERA or AlphaEarth embeddings of a region as a (time, band, y, x) cube |
similarity |
Where (and when) pixels look like reference samples |
embedding_change |
How far each pixel's embedding moved from year to year (events with extract_events) |
| Pre-processing | |
bandpass_adjust |
Sentinel-2 (and Landsat 5/7) on Landsat 8's bands: HLS's bandpass step, for L2A cubes (HLS itself: build_time_series) |
tmask |
Time-series cloud and shadow detection of a cube |
smooth |
Whittaker (uneven dates, gaps, weights) or Savitzky-Golay smoothing of a cube or series |
unmix |
Fractions of green vegetation, NPV, soil, shade, cloud; the NDFI |
desawtooth |
LandTrendr spike removal |
| Change detection | |
landtrendr |
LandTrendr on a file, cube, array or single pixel |
extract_events |
One event per pixel, the same maps for every change algorithm (and for embedding change) |
agreement |
Where and when several change maps agree |
apply_vertices |
Fit another band to the same vertices |
ccdc |
CCDC on a file, cube, array or single pixel |
predict_synthetic_image |
Evaluate CCDC models on any date |
bfast_monitor |
Near-real-time monitoring, on a file, cube, array or single pixel |
bfast_lite |
Optimal multiple breakpoints |
bfast |
Trend and seasonal breaks |
coded |
Forest degradation and deforestation from the NDFI (CODED) |
| Time-series analysis | |
mann_kendall |
Trend test and Theil-Sen slope |
phenology |
19 phenology metrics per year or season |
twdtw |
Classification by time-weighted DTW, on a file, cube or single pixel |
snic / snic_to_polygons / snic_grid |
Superpixel segmentation of a map or cube, and its polygons |
som |
Self-organizing map clusters of a map or cube, with each neuron's prototype |
clean_samples |
Flag labelled samples whose class is not their SOM neuron's |
SOM |
The SOM engine, online and batch (bit-exact minisom port) |
| Post-processing | |
apply_mmu_filter |
Remove patches below a minimum size |
apply_majority_filter / apply_bayesian_filter |
Smooth class maps |
train_classifier / classify |
Train at sample points, classify any cube, metrics or CCDC models |
extract_water_mask |
Water mask from CCDC |
| Validation | |
sampling_design |
Sample size and allocation per stratum (Olofsson et al. 2014) |
stratified_sample |
Stratified random points of a map |
interpret |
Label reference points by eye: chips, series, keyboard, review |
accuracy |
Accuracies and error-adjusted areas with confidence intervals |
| Visualisation | |
plot |
Any cube, map, result or pixel: interactive viewer in a notebook or window, or a matplotlib figure |
Deep learning (zeit.ai) |
|
ai.samples, ai.train, ai.predict |
From a cube and labelled samples to a map with a deep learning model |
ai.save, ai.load |
Keep a trained model with what prediction checks |
TempCNN, LightTAE, LTAE |
Pixel time-series classifiers |
UTAE |
Spatio-temporal patch segmentation |
SiameseChangeDetector |
Two-date change detection |
GeoFoundationViT |
Foundation-model fine-tuning |
STACCubeDataset |
Windows that cover a lazy cube, for a loop of your own |
FocalLoss, TverskyLoss, ContrastiveSiameseLoss |
Losses for imbalanced data |
| Many tiles & helpers | |
run_tiles |
A command on every tile of a folder, here and on helpers; resumes where it stopped |
run_worker |
Lend this computer to the group: wait for tiles and process them |
invite_helpers |
A code with which other computers join the group |
tile_urls, stac_tiles, gee_tiles |
Tiles each computer downloads or builds for itself |