Asynchronous control framework for smart microscopy. Built on PyTango to be hardware-agnostic.
# Install all dependencies
uv sync
# Start the server stack with a configuration
uv run startup_scripts/run_servers.py --yaml configs/Spectra300.yaml
# Or use the DigitalTwin (no hardware required)
uv run startup_scripts/run_servers.py --yaml configs/DigitalTwin.yamlStart the MCP server in a second terminal for agent/AI integration:
uv run startup_scripts/run_mcp.py --yaml configs/mcp.yamlStart only the segmentation Tango device against an existing Tango/DATA/Tiled stack:
uv run --extra segment startup_scripts/run_segmentation.py --yaml configs/Segmentation.yamlStart the oriented-particle digital twin:
uv run --extra diffraction python startup_scripts/run_servers.py --yaml configs/digital_twin_particles.yamlconfigs/Segmentation.yaml sets compute_device: cuda. On Linux and Windows,
the segment extra installs PyTorch from its CUDA 13.0 package index; macOS
continues to use the normal PyPI build. The launcher fails at startup instead
of silently using the CPU when CUDA is unavailable. Install and verify on the
GPU host before launching:
uv sync --extra segment --reinstall-package torch --reinstall-package torchvision
uv run --extra segment python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available(), torch.cuda.get_device_name() if torch.cuda.is_available() else '')"For interactive GUI-based startup:
uv run startup_guis/server_gui.py
uv run startup_guis/mcp_gui.pyasyncroscopy/
├── data/ # Data management device
├── instruments/ # Hardware device implementations
└── mcp/ # FastMCP server for AI agents
| Config | Purpose |
|---|---|
Spectra300.yaml |
Real Thermo Fisher Spectra 300 setup |
DigitalTwin.yaml |
Simulated microscope for development/testing |
diffraction.yaml |
DigitalTwin with diffraction simulation |
digital_twin_tilt.yaml |
ASE/abTEM multislice silicon lamella tilt twin |
mcp.yaml |
MCP server configuration (not hardware) |
These are some examples of the available configs, which define the instrument class, supporting devices, Tango connection, and Tiled settings.
# Diffraction and tilt-twin multislice simulation (abTEM-based)
uv sync --extra diffraction
# AI agent support (LangChain/OpenAI)
uv sync --extra agent
# Local AI models via HuggingFace transformers (requires --extra agent)
uv sync --extra agent --extra localagentuv run pytest tests/ -v- Abstraction Layer: Instruments are defined as abstract base classes, with specific implementations for different hardware. As such, models can be defined for various microscopes, digital twins, etc.
- Device Orchestration: Supporting devices (camera, EDS, stage, etc.) are initialized first and linked to the instrument via Tango properties.
- Execution Order: The instrument serves as the final integration point, instantiated only after all prerequisite supporting devices are running.
- Data: Data from devices is saved to Tiled.
Refer to the asyncroscopy documentation.
Various example workflows in notebooks/, including:
00_Testing.ipynb- Connection tests01_Aberrations.ipynb- Probe aberration controls02_Image_Acquisition.ipynb- HAADF image acquisition03_Stage_Movement_Sample_Map.ipynb- Stage navigation04_Image_EDS_Point_Spectra.ipynb- EDS spectrum acquisition05_Digital_Twin_EDS.ipynb- DigitalTwin EDS simulation06_Digital_Twin_Tilt.ipynb- DigitalTwin tilt control11_Test_AI_Agent.ipynb- MCP agent testing15_MAPED.ipynb- Multi-angle precession electron diffraction16_Alpha_Tilt_Diffraction_Map.ipynb- Tracked alpha-tilt diffraction mapping
- The previous Twisted-based implementation is preserved in the
twisted-legacybranch for reference.

