.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_detector_references.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_detector_references.py: Raw frames and references ========================= The detector model adds what a DE camera adds: a dark offset with fixed pattern, read noise, shot noise, gain non-uniformity and defects. Integrated images are dark- and gain-corrected with references the twin measures, the way DE-Server delivers them. .. GENERATED FROM PYTHON SOURCE LINES 9-35 .. image-sg:: /auto_examples/images/sphx_glr_plot_detector_references_001.png :alt: dark frame (ADU), one raw 25 ms frame (ADU), 1 s corrected (electrons) :srcset: /auto_examples/images/sphx_glr_plot_detector_references_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/de-twin/de-twin/.venv/lib/python3.13/site-packages/diffsims/utils/discretise_utils.py:86: SyntaxWarning: invalid escape sequence '\m' .. math:: y\mapsto sum_i a[i]*exp(-b[i]*|y|^2) /home/runner/work/de-twin/de-twin/.venv/lib/python3.13/site-packages/diffsims/utils/discretise_utils.py:616: SyntaxWarning: invalid escape sequence '\m' Continuous atom is represented by: `y\mapsto sum_i a[i]*exp(-b[i]*|y|^2)` | .. code-block:: Python import matplotlib.pyplot as plt from de_twin import DigitalTwin, ExposureMode, ManualClock twin = DigitalTwin("Dense Au on holey C", camera="DESim", clock=ManualClock(), seed=3) twin.column.set("Magnification", 20000) feature = twin.specimen.features()[0] twin.column.move_stage(x=-feature.center_um[0], y=-feature.center_um[1]) dark = twin.raw_frame(0.025, exposure_mode=ExposureMode.DARK) raw = twin.raw_frame(0.025) corrected = twin.snap(1.0) # 40 frames at 40 fps, corrected, in electrons fig, axes = plt.subplots(1, 3, figsize=(10, 3.6)) panels = [ (dark, "dark frame (ADU)"), (raw, "one raw 25 ms frame (ADU)"), (corrected, "1 s corrected (electrons)"), ] for ax, (img, title) in zip(axes, panels): ax.imshow(img, cmap="gray", vmin=img.mean() - 3 * img.std(), vmax=img.mean() + 3 * img.std()) ax.set_title(title, fontsize=9) ax.axis("off") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 35.195 seconds) .. _sphx_glr_download_auto_examples_plot_detector_references.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_detector_references.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_detector_references.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_detector_references.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_