calamari.plot.plot_smoothing_scan#
- calamari.plot.plot_smoothing_scan(scan, *, sweep_id, signal=None, representation='d2ydx2', ax=None, cmap=None, **style)#
Draw one smoothed representation of a sweep at every window of a scan.
The picture behind
scan_smoothing()’s tables: one line per declared window, fromscan.at(window).curve(sweep_id, signal), coloured along a sequential colour map in window order, narrowest first. A slope change’s curvature extremum stays put as the window widens while its height falls, and the noise around it falls faster; a noise feature moves, flips sign or vanishes.The curves are not normalised. They share one unit, and the change of amplitude with the window is the information: a narrow window’s curvature is tall and noisy, a wide one’s low and smooth. Scaling each to one height would hide both that and the noise level each window’s significance is measured against. When the widest window’s curve is too flat to read beside the narrowest, set the y-limits or split the windows over two axes; do not rescale.
Two windows that clamped to one point count on this sweep (see
scan_smoothing()) draw identical curves, and the later one covers the earlier.scan.params['resolved_together']lists them.- Parameters:
scan (
SmoothingScanResult) – Fromscan_smoothing().sweep_id (
int) – The sweep, as in the scan’strackstable. Required: a scan is usually of a family.signal (
str|None) – The searched signal;Nonetakes the sweep’s only one.representation (
str) – As forplot_detection_curve(). The default is the curvature, the representation whose significance depends most on the window.ax (
Axes|None) – Draw into these axes; omitted, a new single-axes figure is created.cmap (
Any|None) – The sequential map the windows are coloured along, the narrowest window at its low end and the widest at its high end.None(the default) takesrcParams['image.cmap'], so acalamari.stylelook applies its own map.**style (
Any) – Forwarded toax.plotfor every line.color=andlabel=are refused by name: the window sets both.
- Return type:
- Returns:
matplotlib.axes.Axes– The axes drawn into. Each line’s label names its window ('window 1.5 K'), for a legend you call.- Raises:
PlotInputError – For an unknown
representation;'dyT_dT'when the scan did not run Fisher; asweep_idorsignalthe scan did not search (naming those it did), or a sweep skipped at some window;color=orlabel=instyle; and axes whose calamari label names another unit (seeplot_detection_curve()). Every refusal comes before anything is drawn.calamari.exceptions.CurveInputError – A requested curve is unavailable at a declared scan window; also a
ValueError.