Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds relock_tracking_setup after setup_tracking_params finishes #388

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions sodetlib/operations/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,27 +430,22 @@ def setup_tracking_params(S, cfg, bands, update_cfg=True, show_plots=False):
f, df, sync = S.tracking_setup(band, **tk)
res.add_band_data(band, f, df, sync, tracking_kwargs=tk)

# Print tracking params
d = {
'frac_pp': frac_pp,
'lms_freq_hz': lms_freq,
}
S.log(f"Tracking params found for band {band}: {d}")

# Update det config
if update_cfg:
cfg.dev.update_band(band, {
'frac_pp': frac_pp,
'lms_freq_hz': lms_freq,
}, update_file=True)
cfg.dev.update_band(band, d, update_file=True)

res.save()
is_interactive = plt.isinteractive()
try:
if not show_plots:
plt.ioff()
fig, ax = plot_tracking_summary(res)
path = sdl.make_filename(S, 'tracking_results.png', plot=True)
fig.savefig(path)
S.pub.register_file(path, 'tracking_summary', plot=True, format='png')
if not show_plots:
plt.close(fig)
finally:
if is_interactive:
plt.ion()

S.log("Running relock tracking setup...")
res = relock_tracking_setup(S, cfg, bands=bands, show_plots=show_plots)

return res


Expand Down
Loading