shnitsel.core.postprocess.sudi

sudi(da)

Take successive differences along the ‘frame’ dimension

Parameters:

da (DataArray) – An xarray.DataArray with a ‘frame’ dimension corresponding to a pandas.MultiIndex of which the innermost level is ‘time’.

Returns:

  • An xarray.DataArray with the same shape, dimension names etc.,

  • but with the data of the (i)th frame replaced by the difference between

  • the original (i+1)th and (i)th frames, with zeros filling in for both the

  • initial frame and any frame for which time = 0, to avoid taking differences

  • between the last and first frames of successive trajectories.

Return type:

DataArray