.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/vectors/slicing_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_slicing_vectors.py: Operations on Vectors ===================== This example shows how to perform some basic operations slicing and selecting vectors. This is designed to be very flexible and powerful. Many operations such as slicing with a boolean array are supported. Additionally, lazy operations are supported and can be chained together. These are often faster than their non-lazy counterparts as ``dask`` very effectively prunes the computation graph. .. GENERATED FROM PYTHON SOURCE LINES 12-23 .. code-block:: Python import pyxem as pxm import hyperspy.api as hs hs.set_log_level("ERROR") s = pxm.data.tilt_boundary_data() temp = s.template_match_disk(disk_r=5, subtract_min=False) vectors = s.get_diffraction_vectors(threshold_abs=0.4, min_distance=5) .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/33 [00:00 0) * (vectors.ivec[0] < 10)] ).to_markers(color="w", sizes=5, alpha=0.5) s.plot() s.add_marker([all_vectors, slic_vectors]) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/vectors/images/sphx_glr_slicing_vectors_005.png :alt: slicing vectors :srcset: /examples/vectors/images/sphx_glr_slicing_vectors_005.png :class: sphx-glr-multi-img * .. image-sg:: /examples/vectors/images/sphx_glr_slicing_vectors_006.png :alt: Signal :srcset: /examples/vectors/images/sphx_glr_slicing_vectors_006.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/33 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: slicing_vectors.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: slicing_vectors.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_