Skip to content

Command Line Interface

Run the core algorithms on GeoTIFF stacks straight from the terminal, with no Python code. Useful for shell scripts, cron jobs and HPC schedulers. Each command reads and writes files block by block, so inputs can be larger than memory.

Basic Usage

The CLI is structured around subcommands for each algorithm. You can invoke the CLI using the zeit command (if installed via pip) or by executing the python module directly:

zeit <algorithm> [OPTIONS] <input_file> <output_directory>
(Alternatively: python -m zeit.cli <algorithm> ...)

To run a command on a whole folder of tiles, on this computer and on others of the local network, see Many tiles, on this and other computers.

To get general help or see the list of available commands:

zeit --help


1. LandTrendr (landtrendr)

The landtrendr command processes a multi-band GeoTIFF representing a time series of a single spectral index (e.g., NBR, NDVI) and extracts spatial change events.

Syntax

zeit landtrendr <input> <output_dir> [OPTIONS]

Positional Arguments

Argument Type Description
input filepath Path to the input multi-band GeoTIFF. Each band must represent a single year, in chronological order.
output_dir dirpath Directory where the resulting event maps (Year of Detection, Magnitude, Duration) will be saved.

Configuration Options

Option Type Default Description
--start-year int read from the file The calendar year of the first band. By default the years are read from the band descriptions (e.g. yr1985), as zeit.load_raster does; pass it for stacks whose bands are not named by year.
--max-segments int 6 The maximum number of line segments the algorithm can fit per pixel.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--chunk-size int 512 Size of the image chunks (in pixels) processed simultaneously to manage RAM.
--save-vertices flag False If provided, saves the raw multi-band GeoTIFF containing all fitted vertices.
--no-data-value float the raster's NoData, or 0 Value marking a missing year. By default the raster's NoData value, or 0 for integer stacks without one (how Earth Engine exports masked pixels). NaN is always missing.

Event Extraction Options

These options control how specific change events are extracted from the temporal trajectory:

Option Type Default Description
--event-type str loss Type of event to segment for and map. Choices: loss (value decreases) or gain (value increases). It sets both LandTrendr's direction and the events extracted.
--sort-by str greatest How to select the event if multiple occur. Choices: greatest, newest, fastest, longest, dsnr.
--min-mag float 0.0 Filter out events with a magnitude lower than this threshold.
--min-dur int 1 Filter out events shorter than this duration in years.
--pre-val-thresh float 0.0 Filter out events if the starting value was already below this threshold.
--output-scale float 1.0 Scale factor applied to the output. Useful for converting scaled integers back to floats (e.g., 0.0001).
--prefix str lt_event Prefix added to all output file names.

End-to-End Example

Run LandTrendr on a 30-year NBR stack, extracting the greatest vegetation loss, using every core but one, and converting the output back to floating point (assuming NBR was scaled by 10000):

zeit landtrendr ./data/nbr_stack_1990_2020.tif ./results \
    --start-year 1990 \
    --max-segments 6 \
    --event-type loss \
    --sort-by greatest \
    --output-scale 0.0001 \
    --jobs -1


2. Continuous Change Detection (ccdc)

The ccdc command runs zeit.ccdc on a dense, multi-band, multi-date GeoTIFF, reading it block by block, and writes each pixel's segments as GeoTIFFs. Values must be surface reflectance × 10,000, bands ordered Blue, Green, Red, NIR, SWIR1, SWIR2 [, thermal].

Syntax

zeit ccdc <input> <output_dir> [OPTIONS]

Positional Arguments

Argument Type Description
input filepath Path to the input GeoTIFF. Either its bands are named date_band (2020-01-15_blue, 2020-01-15_green, …, as zeit.save_raster writes a (time, band, y, x) cube), and the dates are read from them; or it is interleaved by date (Date1-Band1, Date1-Band2, …, Date2-Band1, …) without such names, with --dates-file and --num-bands.
output_dir dirpath Directory where the segment rasters will be saved.

Configuration Options

Option Type Default Description
--dates-file str None Text file with one date per line, an ISO date (2020-01-15) or a Python ordinal day (737439), for a stack without dates in its band names.
--num-bands int 6 With --dates-file: the number of bands per date in a stack interleaved by date, including the QA band.
--qa-band int -1 The zero-based index, among the bands of each date, of a band of Fmask codes (0 clear, 1 water, 2 shadow, 3 snow, 4 cloud, 255 no observation). It is not used as a spectral band. -1: no QA band, every observation is clear.
--max-segments int 6 The maximum number of segments to retain per pixel.
--conse int 6 Consecutive anomalous observations that confirm a break (conseq_anom), as in the original CCDC.
--chunk-size int 512 Size of the image blocks (in pixels) processed at once.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--cold flag False Deprecated: the same as --conse 6, now the default.
--prefix str ccdc Prefix added to all output GeoTIFF files.

