snek5000.output.readers.pymech_#

Read field files using pymech as xarray datasets.

Classes

class snek5000.output.readers.pymech_.ReaderPymech(output)[source]#
tag = 'pymech'#
load(prefix='', index=-1, t_approx=None, **kwargs)[source]#

Opens field files(s) as a xarray dataset. The data is cached in data.

Parameters
  • prefix (str) – Field file prefix to load custom output files. Empty for default field files.

  • index (int or str) – When an integer is provided, it refers to the index position in a sorted list of field files. When index == "all" all files are loaded. When index is some other string, it is assumed to be glob pattern for the final 5 digits of the field filename extension (for example: "??20?").

  • t_approx (float) – Find a file from approximate simulation time

  • **kwargs – Keyword arguments for pymech.open_* function

Returns

ds

Return type

xarray.Dataset

get_var(key)[source]#

Return a specific array.

Parameters

key (str) – Key indicating a DataArray in the loaded dataset stored in data. Must be called after load().

Return type

xarray.DataArray

class snek5000.output.readers.pymech_.ReaderPymechStats(output)[source]#
tag = 'pymech_stats'#
load(prefix='sts', index=-1, **kwargs)[source]#

Opens statistics field files(s) as a xarray dataset

get_var(key)#

Return a specific array.

Parameters

key (str) – Key indicating a DataArray in the loaded dataset stored in data. Must be called after load().

Return type

xarray.DataArray