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