Outputs

File Bands Content
<prefix>_t_start.tif, <prefix>_t_end.tif one per segment First and last date of each segment, as decimal years (NaN past the last segment).
<prefix>_t_break.tif one per segment Date of the break that ended each segment, as a decimal year (NaN: no break).
<prefix>_n_segments.tif 1 Number of segments per pixel.
<prefix>_rmse.tif one per segment and band (1_blue, …) RMSE of each band's fit.
<prefix>_coefs.tif one per segment, band and coefficient (1_blue_a0, 1_blue_c1, …) The harmonic coefficients a0, c1, a1, b1, a2, b2, a3, b3 (see zeit.ccdc).

In a stack interleaved by date, the bands are named b1, b2, … (1_b1_a0, …).

End-to-End Example

Run CCDC on a stack written by zeit.save_raster, whose 7th band of each date (index 6) holds the Fmask codes:

zeit ccdc ./data/landsat_sr.tif ./results \
    --qa-band 6 \
    --max-segments 8 \
    --jobs -1

The same on a stack interleaved by date, with 6 spectral bands and 1 QA band per date, and the dates in a text file:

zeit ccdc ./data/dense_stack.tif ./results \
    --dates-file ./data/dates.txt \
    --num-bands 7 \
    --qa-band 6


3. BFAST Monitor (bfast-monitor)

The bfast-monitor command runs zeit.bfast_monitor on a multi-band GeoTIFF where every band is one equally-spaced observation (e.g. a 16-day composite), reading it block by block. Time is regular, as in R's ts: observation i is at start_time + i / frequency. Both are read from the band dates (descriptions such as 2020-01-15, as zeit.save_raster writes them); give --start-time and --frequency for a stack without dates. See the BFAST Monitor tutorial for the full method background.

The four time-series commands (bfast-monitor, bfast-lite, bfast, mann-kendall) write one GeoTIFF, <output_dir>/<prefix>.tif, with one float32 band per metric, named after it.

Syntax

zeit bfast-monitor <input> <output_dir> --monitor-start-time <year or date> [OPTIONS]

Positional Arguments

Argument Type Description
input filepath Path to the input multi-band GeoTIFF. Each band is one equally-spaced time step.
output_dir dirpath Directory where the single output GeoTIFF (7 bands, see below) will be saved.

Configuration Options

Option Type Default Description
--monitor-start-time float or date (required) When monitoring begins, as a decimal year (2019.0) or a date (2019-01-01): the boundary between the stable "history" and "monitoring" periods.
--start-time float from the band dates The series' start time (e.g. 2015.0).
--frequency int from the band dates Observations per year (e.g. 23 for 16-day composites).
--order int 3 Harmonic order for the seasonal regressors.
--h float 0.25 MOSUM window size, as a fraction of history length. Must be one of 0.25, 0.5, 1.0.
--period int 10 Monitoring period parameter. Must be one of 2, 4, 6, 8, 10.
--alpha float 0.05 Significance level for the monitoring boundary.
--min-valid int 10 Minimum valid (non-NaN) history observations per pixel.
--chunk-size int 512 Size of the image chunks to process simultaneously.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--prefix str bfast_monitor Filename (without extension) for the output GeoTIFF.

Output bands (in order): breakpoint, breakpoint_idx, magnitude, sigma, n_history, has_break, valid (see zeit.bfast_monitor).

End-to-End Example

zeit bfast-monitor ./data/ndvi_16day_stack.tif ./results \
    --monitor-start-time 2019-01-01 \
    --jobs -1

# A stack without dates in its band names: give the time axis
zeit bfast-monitor ./data/ndvi_16day_stack.tif ./results \
    --start-time 2015.0 --frequency 23 --monitor-start-time 2019.0

4. BFAST Lite (bfast-lite)

The bfast-lite command runs zeit.bfast_lite: it retrospectively segments the whole series into an optimal number of pieces in a single pass - the modern, non-iterative alternative to classic bfast. Input and time axis as for bfast-monitor. See the BFAST Lite tutorial.

Syntax

zeit bfast-lite <input> <output_dir> [OPTIONS]

Configuration Options

