Check out the Hyperspy Workshop May 13-17, 2024 Online

flip_diffraction_y#

Diffraction2D.flip_diffraction_y()[source]#

Flip the dataset along the diffraction y-axis.

The function returns a new signal, but the data itself is a view of the original signal. So changing the returned signal will also change the original signal (and visa versa). To avoid changing the original signal, use the deepcopy method afterwards, but note that this requires double the amount of memory. See below for an example of this.

Returns:

flipped_signal

Return type:

Diffraction2D signal

Example

>>> s = pxm.data.dummy_data.get_holz_simple_test_signal()
>>> s_flip = s.flip_diffraction_y()

To avoid changing the original object afterwards

>>> s_flip = s.flip_diffraction_y().deepcopy()