viz.best_demo_tile
viz.best_demo_tile(mode_dir, mode, *, min_nan_pct=1.0)Pick the tile that best illustrates a given NaN-handling mode.
The tiler writes a tiles_metadata.csv next to its outputs with per-tile bookkeeping (n_nan_before, n_filled, has_mask_band, n_cloud_masked, …). We require n_nan_before to be at least min_nan_pct percent of the tile’s pixel count so the picked tile is actually informative – a survivor with 0 % NaN has nothing to show. Within that filter we rank by the field that names the mode:
"drop"-> the survivor with the highestn_nan_before(the cloudiest tile that still squeaked past the threshold)"interpolate"-> the tile with the highestn_filled(also requiresn_filled > 0)"mask"-> a tile that ended up with avalid_maskband, picking the one with the most cloud-masked pixels
Augmented rows (augmentation != "none") are skipped so the picked tile is always a primary, not a flip / rotation.
Returns
| Name | Type | Description |
|---|---|---|
| (path_or_None, n_nan_before) | path is None when no tile satisfies the min_nan_pct filter – callers should handle that case (typically by skipping the row in the figure with a “no demo tile available” caption). |