raster_tools.Raster.pad#
- Raster.pad(target, *, fill_values=None)[source]#
Pad the raster’s grid out to cover the given extent.
The source raster’s grid (resolution and origin) is preserved; only new cells are added on the edges.
- Parameters
target (tuple, Raster, or odc.geo.geobox.GeoBox) – The extent to pad to. Accepts a
(minx, miny, maxx, maxy)bounds tuple, anotherRaster(its.boundsis used), or aGeoBox(its bounding box is used). The resolution/origin of a Raster/GeoBox target are ignored.fill_values (None, scalar, or list of scalars, optional) – Value(s) used to fill newly added cells.
None(default) uses the raster’s null value (one is chosen and assigned if unset) and marks new cells as null. A scalar fills all new cells; if it equals the null value, new cells are marked null. A list of lengthnbandsprovides per-band fills.
- Returns
A new lazy Raster covering at least the requested extent.
- Return type