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

this saves scalars, update to saving lists better #60

Open
github-actions bot opened this issue Nov 19, 2022 · 0 comments
Open

this saves scalars, update to saving lists better #60

github-actions bot opened this issue Nov 19, 2022 · 0 comments
Labels
good first issue Good for newcomers todo

Comments

@github-actions
Copy link

# 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,
@github-actions github-actions bot added the todo label Nov 19, 2022
@pluflou pluflou added good first issue Good for newcomers todo and removed todo labels Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers todo
Projects
None yet
Development

No branches or pull requests

1 participant