use builtin strobe for energy plot

This commit is contained in:
valentin.boettcher@mailbox.tu-dresden.de 2023-07-24 15:23:11 -04:00
parent 4c7f146f47
commit e5c8f0e70f
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
2 changed files with 9 additions and 5 deletions

View file

@ -348,7 +348,7 @@ def full_report(model):
def plot_energy(model):
f, a = pu.plot_energy_overview(
model,
strobe_frequency=model.Ω,
strobe_data=model.strobe,
hybrid=True,
bath_names=["cold", "hot"],
online=True,

View file

@ -229,21 +229,25 @@ def plot_with_σ(
bath=None,
strobe_frequency=None,
strobe_tolerance=1e-3,
strobe_data=None,
hybrid=False,
**kwargs,
):
err = (y.σ[bath] if bath is not None else y.σ).real
y_final = transform(y.value[bath] if bath is not None else y.value)
strobe_mode = strobe_frequency is not None
strobe_mode = strobe_frequency is not None or strobe_data
strobe_indices = None
strobe_times = None
strobe_style = dict(linestyle="none", marker="o", markersize=2) | kwargs
if strobe_mode:
strobe_times, strobe_indices = ut.strobe_times(
x, strobe_frequency, strobe_tolerance
)
if strobe_data:
strobe_times, strobe_indices = strobe_data
else:
strobe_times, strobe_indices = ut.strobe_times(
x, strobe_frequency, strobe_tolerance
)
line = ax.errorbar(
strobe_times,