Stanza automatically logs your measurement data in both HDF5 and JSON formats. You don’t need to write separate logging code for each routine - just pass a DataLogger to RoutineRunner and your sweep data, parameters, and analysis results are saved automatically.
Enable logging in three steps:
Your data is saved to ./data/characterization/<session_id>/ with both HDF5 and JSONL files.
When you use device.sweep_1d() or device.sweep_2d() with a session parameter, Stanza logs:
Example - this routine automatically logs everything:
When you run this:
Stanza automatically logs:
v_data)i_data)gate="LEFT_BARRIER", v_start=-2.0, etc.Data is organized by routine and session:
Each time you run a routine, a new session directory is created with a timestamp.
HDF5 is great for numerical analysis:
JSON Lines are easier for quick inspection:
For measurements beyond simple sweeps, log custom data manually:
The analysis results are saved alongside the sweep data.
Here’s a complete example of measuring and logging a charge stability diagram:
Run and analyze:
For large datasets, enable compression:
gzip: Best compression (slower) lzf: Fast compression (larger files) None: No compression (fastest)
For a 200×200 charge diagram:
Log data from multiple routines in the same session:
All three measurements are saved in the same session directory.
Process multiple sessions at once:
Use both HDF5 and JSONL: HDF5 for analysis scripts, JSONL for quick inspection.
Enable compression for large sweeps: A 200×200 charge diagram compresses 3-4x.
Log analysis results: Don’t just save raw data - save what you learned from it.
Use descriptive routine names: routine_name becomes your top-level directory. Use names like "device_42_characterization" rather than generic names like "test".
Add metadata to analysis: Include information that will help you interpret results later:
Flush periodically for long measurements: Force data to disk during long routines:
Check disk space: HDF5 files can get large. A full day of measurements might generate several GB.