xarr_to_netcdf

HSTB.kluster.xarray_helpers.xarr_to_netcdf(xarr, pth, fname, attrs=None, idx=None)

Takes in an xarray Dataset and pushes it to netcdf. For use with the output from combine_xarrs and/or _sequential_to_xarray

Parameters
  • xarr (Dataset) – Dataset to save

  • pth (str) – Path to the folder to contain the written netcdf file

  • fname (str) – base file name for the netcdf file

  • attrs (Optional[dict]) – optional attribution to store in the netcdf store

  • idx (Optional[int]) – optional file name index

Returns

path to the netcdf file

Return type

str