pykrige.kriging_tools.write_asc_grid

pykrige.kriging_tools.write_asc_grid(x, y, z, filename='output.asc', no_data=-999.0, style=1)[source]

Writes gridded data to ASCII grid file (*.asc).

This is useful for exporting data to a GIS program.

Parameters:
  • x (array_like, shape (N,) or (N, 1)) – X-coordinates of grid points at center of cells.

  • y (array_like, shape (M,) or (M, 1)) – Y-coordinates of grid points at center of cells.

  • z (array_like, shape (M, N)) – Gridded data values. May be a masked array.

  • filename (string, optional) – Name of output *.asc file. Default name is ‘output.asc’.

  • no_data (float, optional) – no data value to be used

  • style (int, optional) – Determines how to write the *.asc file header. Specifying 1 writes out DX, DY, XLLCENTER, YLLCENTER. Specifying 2 writes out CELLSIZE (note DX must be the same as DY), XLLCORNER, YLLCORNER. Default is 1.