How hz-b/kiwi-scan works
kiwi-scan is a configurable EPICS scan framework. Its principal workflow loads YAML and scan dimensions, constructs a selected scan engine, coordinates actuator motion or observation with synchronized detector acquisition, assembles point data, and writes timestamped results and optional metadata. Separate capabilities cover plugins, event-driven triggers and subscriptions, monitoring, export, manifests, and IOC/PVA integration. The README and source index establish the broad feature map; several subsystem connections below are documented rather than verified from complete implementation excerpts.
Main entry points: common.py Scan coordination · tools.py Scan construction API · scan_runner.py Scan runner · controller.py Generic scan IOC
Components 26
Scan execution
- YAML configuration
src/kiwi_scan/yaml_loader.py - Scan configuration models
src/kiwi_scan/datamodels.py - Scan runner
src/kiwi_scan/cli/scan_runner.py - Scan construction API
src/kiwi_scan/scan/tools.py - Scan type registry
src/kiwi_scan/scan/registry.py - Scan engines
src/kiwi_scan/scan_concrete - Scan coordination
src/kiwi_scan/scan/common.py - Point data pipeline
src/kiwi_scan/scan/point_pipeline.py
Devices and acquisition
- Acquisition synchronization
src/kiwi_scan/scan/sync_controller.py - Actuator factory
src/kiwi_scan/actuator/factory.py - Actuator backends
src/kiwi_scan/actuator_concrete - EPICS PV access
src/kiwi_scan/epics_wrapper.py - Subscriptions and event routing
src/kiwi_scan/scan/subscription_manager.py - Scan triggers
src/kiwi_scan/scan/trigger_manager.py
Runtime extensions
- Plugin framework
src/kiwi_scan/plugin/base.py - Plugin registry
src/kiwi_scan/plugin/registry.py - Built-in plugins
src/kiwi_scan/plugin_concrete
Results and insight
- Scan file output
src/kiwi_scan/scan/output_manager.py - Manifest file management
src/kiwi_scan/data/manifestwriter.py - Scan data loading
src/kiwi_scan/data/loader.py - SPEC and data export
src/kiwi_scan/export/spec.py - Live monitors and plots
src/kiwi_scan/monitor_concrete/queue_plotter.py - Statistics and diagnostics
src/kiwi_scan/scan/stats_collector.py
Control-system interfaces
- Generic scan IOC
src/kiwi_scan/ioc/controller.py - PVA table server
src/kiwi_scan/ioc/pva_table.py
Other components
- Engineer / API caller
Connections 29
- Engineer / API caller → Scan runner: runs scan
- Engineer / API caller → Scan construction API: calls API
- YAML configuration → Scan configuration models: parses into
src/kiwi_scan/yaml_loader.py - Scan runner → YAML configuration: loads
src/kiwi_scan/cli/scan_runner.py - Scan runner → Scan construction API: constructs scan
src/kiwi_scan/cli/scan_runner.py - Scan construction API → Scan type registry: selects type
src/kiwi_scan/scan/tools.py - Scan type registry → Scan engines: registers built-ins
src/kiwi_scan/scan/registry.py - Scan construction API → Scan coordination: creates scan
src/kiwi_scan/scan/tools.py - Scan engines → Scan coordination: uses coordination
src/kiwi_scan/scan_concrete/para.py - Scan coordination → Point data pipeline: assembles points
src/kiwi_scan/scan/common.py - Scan coordination → Actuator factory: creates actuators
src/kiwi_scan/scan/common.py - Actuator factory → Actuator backends: builds backend
src/kiwi_scan/actuator/factory.py - Actuator backends → EPICS PV access: uses PV access
src/kiwi_scan/actuator_concrete/single_epics.py - Scan coordination → Acquisition synchronization: synchronizes acquisition
src/kiwi_scan/scan/common.py - Scan coordination → Subscriptions and event routing: routes events
src/kiwi_scan/scan/common.py - Scan coordination → Scan triggers: fires triggers
src/kiwi_scan/scan/common.py - Scan coordination → Plugin registry: loads plugins
src/kiwi_scan/scan/common.py - Plugin registry → Built-in plugins: registers plugins
src/kiwi_scan/plugin/registry.py - Plugin framework → Scan coordination: accesses scan context
- Point data pipeline → Scan file output: provides point rows
- Scan file output → Manifest file management: records scan files
- Scan runner → Manifest file management: manages manifest
src/kiwi_scan/cli/scan_runner.py - Scan data loading → SPEC and data export: supplies scan data
- Scan coordination → Live monitors and plots: publishes monitor data
- Scan coordination → Statistics and diagnostics: collects statistics
- Engineer / API caller → Generic scan IOC: controls scans
- Generic scan IOC → Scan construction API: creates scan
src/kiwi_scan/ioc/controller.py - Generic scan IOC → Manifest file management: creates manifest
src/kiwi_scan/ioc/controller.py - PVA table server → Scan coordination: publishes scan data