PlasmaCalcs.plotting.plot_tools.plot_dims.infer_movie_dim

PlasmaCalcs.plotting.plot_tools.plot_dims.infer_movie_dim(dims, dim=None, *, exclude=[], fail_ok=True)
infer the dimension which movie frames should index.
(if dim is provided, just return dim, after ensuring dim in dims)
dims: iterable of strings
all possible dims. Probably array.dims, if trying to infer from an array.
dim: None or str
the dimension which frames will index.
if None, infer it, if possible:
if len(dims)==1, use the only dim remaining from dims.
otherwise, use the first dim from DEFAULTS.PLOT.DIMS_INFER[‘t’] which appears in dims, if possible.
otherwise, failed to infer a dim; return None.
exclude: iterable
dims to exclude from dims, before inferring dim.
E.g. if dims=(‘x’, ‘y’, ‘z’, ‘t’) and exclude=(‘x’, ‘y’), then infer from dims=(‘z’, ‘t’).
Useful e.g. if it is already known which dims are used for x & y axes of the plot.
Exclude can contain any values, e.g. exclude=(‘x’, None) is fine.
fail_ok: bool
controls behavior when failing to infer dim:
True –> return None
False –> raise PlottingAmbiguityError