.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/vectors/masking_vectors.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_vectors_masking_vectors.py: Diffraction Vectors to Mask =========================== This example shows how to take a set of vectors and create a mask from a set of circles around each vector. Multiplying by the original signal will remove all the signal except for the circles around the vectors. .. GENERATED FROM PYTHON SOURCE LINES 9-24 .. code-block:: Python import pyxem as pxm import hyperspy.api as hs s = pxm.data.tilt_boundary_data() s.calibration.center = None s.axes_manager[2].scale = 0.3 temp = s.template_match_disk(disk_r=5, subtract_min=False) # Just right vectors = temp.get_diffraction_vectors(threshold_abs=0.4, min_distance=5) mask = vectors.to_mask(disk_r=7) masked_s = s * mask masked_s.plot() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/vectors/images/sphx_glr_masking_vectors_001.png :alt: masking vectors :srcset: /examples/vectors/images/sphx_glr_masking_vectors_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/vectors/images/sphx_glr_masking_vectors_002.png :alt: Signal :srcset: /examples/vectors/images/sphx_glr_masking_vectors_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/51 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: masking_vectors.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: masking_vectors.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_