environmentaltools.common.to_esriascii

environmentaltools.common.to_esriascii(data: ndarray, ncols: int, nrows: int, cellsize: float, file_name: str, x0: float = 0, y0: float = 0, nodata_value: float = -9999)[source]

Save gridded data to ESRI ASCII raster format.

Exports 2D array data to ESRI ASCII Grid format (.asc) with header information including grid dimensions, origin, cell size, and no-data value.

Parameters:
  • data (np.ndarray) – 2D array of grid values to save.

  • ncols (int) – Number of columns in the grid.

  • nrows (int) – Number of rows in the grid.

  • cellsize (float) – Cell size (resolution) in spatial units.

  • file_name (str) – Output file path.

  • x0 (float) – X-coordinate of lower-left corner. Defaults to 0.

  • y0 (float) – Y-coordinate of lower-left corner. Defaults to 0.

  • nodata_value (float) – Value representing missing/no data. Defaults to -9999.

Returns:

None