Option Type Default Description
--start-time float from the band dates The series' start time (e.g. 2010.0).
--frequency int from the band dates Observations per year.
--order int 3 Harmonic order.
--h float 0.15 Minimum segment size, as a fraction of the series length.
--max-breaks-output int 5 Maximum number of breakpoints to report per pixel (max_breaks in Python).
--min-valid int 20 Minimum valid observations per pixel.
--chunk-size int 512 Size of the image chunks to process simultaneously.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--prefix str bfast_lite Filename (without extension) for the output GeoTIFF.

Output bands: n_breaks, rss, lwz, n_valid, valid, breakpoint_idx_1..N (see zeit.bfast_lite).

End-to-End Example

zeit bfast-lite ./data/ndvi_16day_stack.tif ./results --max-breaks-output 5

5. Classic BFAST (bfast)

The bfast command runs zeit.bfast, the original iterative bfast() algorithm: an STL seasonal seed followed by alternating trend/season segmented regressions, distinguishing trend breaks from seasonal (phenological) breaks. Input and time axis as for bfast-monitor. See the BFAST tutorial for the full method background, scope notes, and R cross-validation results.

Syntax

zeit bfast <input> <output_dir> [OPTIONS]

Configuration Options

Option Type Default Description
--start-time float from the band dates The series' start time (e.g. 2000.0).
--frequency int from the band dates Observations per year. Requires more than 2 * frequency total observations.
--order int 3 Harmonic order for the season sub-model.
--h float 0.15 Minimum segment size (both trend and season), as a fraction of valid observations.
--max-breaks-trend int 5 Maximum number of trend breakpoints to report per pixel.
--max-breaks-season int 5 Maximum number of season breakpoints to report per pixel.
--max-iter int 10 Maximum trend/season re-estimation iterations.
--level float 0.05 Significance threshold for the preliminary structural-stability pre-check.
--min-valid int 20 Minimum valid observations per pixel.
--chunk-size int 512 Size of the image chunks to process simultaneously.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--prefix str bfast Filename (without extension) for the output GeoTIFF.

Output bands: n_trend_breaks, n_season_breaks, magnitude, break_time, n_iter, n_valid, valid, trend_breakpoint_idx_1..N, season_breakpoint_idx_1..N (see zeit.bfast).

End-to-End Example

zeit bfast ./data/ndvi_16day_stack.tif ./results

6. Mann-Kendall Trend Test (mann-kendall)

The mann-kendall command runs zeit.mann_kendall, the pixel-wise Mann-Kendall trend test and Theil-Sen slope estimator, across a multi-band GeoTIFF (one band per observation - typically one annual composite per band). No dates are needed. See the Mann-Kendall tutorial.

Syntax

zeit mann-kendall <input> <output_dir> [OPTIONS]

Configuration Options

Option Type Default Description
--method str hamed_rao Trend test variant. Choices: original, hamed_rao (autocorrelation-corrected, recommended), yue_wang, seasonal.
--alpha float 0.05 Significance level.
--lag int None First significant lags for the autocorrelation correction (hamed_rao/yue_wang only). Defaults to the full series length.
--period int 1 Season slots for --method seasonal (e.g. 23 for MODIS 16-day cycles), letting a raw sub-annual series be tested directly.
--min-valid int 4 Minimum valid observations per pixel.
--chunk-size int 512 Size of the image chunks to process simultaneously.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--prefix str mann_kendall Filename (without extension) for the output GeoTIFF.

Output bands: trend, h, p, z, tau, s, var_s, slope, intercept. slope/intercept are per time step (per band), so one observation per year gives a directly interpretable per-year trend.

End-to-End Example

zeit mann-kendall ./data/annual_ndvi_stack.tif ./results --method hamed_rao --jobs -1

7. Minimum Mapping Unit Filter (mmu-filter)

The mmu-filter command applies a spatial Minimum Mapping Unit (MMU) filter to a single-band raster - typically a disturbance-year map from landtrendr - removing isolated pixel groups smaller than a given size to reduce "salt and pepper" noise.

Syntax

zeit mmu-filter <input> <output> [OPTIONS]

Positional Arguments

Argument Type Description
input filepath Path to the input single-band GeoTIFF (e.g. a landtrendr year-of-detection map).
output filepath Path to save the filtered GeoTIFF.

Configuration Options

