How abhijitvshinde/electromagnet works
This is a Windows desktop control application for electromagnet and VNA experiments. The main workflow is: configure and connect instruments, set the mandatory current limit, optionally load or perform a user-confirmed field calibration, define a field sweep, then ramp and measure each point while plotting and saving results. Safety validation gates current commands; experiment data is saved point-by-point and can also produce combined data and plot exports. The README documents these capabilities; some GUI and driver wiring is represented only where explicitly described.
Main entry points: app_context.py Shared context · measurement_controller.py Measurement sequence · power_supply.py Power supply driver · calibration_controller.py Calibration sequence
Components 26
Desktop interface
- Application entry
src/main.py - Main window
src/gui/main_window.py - Shared context
src/gui/app_context.py - Connection tab
src/gui/tabs/connection_tab.py - Safety tab
src/gui/tabs/safety_tab.py - Calibration tab
src/gui/tabs/calibration_tab.py - Sweep tab
src/gui/tabs/sweep_tab.py - Live measurement tab
src/gui/tabs/live_measurement_tab.py - Application configuration
src/config/app_config.py
Experiment workflow
- Calibration sequence
src/calibration/calibration_controller.py - Calibration data
src/calibration/calibration_manager.py - Field sweep planning
src/measurement/sweep.py - Measurement sequence
src/measurement/measurement_controller.py - Current ramping
src/measurement/ramping.py
Instrument control
- Power supply driver
src/drivers/power_supply.py - VNA driver
src/drivers/vna.py - Instrument transport
src/drivers/base_instrument.py - Simulation transports
src/drivers/simulation.py
Results and records
- Experiment data manager
src/data/data_manager.py - Experiment files
- Live and export plots
src/plotting/plot_manager.py - Experiment logging
src/logging_/experiment_logger.py
Safety controls
- Current safety manager
src/safety/safety_manager.py - Voltage monitoring
src/safety/voltage_monitor.py
Other components
- Operator
- GPIB instruments
Connections 38
- Application entry → Main window: launches
- Main window → Shared context: creates shared state
- Shared context → Application configuration: loads settings
- Shared context → Current safety manager: creates
- Shared context → Calibration data: creates
- Shared context → Experiment data manager: creates
- Shared context → Live and export plots: creates
- Shared context → Experiment logging: creates
- Operator → Connection tab: selects instruments
- Connection tab → Power supply driver: connects
- Connection tab → VNA driver: connects
- Power supply driver → Instrument transport: uses transport
- VNA driver → Instrument transport: uses transport
- Instrument transport → GPIB instruments: communicates via GPIB
- Power supply driver → Simulation transports: uses in simulation
- VNA driver → Simulation transports: uses in simulation
- Operator → Safety tab: sets current limit
- Safety tab → Current safety manager: configures
- Safety tab → Voltage monitoring: starts monitoring
- Operator → Calibration tab: loads or enters calibration
- Calibration tab → Calibration sequence: runs sequence
- Calibration tab → Calibration data: loads and saves points
- Calibration sequence → Current ramping: ramps current
- Calibration sequence → Power supply driver: commands and reads current
- Calibration sequence → Calibration data: records confirmed points
- Operator → Sweep tab: configures sweep
- Sweep tab → Field sweep planning: generates sequence
- Sweep tab → Measurement sequence: starts measurement
- Measurement sequence → Current safety manager: checks currents
- Measurement sequence → Current ramping: ramps per point
- Measurement sequence → Power supply driver: sets current and reads status
- Measurement sequence → VNA driver: triggers and fetches traces
- Measurement sequence → Experiment data manager: saves each point
- Measurement sequence → Live and export plots: updates traces
- Power supply driver → Current safety manager: validates before command
- Experiment data manager → Experiment files: writes CSV HDF5 metadata
- Experiment data manager → Live and export plots: exports figures and color maps
- Operator → Live measurement tab: views live traces