arista.viz.recording_overview
Plot a multi-cell recording session as a dual-y-axis figure.
One panel per session. The left axis carries temperature (target T
solid, sensor T overlaid thin); the right axis carries ΔF/F₀ per cell.
Cells are colour-coded by type (CC / HC / WC) and graded by cell
number within type, using the colourblind-safe palettes in
arista.constants.
The same callable is used by scripts/preprocess_alex_data.py to
produce a per-session overview PNG during preprocessing and will be
reused by the future database-backed display layer — both consume
the same arista.preprocess.Recording dataclass, so any
data source that loads into a Recording is plottable through this
module.
API:
plot_session_overview()— pure function, primary surfaceSessionOverview— class wrapper carrying default kwargs, useful when many sessions are plotted with the same styling
Functions
|
Plot one recording session as a dual-y-axis figure. |
Classes
|
Callable wrapper around |
- class arista.viz.recording_overview.SessionOverview(figsize=(10, 5), use_drift_corrected=True, show_target=True, show_sensor=True, sensor_alpha=0.55, cell_linewidth=1.0, dpi=200)[source]
Bases:
objectCallable wrapper around
plot_session_overview().Useful when many sessions are rendered with the same styling (e.g. a batch script or the future DB-backed display layer):
plotter = SessionOverview(figsize=(12, 6), use_drift_corrected=True) for session_name, cells in sessions.items(): fig = plotter(cells, title=session_name) plotter.save(fig, output_dir / f"{session_name}.png")
Defaults stored on the instance are forwarded to every call unless overridden in the call’s kwargs.
- Parameters:
- plot(recordings, *, title=None, **overrides)[source]
Build the figure.
overrideswin over instance defaults.
- arista.viz.recording_overview.plot_session_overview(recordings, *, title=None, figsize=(10, 5), use_drift_corrected=True, show_target=True, show_sensor=True, sensor_alpha=0.55, cell_linewidth=1.0)[source]
Plot one recording session as a dual-y-axis figure.
- Parameters:
recordings (dict[str, Recording]) – Mapping
cell_label → Recording. The label is the Fiji ROI filename stem (e.g."l_CC01","HC02"), used both for the legend and for inferring the cell type viaarista.constants.infer_cell_type_from_filename().title (str | None) – Figure suptitle. Typically the recording-directory path.
use_drift_corrected (bool) – If
True(default) and a recording carriesdfbf_drift_corrected, plot that; otherwise fall back to the rawdfbf.show_target (bool) – Plot the target (set-point) temperature trace.
show_sensor (bool) – Overlay the measured sensor temperature trace.
sensor_alpha (float) – Opacity of the sensor overlay.
cell_linewidth (float) – Stroke width of each cell’s ΔF/F trace.
- Returns:
The
matplotlib.figure.Figure. The caller is responsible forsavefig/plt.close— keeping I/O out of this function lets the same code run in batch scripts, notebooks, and the future GUI layer.- Raises:
ValueError – If
recordingsis empty.- Return type:
Figure