def samy_dscan(start, end, points): """ sampley relative scan using the eiger1m_single detector achieves a y motion by combining the incline (diff.xv) and diff.zh calling sequence: samy_dscan(start, end, points) Note - its a relative scan, start and end are relative from current position by YZ, AF Oct 2016 """ from cycler import cycler from bluesky import PlanND initial_xv = diff.xv.user_readback.value initial_zh = diff.xh.user_readback.value suffix = "_stats1_total" det = eiger1m_single angle = 9.0 * np.pi / 180.0 dy_values = np.linspace(start, end, points) xv_values = dy_values / np.sin(angle) + initial_xv zh_values = -1 * dy_values / np.tan(angle) + initial_zh inner = cycler(diff.xv, xv_values) + cycler(diff.xh, zh_values) plan = PlanND([det], inner) RE(plan, [ LiveTable([diff.xv, diff.xh, det]), LivePlot(x='diff_xv', y=det.name + suffix, fig=plt.figure()) ]) diff.xv.set(initial_xv) diff.xh.set(initial_zh)
def refl_scan(incident_angle): from cycler import cycler from bluesky import PlanND det=eiger1m_single inner = cycler(diff.phh,-1*incident_angle)+cycler(diff.gam,-2*incident_angle) plan = PlanND([det],inner) RE(plan, [LiveTable([diff.phh,diff.gam,det]),LivePlot(x='diff_phi',y=det.name+"_stats1_total",fig = plt.figure())]) ### Live plot su$$$s!!! -> plot after the fact... dat=get_table(db[-1]) plt.figure(97) plt.semilogy(dat.diff_phh,dat.eiger1m_single_stats1_total)