.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/setting_parameters/setting_up_stem.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_setting_parameters_setting_up_stem.py: Setting up a STEM Experiment ============================= This script demonstrates how to set up a STEM experiment using the DE API. This script will: 1. Connect to the DE server 2. Set the hardware ROI to 256x256 3. Set the scan size to 256x256 4. Set the number of frames per second to 1000 5. Acquire a STEM image using a HAADF detector .. GENERATED FROM PYTHON SOURCE LINES 13-17 .. code-block:: Python from deapi import Client import sys .. GENERATED FROM PYTHON SOURCE LINES 18-19 Connect to the DE server .. GENERATED FROM PYTHON SOURCE LINES 19-26 .. code-block:: Python client = Client() if not sys.platform.startswith("win"): client.usingMmf = ( False # True if on same machine as DE Server and a Windows machine ) client.connect(port=13240) # connect to the running DE Server .. rst-class:: sphx-glr-script-out .. code-block:: none Command Version: 13 .. GENERATED FROM PYTHON SOURCE LINES 27-30 Set the hardware ROI to 256x256 -------------------------------- In this case we just use the center 256 pixels of the 1024 pixel sensor. .. GENERATED FROM PYTHON SOURCE LINES 30-36 .. code-block:: Python client["Hardware ROI Size X"] = 256 client["Hardware ROI Size Y"] = 256 client["Hardware ROI Offset X"] = 256 client["Hardware ROI Offset Y"] = 256 .. GENERATED FROM PYTHON SOURCE LINES 37-38 Set the scan size to 256x256 .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: Python client.scan(size_x=256, size_y=256, enable="On") .. GENERATED FROM PYTHON SOURCE LINES 41-42 Set the number of frames per second to 1000 .. GENERATED FROM PYTHON SOURCE LINES 42-45 .. code-block:: Python client["Frames Per Second"] = 1000 client.disconnect() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.045 seconds) .. _sphx_glr_download_examples_setting_parameters_setting_up_stem.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: setting_up_stem.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: setting_up_stem.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: setting_up_stem.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_