Coordinates in Pyxem#

Pyxem is flexible in how it handles coordinates for a diffraction pattern.

There are three main ways to handle coordinates in Pyxem:

  1. Pixel coordinates

  2. Calibrated Coordinates with evenly spaced axes

  3. Calibrated Coordinates with unevenly spaced axes (e.g. corrected for the Ewald sphere)

[10.0, 10.0]
s.plot(axes_ticks=True)
Signal

From the plot above you can see that hyperspy automatically sets the axes ticks to be centered on each pixel. This means that for a 21x21 pixel image, the center is at (-10, -10) in pixel coordinates. if we change the scale using the calibration function it will automatically adjust the center. Here it is now (-1, -1)

Signal
[10.0, 10.0]

Azimuthal Integration#

Now if we do integrate this dataset it will choose the appropriate center based on the center pixel.

az = s.get_azimuthal_integral2d(npt=30)
az.plot()
Signal
  0%|          | 0/2 [00:00<?, ?it/s]
 50%|█████     | 1/2 [00:02<00:02,  2.66s/it]
100%|██████████| 2/2 [00:02<00:00,  1.33s/it]

Non-Linear Axes#

Now consider the case where we have non-linear axes. In this case the center is still (10,10) but things are streatched based on the effects of the Ewald Sphere.

  • Signal
  • Signal
[np.int64(10), np.int64(10)]

  0%|          | 0/2 [00:00<?, ?it/s]
100%|██████████| 2/2 [00:00<00:00, 1491.84it/s]

sphinx_gallery_thumbnail_number = 4

Total running time of the script: (0 minutes 7.773 seconds)

Gallery generated by Sphinx-Gallery