verde.load_surfer

verde.load_surfer(fname, dtype='float64')[source]

Read data from a Surfer ASCII grid file.

This function reads a Surfer grid file, masks any NaNs in the data, and outputs a xarray.DataArray that contains easting and northing coordinates, data values, and associated file metadata.

Surfer is a contouring, griding and surface mapping software from GoldenSoftware. The names and logos for Surfer and Golden Software are registered trademarks of Golden Software, Inc.

http://www.goldensoftware.com/products/surfer

Parameters
  • fname (str or file-like object) – Name or path of the Surfer grid file or an open file (or file-like) object.

  • dtype (str or numpy.dtype) – The type of variable used for the data. Default is float64. Use float32 if the data are large and precision is not an issue.

Returns

data (xarray.DataArray) – A 2D grid with the data.