etspy.base.TomoStack.shift_and_tilt_setter(mode: 'shifts' | 'tilts', value: TomoShifts | TomoTilts | ndarray | None) TomoShifts | TomoTilts[source]

Set either self._tilts or self._shifts to an array.

This method is split out to reduce duplication of code between the tilts and shifts property setter functions, since they have significant overlap.

Parameters:
mode: 'shifts' | 'tilts'

Whether to work on the _shifts or the _tilts of the stack

value: TomoShifts | TomoTilts | ndarray | None

The values to set, as either an array, or TomoShifts, or TomoTilts. If None, the values will be initialized to an array of zeros of the appropriate shape.

Returns:

target – The signal that should be set as either the shifts or tilts property.

Return type:

TomoShifts or TomoTilts

Raises:

ValueError – If the value is not the correct shape for either the shapes or tilts property