hydromodpy.display.scalable#

Scalable rasterization helpers for dense meshes and large 2D fields.

Wraps datashader so dense meshes (> 100k cells) and dense gridded arrays can be rendered as raster images at a target pixel resolution. Auto-trigger threshold defaults to 100_000 cells.

Used by the public hmp.viz.show dispatcher and by figures that opt-in to downsampling when they detect a mesh too large for matplotlib’s PolyCollection path.

Functions

is_datashader_available()

Return True when the optional datashader package is importable.

rasterize_field(da, *[, target_px, agg])

Rasterize a field via datashader Canvas.raster.

rasterize_points(x, y, values, *[, ...])

Rasterize scattered (x, y, value) points to a 2D numpy array.

should_rasterize(n_cells, *[, threshold])

Return True when the cell count crosses the rasterization threshold.