diff --git a/config/config.properties b/config/config.properties index cd712e1..d8b6ed1 100755 --- a/config/config.properties +++ b/config/config.properties @@ -1,4 +1,4 @@ -#Fri Sep 14 08:42:13 CEST 2018 +#Wed Feb 06 10:42:47 CET 2019 autoSaveScanData=true commandExecutionEvents=false createSessionFiles=false @@ -20,6 +20,7 @@ logLevel=Fine logLevelConsole=Off logPath={logs}/{date}_{time} notificationLevel=null +saveCommandStatistics=false scanDataRelease=false scanStreamerPort=-1 scanStreamingPort=-1 diff --git a/config/setup.properties b/config/setup.properties index 5cadb80..5760c44 100755 --- a/config/setup.properties +++ b/config/setup.properties @@ -1,7 +1,8 @@ -#Fri Sep 09 14:11:02 CEST 2016 +#Tue Dec 18 10:08:26 CET 2018 configFile={config}/config.properties configFileDevices={config}/devices.properties configFilePlugins={config}/plugins.properties +configFileSettings={config}/settings.properties configFileTasks={config}/tasks.properties configFileUpdateStrategy={config}/update.properties configPath={home}/config diff --git a/devices/Beam phase.properties b/devices/Beam phase.properties index 0599f85..de01f13 100644 --- a/devices/Beam phase.properties +++ b/devices/Beam phase.properties @@ -1,9 +1,9 @@ -#Thu Sep 13 16:59:40 CEST 2018 +#Thu Jan 10 11:28:28 CET 2019 maxValue=360.0 -minValue=-360.0 +minValue=-90.0 offset=0.0 -precision=3 -resolution=0.1 +precision=4 +resolution=0.5 rotation=true scale=1.0 sign_bit=0 diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 59186fb..c9f30dd 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,17 +1,17 @@ -#Mon Nov 26 09:44:10 CET 2018 +#Mon Mar 04 13:47:17 CET 2019 \u0000= \u0000\u0000\u0000\u0000= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000= colormap=Flame colormapAutomatic=true colormapLogarithmic=false -colormapMax=3680.0 -colormapMin=76.0 +colormapMax=18000.0 +colormapMin=0.0 flipHorizontally=false flipVertically=false grayscale=false -imageHeight=2160 -imageWidth=2560 +imageHeight=1024 +imageWidth=1280 invert=false regionStartX=1 regionStartY=1 @@ -25,10 +25,10 @@ rotation=0.0 rotationCrop=false scale=1.0 serverURL=null -spatialCalOffsetX=-861.4939970777481 -spatialCalOffsetY=-820.4883730911062 -spatialCalScaleX=-18.90359092620482 -spatialCalScaleY=-19.37984500632817 +spatialCalOffsetX=-50.03903200624512 +spatialCalOffsetY=-50.048780487804876 +spatialCalScaleX=-1.0 +spatialCalScaleY=-1.0 spatialCalUnits=null t= transpose=false diff --git a/devices/Image Averager.properties b/devices/Image Averager.properties index 1309a17..5cc86fd 100644 --- a/devices/Image Averager.properties +++ b/devices/Image Averager.properties @@ -1,12 +1,17 @@ -#Tue Jul 24 05:27:46 CEST 2018 +#Fri Mar 01 00:21:13 CET 2019 colormap=Flame -colormapAutomatic=false -colormapMax=2000.0 +colormapAutomatic=true +colormapLogarithmic=false +colormapMax=10000.0 colormapMin=0.0 flipHorizontally=false flipVertically=false grayscale=false +imageHeight=494 +imageWidth=659 invert=false +regionStartX=0 +regionStartY=0 rescaleFactor=1.0 rescaleOffset=0.0 roiHeight=-1 @@ -16,9 +21,9 @@ roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -spatialCalOffsetX=88.97726578456339 -spatialCalOffsetY=-97.2092928484633 -spatialCalScaleX=-0.766283555464311 -spatialCalScaleY=-0.7662836119186046 +spatialCalOffsetX=-415.6307007415859 +spatialCalOffsetY=-213.43204623518318 +spatialCalScaleX=-15.057748904706497 +spatialCalScaleY=-11.764705882352942 spatialCalUnits=null transpose=false diff --git a/devices/WireScanner motor.properties b/devices/WireScanner motor.properties index ad51352..72aa027 100644 --- a/devices/WireScanner motor.properties +++ b/devices/WireScanner motor.properties @@ -1,5 +1,5 @@ -#Sun Nov 25 18:06:59 CET 2018 -defaultSpeed=50.0 +#Thu Dec 13 16:46:27 CET 2018 +defaultSpeed=6000.0 estbilizationDelay=0 hasEnable=false homingType=None diff --git a/devices/cam_server.properties b/devices/cam_server.properties index c2d627c..a83da38 100644 --- a/devices/cam_server.properties +++ b/devices/cam_server.properties @@ -1,4 +1,4 @@ -#Thu Nov 22 19:50:32 CET 2018 +#Thu Feb 28 23:25:52 CET 2019 colormap=Flame colormapAutomatic=true colormapLogarithmic=false diff --git a/devices/pipeline_server.properties b/devices/pipeline_server.properties index 8ff570e..bac24a3 100644 --- a/devices/pipeline_server.properties +++ b/devices/pipeline_server.properties @@ -1,6 +1,7 @@ -#Tue Apr 24 11:42:23 CEST 2018 +#Tue Dec 18 10:10:12 CET 2018 colormap=Flame colormapAutomatic=true +colormapLogarithmic=false colormapMax=NaN colormapMin=NaN flipHorizontally=false @@ -16,8 +17,8 @@ roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -spatialCalOffsetX=-50.075987841945285 -spatialCalOffsetY=-50.10141987829615 +spatialCalOffsetX=-50.03903200624512 +spatialCalOffsetY=-50.048780487804876 spatialCalScaleX=-1.0 spatialCalScaleY=-1.0 spatialCalUnits=mm diff --git a/plugins/ScreenPanel3.java b/plugins/ScreenPanel3.java index e6b7662..82f553c 100644 --- a/plugins/ScreenPanel3.java +++ b/plugins/ScreenPanel3.java @@ -2211,8 +2211,9 @@ public class ScreenPanel3 extends Panel { message.append("Filter: ").append(String.valueOf(valueFilter.getLabel().getText())).append("\n"); message.append("Data file: ").append(getContext().getExecutionPars().getPath()).append("\n"); message.append("Comment: ").append(textComment.getText()).append("\n"); - if ((fitOv != null) && (fitOv.length > 5)) { - Overlays.Text text = (Overlays.Text) fitOv[5]; + //Add slicing message + if ((fitOv != null) && (fitOv.length > 5) && (fitOv[fitOv.length-1] instanceof Overlays.Text)) { + Overlays.Text text = (Overlays.Text) fitOv[fitOv.length-1]; message.append(text.getText()).append("\n"); } elog((String) comboLogbook.getSelectedItem(), "ScreenPanel Snapshot", message.toString(), new String[]{snapshotFile}); diff --git a/script/Diagnostics/ICT_timing_fine.py b/script/Diagnostics/ICT_timing_fine.py index 4160b16..4aee031 100644 --- a/script/Diagnostics/ICT_timing_fine.py +++ b/script/Diagnostics/ICT_timing_fine.py @@ -2,8 +2,8 @@ import ch.psi.pshell.epics.ChannelDouble as ChannelDouble dry_run = False do_elog = True -base_name = "SATDI01-DICT344" # SINEG01-DICT009 S10DI01-DICT113 SARMA01-DICT482 SARBD01-DICT599 -dev_name = "SATDI01-DICT020" # SINEG01-DICT215 S10DI01-DICT025 SARMA01-DICT090 SARBD01-DICT030 +base_name = "SARBD01-DICT599" # SINEG01-DICT009 S10DI01-DICT113 SARMA01-DICT482 SARBD01-DICT599 SATDI01-DICT344 +dev_name = "SARBD01-DICT030" # SINEG01-DICT215 S10DI01-DICT025 SARMA01-DICT090 SARBD01-DICT030 SATDI01-DICT020 run("CPython/wrapper") @@ -12,9 +12,9 @@ if dry_run: q = ChannelDouble("charge (pC)", "SINEG01-DICT215:AL1-ICT-CHARGE-SIM") V = ChannelDouble("DC output (V)", "SINEG01-DICT215:AL1-ICT-VOLTAGE-SIM") else: - t = ChannelDouble("fine delay (ns)", base_name + "-EVR0:UnivDlyModule0-Delay0-SP") - q = ChannelDouble("charge (pC)", dev_name + ":B1_CHARGE") - V = ChannelDouble("DC output (V)", dev_name + ":B1_VOLTAGE") + t = ChannelDouble("fine delay (ns)", base_name + "-EVR0:UnivDlyModule0-Delay1-SP") + q = ChannelDouble("charge (pC)", dev_name + ":B2_CHARGE") + V = ChannelDouble("DC output (V)", dev_name + ":B2_VOLTAGE") t.initialize() q.initialize() @@ -22,8 +22,8 @@ V.initialize() t0 = t.read() -start = 2.2 -stop = 12 +start = 5 +stop = 10 step = 0.1 nb = 5 lat = 0.150 diff --git a/script/Diagnostics/ICT_timing_rough.py b/script/Diagnostics/ICT_timing_rough.py index 46da05e..51fac3a 100644 --- a/script/Diagnostics/ICT_timing_rough.py +++ b/script/Diagnostics/ICT_timing_rough.py @@ -10,9 +10,9 @@ if dry_run: q = ChannelDouble("charge (pC)", "SINEG01-DICT215:AL1-ICT-CHARGE-SIM") V = ChannelDouble("DC output (V)", "SINEG01-DICT215:AL1-ICT-VOLTAGE-SIM") else: - t = ChannelDouble("delay (us)", base_name + "-EVR0:Pul0-Delay-SP") - q = ChannelDouble("charge (pC)", dev_name + ":B1_CHARGE") - V = ChannelDouble("DC output (V)", dev_name + ":B1_VOLTAGE") + t = ChannelDouble("delay (us)", base_name + "-EVR0:Pul1-Delay-SP") + q = ChannelDouble("charge (pC)", dev_name + ":B2_CHARGE") + V = ChannelDouble("DC output (V)", dev_name + ":B2_VOLTAGE") t.initialize() q.initialize() @@ -20,10 +20,10 @@ V.initialize() t0 = t.read() -start = 1002.140 -stop = 1002.22 -step = 0.002 -nb = 4 +start = 1002.170 +stop = 1002.200 +step = 0.001 +nb = 5 lat = 0.150 plt = plot(None, title="Output")[0] diff --git a/script/181011_1004_MKDCscanAllAT.py b/script/GenericScans/181011_1004_MKDCscanAllAT.py similarity index 100% rename from script/181011_1004_MKDCscanAllAT.py rename to script/GenericScans/181011_1004_MKDCscanAllAT.py diff --git a/script/181011_1011_MKDCACscanAllAT.py b/script/GenericScans/181011_1011_MKDCACscanAllAT.py similarity index 100% rename from script/181011_1011_MKDCACscanAllAT.py rename to script/GenericScans/181011_1011_MKDCACscanAllAT.py diff --git a/script/GenericScans/190124_orbitScanCDR.py b/script/GenericScans/190124_orbitScanCDR.py new file mode 100644 index 0000000..5155103 --- /dev/null +++ b/script/GenericScans/190124_orbitScanCDR.py @@ -0,0 +1,57 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("BPM-X", "S10MA01-DBPM060:X-REF-FB ") +S1 = ChannelDouble("LLM1", "S10CB09-DLLM110:CH7_LOSS-MPS_REL_L1") +S2 = ChannelDouble("LLM2", "S10CB09-DLLM110:CH8_LOSS-MPS_REL_L1") +S3 = ChannelDouble("BLM", "S20CB02-DBLM435:B1_LOSS_MPS_REL_L1") +S4 = ChannelDouble("DRPS", "SGE-EDRPS01-DU0601:DOSE-REL-OP") +S5 = ChannelDouble("CDR", "S10MA01-DCDR080:AL1-B1") +A1.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S4.initialize() +S5.initialize() +A1_init = A1.read() +A1i = -1.0 +A1f = 1.0 +step = 21 +lat = 0.11 +nav = 10 +plt = plot(None, title="Output")[0] +plt.clear() +plt.setStyle(plt.Style.ErrorY) +plt.addSeries(LinePlotErrorSeries("Sensor1", Color.red)) +def after_sample(record, scan): + plt.getSeries(0).appendData(record.positions[0], record.values[0].mean, record.values[0].stdev) +try: + S1_averager = create_averager(S1, nav, lat) + S2_averager = create_averager(S2, nav, lat) + S2_averager.monitored=True + S3_averager = create_averager(S3, nav, lat) + S3_averager.monitored=True + S4_averager = create_averager(S4, nav, lat) + S4_averager.monitored=True + S5_averager = create_averager(S5, nav, lat) + S5_averager.monitored=True + A1.write(A1i) + time.sleep(1.0) + r = lscan(A1, (S1_averager, S2_averager, S3_averager, S4_averager, S5_averager), A1i, A1f, step, latency=0.5, after_read = after_sample) + Act1 = r.getPositions(0) + S1mean = [val.mean for val in r.getReadable(0)] + S1rms = [val.stdev for val in r.getReadable(0)] + S2mean = [val.mean for val in r.getReadable(1)] + S2rms = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rms = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rms = [val.stdev for val in r.getReadable(3)] + S5mean = [val.mean for val in r.getReadable(4)] + S5rms = [val.stdev for val in r.getReadable(4)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() + S5.close() \ No newline at end of file diff --git a/script/GenericScans/190124_orbitScanCDR2D.py b/script/GenericScans/190124_orbitScanCDR2D.py new file mode 100644 index 0000000..4b7892e --- /dev/null +++ b/script/GenericScans/190124_orbitScanCDR2D.py @@ -0,0 +1,63 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("x1", "S10MA01-DBPM060:X-REF-FB") +A2 = ChannelDouble("x2", "S10MA01-DBPM120:X-REF-FB") +S1 = ChannelDouble("LLM1", "S30CB05-DLLM110:CH4_LOSS_MPS_REL_L1") +S2 = ChannelDouble("LLM2", "S10CB09-DLLM110:CH8_LOSS-MPS_REL_L1") +S3 = ChannelDouble("BLM", "S20CB02-DBLM435:B1_LOSS_MPS_REL_L1") +S4 = ChannelDouble("DRPS", "SGE-EDRPS01-DU0601:DOSE-REL-OP") +S5 = ChannelDouble("CDR", "S10MA01-DCDR080:AL1-B1") + +A1.initialize() +A2.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S4.initialize() +S5.initialize() +A1_init = A1.read() +A2_init = A2.read() +A1i = A1_init-1.6 +A1f = A1_init+3.0 +A2i = A2_init-1.6 +A2f = A2_init+3.0 +nstep = 47 +lat = 10 +nav = 10 +plt = plot(None, title="Output")[0] +plt.clear() +plt.setStyle(plt.Style.ErrorY) +plt.addSeries(LinePlotErrorSeries("Sensor1", Color.red)) +def after_sample(record, scan): + plt.getSeries(0).appendData(record.positions[0], record.values[0].mean, record.values[0].stdev) +try: + S1_averager = create_averager(S1, nav, lat) + S2_averager = create_averager(S2, nav, lat) + S2_averager.monitored=True + S3_averager = create_averager(S3, nav, lat) + S3_averager.monitored=True + S4_averager = create_averager(S4, nav, lat) + S4_averager.monitored=True + S5_averager = create_averager(S5, nav, lat) + S5_averager.monitored=True + A1.write(A1i) + time.sleep(1.0) + r = ascan((A1,A2), (S1_averager, S2_averager, S3_averager, S4_averager, S5_averager), (A1i,A2i), (A1f,A2f), (nstep,nstep), latency=lat, after_read = after_sample) + Act1 = r.getPositions(0) + S1mean = [val.mean for val in r.getReadable(0)] + S1rms = [val.stdev for val in r.getReadable(0)] + S2mean = [val.mean for val in r.getReadable(1)] + S2rms = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rms = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rms = [val.stdev for val in r.getReadable(3)] + S5mean = [val.mean for val in r.getReadable(4)] + S5rms = [val.stdev for val in r.getReadable(4)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() + S5.close() diff --git a/script/2Dscan01.py b/script/GenericScans/2Dscan01.py similarity index 100% rename from script/2Dscan01.py rename to script/GenericScans/2Dscan01.py diff --git a/script/MKscan.py b/script/GenericScans/MKscan.py similarity index 100% rename from script/MKscan.py rename to script/GenericScans/MKscan.py diff --git a/script/Scan.py b/script/GenericScans/Scan.py similarity index 100% rename from script/Scan.py rename to script/GenericScans/Scan.py diff --git a/script/Scan2.py b/script/GenericScans/Scan2.py similarity index 100% rename from script/Scan2.py rename to script/GenericScans/Scan2.py diff --git a/script/Scan3.py b/script/GenericScans/Scan3.py similarity index 100% rename from script/Scan3.py rename to script/GenericScans/Scan3.py diff --git a/script/Scan4.py b/script/GenericScans/Scan4.py similarity index 100% rename from script/Scan4.py rename to script/GenericScans/Scan4.py diff --git a/script/Scan5.py b/script/GenericScans/Scan5.py similarity index 100% rename from script/Scan5.py rename to script/GenericScans/Scan5.py diff --git a/script/Scan6.py b/script/GenericScans/Scan6.py similarity index 100% rename from script/Scan6.py rename to script/GenericScans/Scan6.py diff --git a/script/Scan7.py b/script/GenericScans/Scan7.py similarity index 100% rename from script/Scan7.py rename to script/GenericScans/Scan7.py diff --git a/script/Scan8.py b/script/GenericScans/Scan8.py similarity index 100% rename from script/Scan8.py rename to script/GenericScans/Scan8.py diff --git a/script/RFscan/GunEnergyScanNew.py b/script/RFscan/GunEnergyScanNew.py index 6aea979..f78f5f9 100644 --- a/script/RFscan/GunEnergyScanNew.py +++ b/script/RFscan/GunEnergyScanNew.py @@ -155,7 +155,8 @@ if do_elog: log_msg = log_msg + "Collimator: IRIS %0.2f" % caget("SLGTV-LAPP:SIZE-GET") + " mm \n" else: log_msg = log_msg + "Collimator: " + str(caget("SLGTV-LMTO-M053:MOT-ACT-POS")) + "\n" - log_msg = log_msg + "Charge: %0.2f" % caget("SINEG01-DICT215:B1_CHARGE-OP") + " pC at %0.2f" % phase0 + " deg beam phase\n" + log_msg = log_msg + "Charge B1: %0.2f" % caget("SINEG01-DICT215:B1_CHARGE-OP") + " pC at %0.2f" % phase0 + " deg beam phase\n" + log_msg = log_msg + "Charge B2: %0.2f" % caget("SINEG01-DICT215:B2_CHARGE-OP") + " pC at %0.2f" % phase0 + " deg beam phase\n" log_msg = log_msg + "p-max: %0.2f" % p_max + " MeV/c at %0.2f" % ph_p_max + " deg beam phase\n" log_msg = log_msg + "dp-min: %0.4f" % dp_min + " MeV/c at %0.2f" % ph_dp_min + " deg beam phase\n" sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition diff --git a/script/RFscan/SchottkyScan.py b/script/RFscan/SchottkyScan.py index cf61459..c0531af 100644 --- a/script/RFscan/SchottkyScan.py +++ b/script/RFscan/SchottkyScan.py @@ -3,6 +3,8 @@ import ch.psi.pshell.epics.ChannelDouble as ChannelDouble dry_run = False do_elog = True +#set_exec_pars(layout="default") + is_panel = get_exec_pars().source != CommandSource.ui #must be check before run if is_panel: @@ -13,7 +15,7 @@ if is_panel: lat = args[4] plt = args[5] else: - start = -10.0 + start = -10.0 stop = 150.0 step = 5.0 nb = 1 @@ -41,13 +43,15 @@ else: q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE") q.initialize() q.monitored=True -bph.config.minValue = -360.0 + +bph.config.minValue = -90.0 bph.config.maxValue = 360.0 -bph.config.precision = 3 +bph.config.precision = 4 +bph.config.resolution = 0.5 bph.config.rotation = True -bph.config.resolution = 0.1 bph.config.save() bph.initialize() +bph0 = bph.read() % 360.0 rph.initialize() rph.monitored=True bph0 = bph.read() diff --git a/script/RFscan/phase_scan_caqtdm.py b/script/RFscan/phase_scan_caqtdm.py index 7b8ea42..141768f 100644 --- a/script/RFscan/phase_scan_caqtdm.py +++ b/script/RFscan/phase_scan_caqtdm.py @@ -10,7 +10,7 @@ if is_panel: station = args[0] bpm_ch = args[1] else: - station = "SINSB01" + station = "STEST01" bpm_ch = "SINBC02-DBPM140" start = caget(station + "-RSYS:SET-SCAN-START") stop = caget(station + "-RSYS:SET-SCAN-STOP") @@ -53,7 +53,7 @@ if dry_run: else: x = ChannelDouble("BPM-X averager", bpm_ch + ":X1") x.initialize() -phase0 = phase.read() % 360 +phase0 = phase.read() % 360.0 caput(station + "-RSYS:GET-FIT-PHASE-ARRAY", to_array([0.0],'d')) caput(station + "-RSYS:GET-FIT-ENERGY-ARRAY", to_array([0.0],'d')) caput(station + "-RSYS:GET-ONCREST-VSUM-PHASE", float('nan')) diff --git a/script/Undulators/1DscanPhaseShifter.py b/script/Undulators/1DscanPhaseShifter.py index 29bad09..8dfe0ee 100644 --- a/script/Undulators/1DscanPhaseShifter.py +++ b/script/Undulators/1DscanPhaseShifter.py @@ -1,8 +1,8 @@ import ch.psi.pshell.epics.ChannelDouble as ChannelDouble -A1 = ChannelDouble("Phase (deg.)", "SARUN11-UIND030:PHI_SET") +A1 = ChannelDouble("Phase (deg.)", "SARUN11-UIND030:PHI_SET") S1 = ChannelDouble("energy per pulse (uJ)", "SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US") -S2 = ChannelDouble("HAMP", "SARFE10-PBPG050:HAMP-INTENSITY-CAL") +S2 = ChannelDouble("HAMP", "SARFE10-PBPG050:HAMP-INTENSITY-CAL") A1.initialize() S1.initialize() S2.initialize() @@ -10,19 +10,12 @@ A1_init = A1.read() A1i = -180 A1f = 180 nstep = 72 -lat = 0.11 -nav = 100 +lat = 0.05 +nav = 40 plt = plot(None, title="Output")[0] plt.clear() plt.setStyle(plt.Style.ErrorY) plt.addSeries(LinePlotErrorSeries("Sensor1", Color.red)) -def before(position, scan): - caput(GAP + ":GO", 1) - start = time.time() - while abs(readout.read() - GAP.read()) > TOLERANCE: - time.sleep(0.1) - if time.time() - start > TIMEOUT: - raise Exception ("Timeout waiting gap change") def after_sample(record, scan): plt.getSeries(0).appendData(record.positions[0], record.values[0].mean, record.values[0].stdev) try: diff --git a/script/Undulators/K-calc.py b/script/Undulators/K-calc.py index 5bd2187..e41ec75 100644 --- a/script/Undulators/K-calc.py +++ b/script/Undulators/K-calc.py @@ -1,5 +1,5 @@ -Eph1 = 8.7 # actual photon energy -Eph2 = 5.8 # desired photon energy +Eph1 = 10.8 # actual photon energy +Eph2 = 12.0 # desired photon energy do_elog = True @@ -14,9 +14,9 @@ print K1,K2 # set laser on-delay caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel",1) caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC",1) -if Eph2 < Eph1 : - for und in undlist: caput(und + "-UIND030:K_SET", 1.1) - time.sleep(40.0) +#if Eph2 > Eph1 : +# for und in undlist: caput(und + "-UIND030:K_SET", 1.1) +# time.sleep(40.0) for und in undlist: caput(und + "-UIND030:K_SET", K2[und]) time.sleep(10.0) # set laser on-beam diff --git a/script/local.groovy b/script/local.groovy new file mode 100644 index 0000000..eef7106 --- /dev/null +++ b/script/local.groovy @@ -0,0 +1,3 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.groovy +/////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/script/local.js b/script/local.js new file mode 100644 index 0000000..e2eeaad --- /dev/null +++ b/script/local.js @@ -0,0 +1,4 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.js +/////////////////////////////////////////////////////////////////////////////////////////////////// + diff --git a/script/local.py b/script/local.py index dc1ae2c..fb9d2ce 100755 --- a/script/local.py +++ b/script/local.py @@ -9,7 +9,6 @@ from mathutils import PolynomialFunction, Gaussian, HarmonicOscillator import java.awt.Color as Color - ################################################################################################### # Layout setup ################################################################################################### diff --git a/script/test/181219_BPM_screen_correlation.py b/script/test/181219_BPM_screen_correlation.py new file mode 100644 index 0000000..f64dbfa --- /dev/null +++ b/script/test/181219_BPM_screen_correlation.py @@ -0,0 +1,11 @@ +st1 = Stream("st1", dispatcher) +st1.addScalar("X1", "SINEG01-DBPM340:X1", 10, 0) +st1.addScalar("Y1", "SINEG01-DBPM340:Y1", 10, 0) +st1.addScalar("Q1", "SINEG01-DBPM340:Q1", 10, 0) +w,h = caget("SLG-LCAM-C103:WIDTH", 'i'), caget("SLG-LCAM-C103:HEIGHT", 'i') +st1.addMatrix("VCC", "SLG-LCAM-C103:FPICTURE", 10, 0, w,h) +st1.initialize() +try: + bscan (st1, 3) +finally: + st1.close() diff --git a/script/test/181219_BPM_screen_correlation2.py b/script/test/181219_BPM_screen_correlation2.py new file mode 100644 index 0000000..c6b5160 --- /dev/null +++ b/script/test/181219_BPM_screen_correlation2.py @@ -0,0 +1,26 @@ +number_of_frames = 3 +module = 1 +camera_name = "SLG-LCAM-C103" + +w,h = caget(camera_name + ":WIDTH", 'i'), caget(camera_name + ":HEIGHT", 'i') +st1 = Stream("st1", dispatcher) +st1.addScalar("X1", "SINEG01-DBPM340:X1", module, 0) +st1.addScalar("Y1", "SINEG01-DBPM340:Y1", module, 0) +st1.addScalar("Q1", "SINEG01-DBPM340:Q1", module, 0) +st1.addMatrix("VCC", camera_name + ":FPICTURE", module, 0, w,h) +st1.initialize() + +cam_server.start(camera_name+ "_sp") +x = cam_server.stream.getChild("x_fit_mean") +y = cam_server.stream.getChild("y_fit_mean") + +def scan1(): + bscan (st1, number_of_frames, title = "BSscan", tag = "BSscan") + +def scan2(): + mscan (cam_server.stream, (x, y), number_of_frames, title = "CAMscan", tag = "CAMscan") + +try: + parallelize(scan1, scan2) +finally: + st1.close() \ No newline at end of file diff --git a/script/test/181219_BPM_screen_correlation3.py b/script/test/181219_BPM_screen_correlation3.py new file mode 100644 index 0000000..125a6c9 --- /dev/null +++ b/script/test/181219_BPM_screen_correlation3.py @@ -0,0 +1,35 @@ +number_of_frames = 3 +module = 1 +camera_name = "SLG-LCAM-C103" + +st1 = Stream("st1", dispatcher) + +def init_bs(): + w,h = caget(camera_name + ":WIDTH", 'i'), caget(camera_name + ":HEIGHT", 'i') + st1.addScalar("X1", "SINEG01-DBPM340:X1", module, 0) + st1.addScalar("Y1", "SINEG01-DBPM340:Y1", module, 0) + st1.addScalar("Q1", "SINEG01-DBPM340:Q1", module, 0) + st1.addMatrix("VCC", camera_name + ":FPICTURE", module, 0, w,h) + st1.initialize() + st1.start() + st1.waitCacheChange(10000) + +def init_cam(): + cam_server.start(camera_name+ "_sp") + x = cam_server.stream.getChild("x_fit_mean") + y = cam_server.stream.getChild("y_fit_mean") + cam_server.stream.waitCacheChange(10000); + +def scan_bs(): + bscan (st1, number_of_frames, title = "BSscan", tag = "BSscan") + +def scan_cam(): + mscan (cam_server.stream, (x, y), number_of_frames, title = "CAMscan", tag = "CAMscan") + + +try: + parallelize(init_bs, init_cam) + parallelize(scan_bs, scan_cam) +finally: + st1.close() + #cam_server.stop() \ No newline at end of file diff --git a/script/test/bs.py b/script/test/bs.py index c1da9df..8490ba5 100644 --- a/script/test/bs.py +++ b/script/test/bs.py @@ -1,34 +1,12 @@ st1 = Stream("st1", dispatcher) -#st1.addScalar("pup10", "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG", 10, 0) -#st1.addScalar("pup20", "SINEG01-RGUN-PUP20:SIG-AMPLT-AVG", 10, 0) -#st1.addScalar("pup30", "SINEG01-RGUN-PUP30:SIG-AMPLT-AVG", 10, 0) -#st1.addScalar("ampli", "SINDI01-RKLY-DCP10:REF-AMPLT", 10, 0) -#st1.addScalar("phase", "SINDI01-RKLY-DCP10:REF-PHASE", 10, 0) -#st1.addScalar("cput", "SINDI01-RLLE-STA:SLAVE1-CPUTIMER", 10, 0) -#st1.addScalar("dlt", "SINDI01-RLLE-STA:SLAVE1-DLTIMER", 10, 0) -#st1.addScalar("dlt", "SINDI01-RKLY-DCP10:REF-AMPLT-AVG", 10, 0) - -st1.addScalar("scpu", "SINDI01-RLLE-STA:SLAVE1-CPUTIMER", 10, 0) -st1.addScalar("mcpu", "SINDI01-RLLE-STA:MASTER-CPUTIMER", 10, 0) -st1.addWaveform("amp", "SINDI01-RCIR-PUP10:SIG-AMPLT", 10, 0) +st1.addScalar("X1", "SINEG01-DBPM340:X1", 10, 0) +st1.addScalar("Y1", "SINEG01-DBPM340:Y1", 10, 0) +st1.addScalar("Q1", "SINEG01-DBPM340:Q1", 10, 0) +w,h = caget("SLG-LCAM-C103:WIDTH", 'i'), caget("SLG-LCAM-C103:HEIGHT", 'i') +st1.addMatrix("VCC", "SLG-LCAM-C103:FPICTURE", 10, 0, w,h) st1.initialize() -st1.start(True) - - -class PseudoPositioner(Writable): - def write(self,pos): - print "Step = " + str(pos) -pseudo_motor = PseudoPositioner() - - try: - #Dumps to file all pulse IDs - bscan (st1, 10, title="bscan") - - #When sampling the stream waits for next value in normal scans/ - #tscan (st1.getReadables(), 10,0.1) - - #lscan (pseudo_motor, [gsx,] + st1.getReadables(), 0, 10, 10, latency=0.1) + bscan (st1, 3) finally: st1.close() diff --git a/script/save_snapshot.py b/script/test/save_snapshot.py similarity index 100% rename from script/save_snapshot.py rename to script/test/save_snapshot.py