How benschneider/generic-sweepscript works
Project type and purpose
• This is a measurement‐automation and data‐acquisition tool written in Python.
• It provides instrument driver abstractions (e.g., for Yokogawa source, VNA, Keithley, etc.), sweep orchestration scripts (e.g., Gsweep, AfDigi, etc.), data‐storage routines, and post‐processing helpers (covfunc, IQcorr).
File structure
Top‐level files and directories fall into these categories:
• Instrument drivers: AgilentPSG.py, Yoko.py, RSZNB20.py, keithley2000.py, …
• Sweep scripts / orchestration: Gsweep*.py, AfDigi.py, D1D2meastype.py, …
• Data storage & file format: DataStorer.py, parsers.py, covfunc.py, histogram.py
• Runner / entry point: run_scripts.bat, Sim928.py (simulated driver)
• Documentation: doc/ (Sphinx source and generated HTML)
• Utilities & wrappers: PXIDigitizer_wrapper.py, dummydriver.py, ramp_mod.py
README for additional insights
• Sweeps both a Yokogawa source and a VNA in CW mode.
• VNA manual settings are required outside of automation.
• Outputs an *.mtx file: a header + 3D NumPy binary array.
• Data is visualized by an external tool, “spyview.”
Main components & interactions
a. Instrument‐Control Layer
• Each driver module connects to a hardware device via VISA/SCPI.
• Drivers expose a uniform API: set voltage/frequency, trigger sweep, read data.
b. Sweep Orchestrator
• Entry scripts (e.g., GsweepSN11.py) import drivers, coordinate multi‐instrument sweeps.
• Loop over parameters, collect raw measurements.
c. Data‐Storage Layer
• DataStorer.py implements the .mtx writer (header + binary NumPy array).
• Parsers.py & covfunc.py provide readback and analysis functions.
d. Post‐Processing / Visualization
• External “spyview” tool reads .mtx.
• Local helper modules (histogram.py, IQcorr.py) can preprocess data before plotting.
e. Documentation
• Sphinx docs under doc/ illustrate driver usage and API.
Architectural patterns & design principles
• Layered design: hardware‐abstraction → orchestration → storage → analysis/visualization.
• Single‐process, procedural orchestration; each sweep script is a controller.
• Reusable driver modules for each instrument.
• Separation of concerns: DataStorer solely handles file I/O; parsers handle reading.