RasterSupport#
- class hydromodpy.spatial.RasterSupport(crs=None, dx=None, dy=None, xmin=None, xmax=None, ymin=None, ymax=None, nrows=None, ncols=None, nodata=None)[source]#
Bases:
objectMinimal spatial support for one raster-like 2D array.
This object stores the spatial metadata independently from the raster values themselves. It is intentionally limited to the metadata already available in HydroModPy’s current geographic workflow.
Attributes#
- crsstr | None
Coordinate reference system identifier (for example
"EPSG:2154").- dx, dyfloat | None
Cell size along the x and y directions. Keeping two distinct values avoids assuming square cells.
- xmin, xmax, ymin, ymaxfloat | None
Spatial extent of the raster support.
- nrows, ncolsint | None
Raster shape, when known.
- nodatafloat | None
Sentinel value used to mark invalid or absent cells in the raster.
- param crs:
- type crs:
- param dx:
- type dx:
- param dy:
- type dy:
- param xmin:
- type xmin:
- param xmax:
- type xmax:
- param ymin:
- type ymin:
- param ymax:
- type ymax:
- param nrows:
- type nrows:
- param ncols:
- type ncols:
- param nodata:
- type nodata:
- classmethod from_georeferencing(georeferencing, *, shape=None, nodata=None)[source]#
Build one raster support from an explicit georeferencing mapping.
- Return type:
- Parameters:
Expected input#
The expected keys match the historical
Domain.georeferencingpayload:crs,dx,dy,xmin,xmax,ymin,ymax.Optional extra metadata can be injected through: -
shape, to populatenrowsandncols, -nodata, to store the raster nodata sentinel.
- as_georeferencing_dict()[source]#
Return the historical
Domain.georeferencingview of this support.Only the keys already used by
Domainare exported here:crs,dx,dy,xmin,xmax,ymin,ymax.
- assert_complete_domain()[source]#
Validate that this support has all metadata required to compare domains.
A complete domain definition requires: - CRS, - extent (xmin, xmax, ymin, ymax), - raster shape (nrows, ncols).
- Return type:
- assert_same_geographic_domain(other, *, atol=1e-09)[source]#
Ensure two raster supports represent exactly the same geographic domain.
This comparison checks: - CRS equality (string-normalized), - extent equality (
xmin,xmax,ymin,ymax) withinatol.- Parameters:
other (
RasterSupport)atol (
float)
- Return type: