.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_convergence.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_auto_examples_plot_convergence.py: Probe convergence: spots to disks ================================= The same gold particle in diffraction as the probe converges. Parallel illumination gives spots; nano-beam diffraction gives disks whose radius is the convergence angle; convergent beam disks grow until they overlap. .. GENERATED FROM PYTHON SOURCE LINES 9-33 .. image-sg:: /auto_examples/images/sphx_glr_plot_convergence_001.png :alt: TEM, 0.08 mrad, NBD, 1 mrad, NBD, 3 mrad, CBD, 8 mrad :srcset: /auto_examples/images/sphx_glr_plot_convergence_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from de_twin import DigitalTwin, ManualClock from de_twin.state import ProbeMode, Projection twin = DigitalTwin("Dense Au on holey C", camera="DESim", clock=ManualClock(), seed=3) twin.column.set("Magnification", 150000) feature = twin.specimen.features()[0] twin.column.move_stage(x=-feature.center_um[0], y=-feature.center_um[1]) twin.column.set_projection(Projection.DIFFRACTION) probes = [(ProbeMode.TEM, 3), (ProbeMode.NBD, 1), (ProbeMode.NBD, 4), (ProbeMode.CBD, 2)] fig, axes = plt.subplots(1, 4, figsize=(12, 3.4)) for ax, (mode, alpha) in zip(axes, probes): twin.column.set_probe_mode(mode) twin.column.set_alpha_selector(alpha) dp = np.log1p(twin.flux(twin.request())) ax.imshow(dp, cmap="gray", vmin=np.percentile(dp, 1), vmax=np.percentile(dp, 99.95)) ax.set_title(f"{mode.name}, {twin.optics(twin.request()).convergence_mrad:.2g} mrad", fontsize=9) ax.axis("off") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.536 seconds) .. _sphx_glr_download_auto_examples_plot_convergence.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_convergence.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_convergence.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_convergence.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_