-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
PyEmittance/pyemittance/wire_io.py
Line 53 in 3862eff
| # TODO: this saves scalars, update to saving lists better |
opt_pvs = opt_pv_info['opt_vars']
savepaths = config_dict['savepaths']
pv_savelist = config_dict['save_scalar_pvs']
# Measurement PVs
meas_pv_info = config_dict['meas_pv_info']
# BS in meters for emittance calc
if not multiwire:
scan_pv = [PV(meas_pv_info['diagnostic']['pv']['scan'])]
x_size_pv = [PV(meas_pv_info['diagnostic']['pv']['xsize'])]
y_size_pv = [PV(meas_pv_info['diagnostic']['pv']['ysize'])]
else:
# lists of PVs
scan_pv = [PV(wire_pv) for wire_pv in meas_pv_info['diagnostic']['pv']['scan']]
x_size_pv = [PV(x_pv) for x_pv in meas_pv_info['diagnostic']['pv']['xsize']]
y_size_pv = [PV(y_pv) for y_pv in meas_pv_info['diagnostic']['pv']['ysize']]
# run wire scans
# if multiwire, runs them back to back
error_dict = get_beamsize(online=online, scan_pv=scan_pv)
# Get list of results
xrms, yrms = [], []
xrms_err, yrms_err = [], []
for x_pv, y_pv in zip(x_size_pv, y_size_pv):
# read in PVs, returned in um
xrms.append(x_pv.get()*1e-6)
yrms.append(y_pv.get()*1e-6)
# add some error estimate, no PV that returns this as of 11/2022
xrms_err.append(xrms*0.02)
yrms_err.append(yrms*0.02)
# TODO: this saves scalars, update to saving lists better
if save_summary:
timestamp = (datetime.datetime.now()).strftime("%Y-%m-%d_%H-%M-%S-%f")
save_config(xrms,