autoemx.microscope_drivers package
Electron Microscope Driver Loader
This module provides a function to dynamically load and inject microscope-specific driver parameters and functions for SEM operation from the ‘microscope_drivers’ directory.
- Usage from other modules:
from autoemx import EM_driver EM_driver.load_microscope_driver(microscope_ID=’PhenomXL’)
Author: Andrea Giunto Created on: Mon Jan 20 15:40:42 2025
- autoemx.microscope_drivers.load_microscope_driver(microscope_ID: str) None[source]
Dynamically load driver parameters and functions for a given microscope.
This function imports all public attributes from the driver file of the microscope (located inside the microscope_drivers directory) and injects them into the current module’s namespace. The driver file is ‘{microscope_ID}.py’, unless the detector model of the microscope (autoemx/calibrations/<microscope_ID>/detector_model.json) names another driver, shared by instruments of the same model.
- Parameters:
(str) (microscope_ID)
- Raises:
ValueError – If the driver file cannot be found or imported.:
Warning
This function injects variables and functions into the module namespace. Use with care to avoid name collisions.
- autoemx.microscope_drivers.get_active_driver_module() ModuleType[source]
Return currently loaded microscope driver module.
- autoemx.microscope_drivers.connect_to_microscope(warn_if_unavailable: bool = True) bool[source]
Connect using the active driver, if supported.
- autoemx.microscope_drivers.is_microscope_connected() bool[source]
Return True if the active driver reports a live microscope connection.
Submodules
- autoemx.microscope_drivers.PhenomXL module
- Electron Microscope Driver
is_microscope_connected()connect_to_microscope()frame_rel_to_pixel_coords()frame_pixel_to_rel_coords()standby()set_electron_detector_mode()activate()to_SEM()set_high_tension()set_beam_current()get_EDS_analyser_object()acquire_XS_spectral_data()auto_focus()auto_contrast_brightness()adjust_focus()move_to()move_by()get_position()get_frame_width()get_range_frame_width()set_frame_width()get_image_data()set_brightness()set_contrast()get_current_wd()to_nav()get_navigation_camera_image()