Skip to content

Commit f54c7ff

Browse files
committed
capping maximum number of points to use for plotting
1 parent 2a20c54 commit f54c7ff

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/qibocal/protocols/ramsey/processing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
from .acquisition import RamseyResults
2525

26+
MAXIMUM_FIT_POINTS = 1_000
27+
"""maximum number of points to use when plotting fit results."""
28+
2629
POPT_EXCEPTION = [0, 0, 0, 0, 1]
2730
"""Fit parameters output to handle exceptions"""
2831
PERR_EXCEPTION = [1] * 5
@@ -168,7 +171,9 @@ def fit_plot(
168171
) -> str:
169172
"""Generate the fit trace and summary table for Ramsey data."""
170173

171-
fit_waits = np.linspace(min(waits), max(waits), 20 * len(waits))
174+
fit_waits = np.linspace(
175+
min(waits), max(waits), min(20 * len(waits), MAXIMUM_FIT_POINTS)
176+
)
172177
fig.add_trace(
173178
go.Scatter(
174179
x=fit_waits,

src/qibocal/protocols/ramsey/zz_coupling.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
execute_experiment,
1717
ramsey_sequence,
1818
)
19-
from .processing import fitting, process_fit, ramsey_fit, ramsey_update
19+
from .processing import (
20+
MAXIMUM_FIT_POINTS,
21+
fitting,
22+
process_fit,
23+
ramsey_fit,
24+
ramsey_update,
25+
)
2026

2127
__all__ = ["ramsey_zz"]
2228

@@ -188,7 +194,9 @@ def zz_fit_plot(
188194
waits: npt.NDArray,
189195
fig: go.Figure,
190196
) -> str:
191-
fit_waits = np.linspace(min(waits), max(waits), 20 * len(waits))
197+
fit_waits = np.linspace(
198+
min(waits), max(waits), min(20 * len(waits), MAXIMUM_FIT_POINTS)
199+
)
192200

193201
fig.add_trace(
194202
go.Scatter(

0 commit comments

Comments
 (0)