hyoga.open.subdataset#

hyoga.open.subdataset(filename, time, shift=0, tolerance=1e-09, **kwargs)#

Open a single file in a multi-file dataset.

Parameters
  • filename (str) – A format string informing the path to a series of files. A single replacement field should indicate the final time in years of each file (e.g. 'path/to/ex.{:07.0f}.nc').

  • time (int of float) – Time in years (-age*1e3) used to find the file to open in the list matching the filename pattern, and to select a corresponding time slice. The format (int or float) should correspond to the format string used in the filename.

  • shift (int or float) – Shift in years in the filename numbering relative to the model time. This is useful when output files are named relative to an arbitrary start date rather than zero, for instance in paleo-glacier runs.

  • tolerance (float) – Largest acceptable error when selected the nearest time frame, passed to xarray.Dataset.sel().

  • **kwargs (optional) – Keyword arguments passed dataset().

Returns

ds (Dataset) – Dataset containing the time slice defined by time in the multi-file dataset matching the filename pattern.