Option Type Default Description
--mmu-pixels int 11 Minimum connected-patch size, in pixels. Smaller patches are zeroed out (treated as the raster's nodata/background value).

End-to-End Example

zeit mmu-filter ./results/lt_event_yod.tif ./results/lt_event_yod_mmu.tif --mmu-pixels 9

The other cube functions

phenology, smooth, tmask, twdtw, snic, fields, classify, som, coded and bandpass-adjust run the Python function of the same name on any raster load_raster reads, with the dates in the band names (as save_raster writes them, yr1985, 2020-01-15 or 2020-01-15_red for a time × band stack). They share the same syntax and options, and write <output_dir>/<prefix>.tif, one band per map (or per date), computed block by block in one pass:

zeit <command> <input> <output_dir> [OPTIONS]
Option Type Default Description
--chunk-size int 512 Size of the image chunks to process at once.
--jobs int -1 Threads. -1: all the cores but one, a share of them on a machine several users are logged in to, or every core of a cluster job (see zeit doctor).
--prefix str the command Name of the output file, without extension.

8. Phenology (phenology)

zeit.phenology: one band per metric (and year). See the phenology tutorial.

Option Type Default Description
--curve str beck beck, elmore, gu, klos, zhang, ag or dl.
--method str threshold threshold, derivative, gu or klosterman.
--weights filepath None A raster of observation weights in [0, 1] on the input's grid and dates (e.g. written from zeit.qc_sentinel2_scl).
--not-annual flag Metrics per season instead of per calendar year.
--max-seasons int years Seasons to report.
--whittaker-lambda float 10 Whittaker smoothing before the fit.
zeit phenology ./data/s2_ndvi_2019_2023.tif ./results --curve elmore --weights ./data/s2_weights.tif

9. Smoothing (smooth)

zeit.smooth: the smoothed series, same dates and type.

Option Type Default Description
--method str whittaker whittaker (uneven dates, gaps filled) or savgol.
--lmbda float 10 Whittaker: smoothness.
--weights filepath None Whittaker: a raster of observation weights in [0, 1].
--window, --polyorder int 5, 2 Savitzky-Golay: window length and polynomial order.
zeit smooth ./data/ndvi_16d.tif ./results --lmbda 20

10. Cloud and shadow screening (tmask)

zeit.tmask on a (time, band) stack (bands named date_band): one band per date, 1 clear, 0 cloud, shadow or no data.

Option Type Default Description
--green, --swir str green, swir1 Names of the green and SWIR-1 bands.
--scale float 10000 Reflectance scale of the stack (1 for 0-1 floats).
zeit tmask ./data/landsat_sr_stack.tif ./results

11. TWDTW classification (twdtw)

zeit.twdtw: bands label, distance and one distance per pattern. The patterns come from a CSV with the columns pattern, date and one value column (or one column per band, named as the input's bands):

pattern,date,ndvi
soy,2022-10-01,0.25
soy,2022-11-01,0.48
...
pasture,2022-10-01,0.55
Option Type Default Description
--patterns filepath required The CSV of patterns.
--band str None A multi-band input with one-band patterns: the band to classify.
--steepness, --midpoint float 0.1, 50 The logistic time weight (midpoint in days).
--max-elapsed float None Never match observations farther apart than this many days.
--no-cycle flag Measure elapsed time between the dates, not between days of the year.
zeit twdtw ./data/ndvi_2022.tif ./results --patterns ./data/patterns.csv

12. SNIC segmentation (snic)

zeit.snic: the segment labels (the input is read into memory). --polygons also writes <prefix>.gpkg, the segments as polygons with their means.

Option Type Default Description
--spacing float 10 Pixels between seeds.
--compactness float 0.5 Larger: more regular segments (in data units).
--grid str rectangular rectangular, diamond, hexagonal or random.
--polygons flag Also write the polygons.
zeit snic ./data/s2_ndvi_2022.tif ./results --spacing 8 --polygons

12b. Field boundaries (fields)

zeit.fields: fields by the stochastic watershed (Angulo & Jeulin 2007), after the MappingDemo notebook (Baumann 2020, after Emmanuelle Gouillart's tutorial), with defaults chosen by the sensitivity analysis and spatial cross-validation of phases 24e and 24f (mean F 0.50 to 0.63 on 64 Brazil and Chaco windows; --preset notebook restores the notebook's values). In forested landscapes such as the Dry Chaco a forest mask raises F, so pass --mask-threshold there. The input is read into memory. One three-band raster, <prefix>.tif: labels (field ids, 0 outside the mask; the boundary network, label 1, stays in it), boundary (the boundary probability) and gradient. --polygons also writes <prefix>.gpkg, the fields as polygons with n_pixels, area_ha, perimeter_m and compactness (the boundary network left out). Tutorial: Field boundaries.

Option Type Default Description
--gradient str sobel for one image, multitemporal for a stack or series tophat (the notebook's), sobel or multitemporal.
--combine str mean mean or max: how the multitemporal gradient combines the layers.
--method str montecarlo montecarlo or exact. The thresholds are not yet calibrated for exact.
--realizations int 200 Monte Carlo: number of watersheds (500 with --preset notebook).
--markers int density 1000 Random markers per watershed, as a count (1000 with --preset notebook).
--marker-density float 1000 Markers per million pixels of the image, instead of --markers (not both).
--min-distance float 20 Pixels between markers.
--marker-radius int 3 Radius of the disk of each marker.
--low, --high float 0.1, 0.6 Hysteresis thresholds on the boundary probability (--low 0.3 with --preset notebook).
--min-size int 10 Drop objects of fewer pixels before the final watershed (50 with --preset notebook).
--final str image, or gradient for a stack image or gradient: what the final watershed floods.
--mask-threshold float None Keep the pixels where the image is greater than this.
--mask-quantile float None Keep the pixels where the image is above its own percentile (0 to 100); not together with --mask-threshold.
--band str None A stack: the band (name or number) to delineate.
--preset str None notebook: the notebook's value for every option not given (tophat, 500 realizations, 1000 markers, --low 0.3, --min-size 50, --final image, --mask-threshold 2000 for Landsat SWIR1 times 10000, the latter unless --mask-threshold or --mask-quantile is given).
--random-state int None Seed of the Monte Carlo.
--polygons flag Also write the polygons.
--tile int None A raster too large for one call: process tiles of this many pixels per side, each with an overlap, and stitch them (zeit.fields_tiled). Writes labels.tif, boundary.tif (COGs) and, with --polygons, fields.gpkg in the output directory instead of <prefix>.tif; the raster is read by window, never whole. --markers, --mask-quantile and --preset are errors with it (use --marker-density and --mask-threshold).
--overlap int max(64, 4 x --min-distance) With --tile: pixels of window around each tile's core.
zeit fields ./data/B5_medoid_2019.tif ./results --preset notebook --random-state 0 --polygons
zeit fields ./data/chaco_2020.vrt ./results --tile 512 --random-state 0 --polygons --jobs 8   # too large for one call

13. Classification (classify)

zeit.train_classifier and zeit.classify in one call: a random forest trained on sample points (each band, or date and band, a feature) classifies every pixel. Bands label (and each class's probability with --probability).

Option Type Default Description
--samples filepath None Vector file of points with their class.
--label str class Column of the samples holding the class.
--model filepath None With --samples: where to save the trained model (joblib). Without: a saved model to classify with.
--probability flag Also write each class's probability.
zeit classify ./data/s2_2022.tif ./results --samples ./data/samples.gpkg --model ./results/rf.joblib
zeit classify ./data/s2_2023.tif ./results_2023 --model ./results/rf.joblib      # the same model, next year

14. SOM clustering (som)

zeit.som: bands label and distance, and <prefix>_prototypes.csv with one row per neuron (neuron, its grid position i/j, n_pixels, then the prototype, one column per date or date and band).

Option Type Default Description
--x, --y int 3, 3 Neurons of the grid.
--sample int 50000 Pixels to train on, at random (0 for all).
--algorithm str online online or batch.
--sigma, --learning-rate float 1.0, 0.5 Initial neighbourhood radius and learning rate.
--seed int 42 Random seed.
zeit som ./data/LT_Stack_NDVI_Rondonia.tif ./results --x 2 --y 2 --sample 30000

15. Bandpass adjustment (bandpass-adjust)

zeit.bandpass_adjust: the reflectance series with its Sentinel-2 dates on Landsat 8's OLI bands (HLS's bandpass step only), as <output_dir>/<prefix>.tif with the input's bands and type. A GeoTIFF does not say which sensor took each date, so --sensor does.

Option Type Default Description
--sensor str ... required The sensor of every date (sentinel-2a, S2B, landsat-8...), or one per date.
--etm str None rma or ols: also take Landsat 5/7 dates to OLI (Roy et al. 2016).
--scale float auto Reflectance scale of the stack: 10000 for integers or values above 2, else 1.
zeit bandpass-adjust ./data/s2_2023.tif ./results --sensor sentinel-2b --prefix s2_2023_oli

16. Embeddings (embeddings)

zeit.load_embeddings: download the yearly embeddings of a foundation model over a region into one GeoTIFF, <output_dir>/<prefix>.tif, one band per year and dimension (2024_A00, 2024_A01...), which zeit.load_raster reads back as a (time, band, y, x) cube that remembers which embeddings it holds. Unlike the other commands it takes no input raster: the region is given by --bbox or --region.

Option Type Default Description
--source str required tessera or alphaearth.
--bbox 4 float None West, south, east, north in longitude and latitude.
--region filepath None Vector file of the region; cells outside its polygons are NoData.
--years str all Years, e.g. 2018 2020 or 2018-2024.
--crs, --res str, float the region's UTM zone, 10 Output CRS and cell size.
--version, --variant, --depth v1.1 TESSERA: dataset version and variant; the first DEPTH dimensions of a v2 store.
--backend str source.coop AlphaEarth: the open COGs or gee (Earth Engine).
--store filepath None A local copy of the product to read instead of the public one.
--cache-dir filepath ~/.cache/zeit/embeddings Where downloads are kept.
--prefix str the source Name of the output file.
--compact flag off Save as int8, about a quarter of the size of float32; zeit.load_raster reads it back as float32 (Compact copies).
zeit embeddings ./results --source tessera --bbox -63.0 -10.0 -62.9 -9.9 --years 2018-2024
zeit classify ./results/tessera.tif ./results --samples ./data/samples.gpkg   # every year and dimension a feature

Many tiles, on this and other computers

17. Many tiles, here and on other computers

Every command that reads one raster (landtrendr, ccdc, bfast-monitor, bfast-lite, bfast, mann-kendall, phenology, smooth, tmask, twdtw, snic, fields, classify, som, coded, bandpass-adjust) also runs on a whole folder of tiles, with the same options, writing <output_dir>/<tile name>/ per tile. Add --helpers and the computers of the local network running zeit worker process tiles too. The Python form is zeit.run_tiles; the tutorial, with what limits the speed, is Many tiles on several computers.

zeit landtrendr nbr_tiles/ lt_out/ --tiles                    # every tile, on this computer
zeit landtrendr nbr_tiles/ lt_out/ --helpers                  # here and on the helpers
zeit landtrendr nbr_tiles/ lt_out/ --helpers --no-local       # only on the helpers; this computer stays free
zeit landtrendr nbr_tiles/ lt_out/ --helpers --local-cores 4  # here with 4 cores, and on the helpers
zeit landtrendr "nbr_tiles/LT_2*.tif" lt_out/ --tiles         # a quoted glob instead of a folder
zeit landtrendr urls.txt lt_out/ --helpers                    # URLs, one per line: each computer downloads its tiles
Option Type Default Description
--tiles flag False The input is a folder of tiles (its .tif files) or a quoted glob: run every tile.
--helpers flag False Also send tiles to the helpers of this computer's group (implies --tiles).
--no-local flag False With --helpers: process nothing here, only hand out the tiles and collect the results.
--local-cores int --jobs Cores for the tiles processed here (as --jobs -1 by default: all but one, all of a cluster job's). Each helper uses the cores it lends.
--port int 47801 TCP port the helpers connect to.
--shard I/N Process part I (from 0) of N of the tiles, tile k being part k mod N's (implies --tiles). In a Slurm job array the part is the task's without it.
--requeue flag False In a Slurm job: when stopped by SIGTERM before the time limit (#SBATCH --signal=B:TERM@120), requeue the job to continue with the tiles left, if it finished at least one.
  • Resumable. Finished tiles are kept: running the same command again processes only the others. Running it with other options into the same output folder is refused rather than mixing results.
  • Where the helpers read the tiles. From shared storage (a NAS) when they see the same file, otherwise this computer sends it (a file stored without compression goes as a lossless ZSTD copy); a helper keeps the tiles it received (20 GB by default), so another run does not send them again. Given a .txt file of URLs, each computer downloads the tiles it processes. Tiles built from STAC or Earth Engine on each computer: zeit.stac_tiles, zeit.gee_tiles (Python).
  • Where the results go. A helper that sees the output folder too (a NAS) writes into it; otherwise it sends them back.
  • Progress. One line with the tiles done, the computers at work, the network rate and the time left; the helpers that join or leave; a tile that fails (tried again elsewhere, given up after two failures and listed at the end, with exit code 1).
  • Files used by every tile (--patterns of twdtw, --dates-file of ccdc, --model of classify, --training of coded) are sent to the helpers. Options naming a file of one raster (--weights, --samples) cannot be used with many tiles.

18. Lending a computer (zeit worker)

Run on each computer that helps. It waits for a computer of its group that runs tiles, processes the tiles it gets with all the cores it lends, and waits again, until Ctrl+C. The first time, it joins the group with the code shown by zeit helpers invite.

zeit worker --join K7QM-2XDP     # the first time
zeit worker                      # from then on
zeit worker --cores 6            # lend only 6 cores
zeit worker --map "Z:\=/mnt/nas" # the NAS the coordinator sees as Z:\ is /mnt/nas here
Option Type Default Description
--join str None The invitation code, the first time only.
--cores int as --jobs -1 Cores to lend.
--connect HOST[:PORT] None The coordinator's address, when broadcasts do not reach it (another subnet, a VPN).
--map SRC=DST None A shared folder mounted elsewhere here (repeatable). Mapped Windows drives are sent as UNC paths (\\nas\tiles), which Windows helpers read without a map.
--cache-dir dirpath the user's cache folder Where received tiles are kept.
--cache-gb float 20 Space the kept tiles may take.

A helper only opens outgoing connections (no firewall rule on it) and only runs zeit's own commands. Both computers need the same zeit version; a helper with another one is told which to install. It keeps the computer from sleeping while it works.

19. The group (zeit helpers)

Command What it does
zeit helpers invite [--minutes 10] Shows a code (such as K7QM-2XDP) with which other computers join this computer's group, while it runs. Any computer of the group can then run tiles with the others' help.
zeit helpers list [--seconds 5] The helpers waiting for work on the local network: name, address, cores, zeit version. Busy helpers do not show.
zeit helpers firewall On Windows, creates the inbound rules (TCP 47801 and UDP 47800, from the local subnet only), asking for administrator rights once. Needed on the computer that runs tiles, not on the helpers.
zeit helpers leave Takes this computer out of its group (forgets the group's secret).

Clusters

20. Checking a computer (zeit doctor)

zeit doctor                 # threads, job, caches, network, versions
zeit doctor --no-network    # without checking the services

Prints what zeit finds where it runs: the threads --jobs -1 uses and where that number comes from (on a machine several users are logged in to, how many it counted), the job of Slurm, PBS or LSF and its array task, the caches and whether they can be written, whether the services zeit downloads from answer, and the versions. Run it in a job (srun zeit doctor) to see what a job of yours gets:

zeit 2.3.0 (Python 3.12.8, Linux x86_64, glibc 2.28)
Threads (n_jobs=-1): 16 threads (16 of 128 processors available to this process; Slurm job 123456)
  SLURM_CPUS_PER_TASK=16
...

See Threads for how the count is made.

21. A job array for the tiles (zeit slurm)

zeit slurm landtrendr tiles/ out/ --cpus 16 --time 2:00:00 --max-segments 8   # writes the script
zeit slurm landtrendr tiles/ out/ --cpus 16 --time 2:00:00 --submit          # and submits it

Writes the Slurm job script that splits a folder of tiles among the tasks of a job array (one task per tile, up to 1000), prints it and saves it as out/.zeit-tiles/<command>.sbatch; --submit hands it to sbatch. Every task runs zeit <command> tiles/ out/ --tiles --requeue with the options given after the output folder (any of the command's, except --jobs: each task uses every processor it is given). The script sets the job's log per task (out/.zeit-tiles/logs/slurm-<job>_<task>.out), --signal=B:TERM@120 and --requeue, so that a task stopped at its time limit drops the tile at work and requeues itself.

Option Type Default Description
--cpus int 16 Processors of each task (--cpus-per-task).
--mem str suggested Memory of each task (32G). By default, from the command and the widest tile: a task holds one row of blocks of --chunk-size at a time, at most one block per processor (measured for LandTrendr and CCDC; the script says how it was reckoned).
--time str the partition's Time limit of each task (2:00:00, 1-00:00:00).
--partition, --account str Where the job runs, and who pays.
--tasks int one per tile Tasks of the array; with fewer than tiles, each task processes several.
--max-running int Tasks running at once (--array=0-49%N).
--sbatch str Another #SBATCH line, e.g. --sbatch=--qos=long (repeatable).
--setup str A line run before zeit, e.g. --setup "module load gdal" (repeatable). The script runs zeit with the Python it was written from, so an activated virtual environment needs no setup.
--script path out/.zeit-tiles/<command>.sbatch Where to write the script.
--submit flag False Submit it with sbatch.

22. The tiles of an output folder (zeit tiles status)

zeit tiles status out/
landtrendr in out: 120 tiles, 115 done, 2 failed, 3 not done
  failed: tile_031 (run 4242_31): MemoryError
          log: out/.zeit-tiles/logs/tile_031.log
  not started: tile_088, tile_101, tile_117
To process the 5 left: sbatch --array=31,40,88,101,117 out/.zeit-tiles/landtrendr.sbatch

What the runs that wrote into an output folder did, across the tasks of a job array: the tiles done, failed (with the error and the tile's log), not done (and those in runs that have not ended: still running, or killed), and the --array that submits again only the tasks with tiles left. Outside an array, run the same command again. Exit code 0 when every tile is done, 3 while some are left.

23. Downloading beforehand (zeit fetch)

zeit fetch weights                    # lists the published weights
zeit fetch weights prithvi-300m-tl    # or presto, ..., all
zeit fetch tiles urls.txt             # the tiles of a list of URLs
zeit fetch embeddings out/ --source tessera --bbox -63.2 -10.1 -62.8 -9.7 --years 2020-2024

The compute nodes of many clusters have no internet access. On the login node, which has it, zeit fetch downloads what zeit would download while running, into the cache: with ZEIT_CACHE_DIR set to a folder the compute nodes also see (the scratch space), they find it there.

  • weights: the pretrained weights of zeit.ai, checked by SHA-256. It does not need torch.
  • tiles: the tiles of a .txt file of URLs (one per line), into the tile cache, where zeit <command> urls.txt out/ --tiles looks first. --threads (default 4) downloads several at once, and --cache-dir names another cache. A tile that cannot be downloaded is reported, and the others are kept: run it again for the rest.
  • embeddings: the same as zeit embeddings (one GeoTIFF of the region, which zeit.load_raster reads), with the same options.

Without network access, zeit says so and names the zeit fetch command that downloads what is missing, instead of a connection error.

24. This user's settings (zeit config)

zeit config                   # every setting, and the file
zeit config threads 12        # the threads of --jobs -1 / n_jobs=-1, for this user
zeit config threads           # the current value
zeit config threads auto      # back to what zeit decides

Keeps settings for the user in config.toml of the config folder (ZEIT_CONFIG_DIR, or %APPDATA%\zeit on Windows, ~/.config/zeit elsewhere), for those who would rather not set an environment variable: on a shared Windows server, a variable for the whole system needs an administrator. threads comes after ZEIT_NUM_THREADS and before OMP_NUM_THREADS, and is not used in a batch job, whose processors are the job's (see Threads). Processes already running see a change within 30 seconds.

25. Sentinel-2 Level 1C to surface reflectance (zeit level2)

# one scene: a .SAFE folder or the name of a product (downloaded first)
zeit level2 S2B_MSIL1C_20230728T132239_N0509_R038_T23LKC_20230728T150149.SAFE --out l2_20230728

# every scene of a tile and dates, one at a time, resumable
zeit level2 --tile 23LKC --start 2023-07-01 --end 2023-07-31 --out l2_23LKC --max-cloud 80

zeit.level2 for one scene, written as .zeit.save does (boa.tif, qai.tif, dst.tif...), or the series of zeit.level2_series: one folder per scene, the DEM in dem/ and the journal level2_series.json in --out. The input and --tile exclude each other, and --start and --end go with --tile. Run again after an interruption or a failure: finished scenes are skipped. The command prints how many scenes are done, skipped, failed and duplicates (an older processing of the same acquisition) and names the failed ones; the exit code is 1 if any failed or none succeeded. Reopen the series in Python with zeit.load_level2_series.

Option Type Default Description
--out path required Output folder.
--tile str A series: the MGRS tile to search (23LKC).
--start, --end date With --tile: the dates of the search, --end included.
--max-cloud float 100 With --tile: largest cloud cover, in percent.
--dem str glo30 glo30 (Copernicus GLO-30, downloaded once per tile), a DEM raster in metres, or none (then --no-topography).
--merge str none improphe or regression: merge the 20 m bands to 10 m before the correction.
--no-brdf flag False Do not normalise the BRDF.
--no-topography flag False Do not correct the terrain's illumination (no DEM needed).
--keep-safe flag False With --tile: keep the downloaded .SAFE folders (default: deleted once the scene is done).
--threads int 8 Threads of each scene.

One scene takes about 146 s and needs about 22 GiB of RAM (29 GiB with --merge) for a full 10 m tile with 8 threads; a series runs one scene at a time. The other options of zeit.level2 (aod, gswo, flags, reference...) are for the Python function. See the tutorial.


Note on AI Tools (Deep Learning)

Currently, the AI tools (zeit.ai) are not exposed via the CLI.

Why? Deep learning architectures (like UTAE, TempCNN, or Siamese Networks) require highly specific initializations based on your dataset (e.g., number of input bands, number of target classes, path to pre-trained .pth weights, and GPU allocation strategies). These configurations are too complex and dynamic to be safely passed as simple terminal arguments.

To use the AI tools, use the Python API: zeit.ai.samples, train and predict go from a cube and labelled samples to a map in three calls, and the models can be trained with a loop of your own.