From 35e61c605d8887b70a5c35ce206d69304a2de2f0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Nov 2018 09:44:17 +0100 Subject: [PATCH] --- devices/CamServer.properties | 3 +- devices/CurrentCamera.properties | 23 ++-- devices/WireScanner motor.properties | 4 +- devices/cam_server.properties | 10 +- devices/scanner.properties | 3 +- plugins/ScreenPanel3.java | 152 ++++++++++++++++----- plugins/WireScan.java | 67 ++++++++- script/181011_1004_MKDCscanAllAT.py | 49 +++++++ script/181011_1011_MKDCACscanAllAT.py | 49 +++++++ script/Alignment/Gun_solenoid_alignment.py | 8 ++ script/Alignment/Laser_gun_alignment.py | 5 + script/Diagnostics/WireScan.py | 9 +- script/Diagnostics/WireScanCalibration.py | 2 +- script/MKscan.py | 49 +++++++ script/RFscan/GunEnergyScanNew.py | 5 +- script/RFscan/phase_scan_caqtdm_set.py | 9 +- script/Scan7.py | 35 +++++ script/Scan8.py | 49 +++++++ script/Tools/CameraTools.py | 9 +- script/Tools/save_camera_data.py | 5 +- script/Undulators/K-calc.py | 38 ++++-- script/Undulators/K-calc2.py | 31 ----- script/test/WireScanMock.py | 34 +++-- 23 files changed, 521 insertions(+), 127 deletions(-) create mode 100644 script/181011_1004_MKDCscanAllAT.py create mode 100644 script/181011_1011_MKDCACscanAllAT.py create mode 100644 script/MKscan.py create mode 100644 script/Scan7.py create mode 100644 script/Scan8.py delete mode 100644 script/Undulators/K-calc2.py diff --git a/devices/CamServer.properties b/devices/CamServer.properties index 5b9b381..62cf7cf 100644 --- a/devices/CamServer.properties +++ b/devices/CamServer.properties @@ -1,6 +1,7 @@ -#Tue Sep 19 11:13:25 CEST 2017 +#Sun Oct 07 11:51:48 CEST 2018 colormap=Grayscale colormapAutomatic=false +colormapLogarithmic=false colormapMax=NaN colormapMin=NaN flipHorizontally=false diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 0e98b33..59186fb 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,19 +1,20 @@ -#Thu Sep 27 11:01:54 CEST 2018 +#Mon Nov 26 09:44:10 CET 2018 \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=5000.0 -colormapMin=42.0 +colormapMax=3680.0 +colormapMin=76.0 flipHorizontally=false flipVertically=false grayscale=false -imageHeight=1200 -imageWidth=1920 +imageHeight=2160 +imageWidth=2560 invert=false -regionStartX=0 -regionStartY=0 +regionStartX=1 +regionStartY=1 rescaleFactor=1.0 rescaleOffset=0.0 roiHeight=-1 @@ -24,10 +25,10 @@ rotation=0.0 rotationCrop=false scale=1.0 serverURL=null -spatialCalOffsetX=-93.53143059339158 -spatialCalOffsetY=-95.47500121434692 -spatialCalScaleX=-8.673880440848214 -spatialCalScaleY=-8.839778747558594 +spatialCalOffsetX=-861.4939970777481 +spatialCalOffsetY=-820.4883730911062 +spatialCalScaleX=-18.90359092620482 +spatialCalScaleY=-19.37984500632817 spatialCalUnits=null t= transpose=false diff --git a/devices/WireScanner motor.properties b/devices/WireScanner motor.properties index 249006a..ad51352 100644 --- a/devices/WireScanner motor.properties +++ b/devices/WireScanner motor.properties @@ -1,5 +1,5 @@ -#Thu Sep 27 13:33:31 CEST 2018 -defaultSpeed=6000.0 +#Sun Nov 25 18:06:59 CET 2018 +defaultSpeed=50.0 estbilizationDelay=0 hasEnable=false homingType=None diff --git a/devices/cam_server.properties b/devices/cam_server.properties index 1358b96..c2d627c 100644 --- a/devices/cam_server.properties +++ b/devices/cam_server.properties @@ -1,4 +1,4 @@ -#Thu Sep 27 07:12:40 CEST 2018 +#Thu Nov 22 19:50:32 CET 2018 colormap=Flame colormapAutomatic=true colormapLogarithmic=false @@ -17,9 +17,9 @@ roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -spatialCalOffsetX=0.0 -spatialCalOffsetY=0.0 -spatialCalScaleX=1.0 -spatialCalScaleY=1.0 +spatialCalOffsetX=-861.4939970777481 +spatialCalOffsetY=-820.4883730911062 +spatialCalScaleX=-18.90359092620482 +spatialCalScaleY=-19.37984500632817 spatialCalUnits=mm transpose=false diff --git a/devices/scanner.properties b/devices/scanner.properties index d0e3fa1..8396081 100644 --- a/devices/scanner.properties +++ b/devices/scanner.properties @@ -1,4 +1,4 @@ -#Tue Feb 06 17:00:47 CET 2018 +#Thu Oct 18 10:40:46 CEST 2018 maxValue=NaN minValue=NaN offset=0.0 @@ -6,4 +6,5 @@ precision=-1 resolution=NaN rotation=false scale=1.0 +sign_bit=0 unit=null diff --git a/plugins/ScreenPanel3.java b/plugins/ScreenPanel3.java index be6a857..e6b7662 100644 --- a/plugins/ScreenPanel3.java +++ b/plugins/ScreenPanel3.java @@ -844,6 +844,8 @@ public class ScreenPanel3 extends Panel { parseUserOverlays(); errorOverlay = null; lastMarkerPos = null; + lastFrame = null; + lastPipelinePars = null; if (dataTableDialog != null) { dataTableDialog.dispose(); @@ -947,7 +949,7 @@ public class ScreenPanel3 extends Panel { } server.start(pipelineName, instanceName); - updateServerControls(); + updatePipelineControls(); checkThreshold.setEnabled(true); checkGoodRegion.setEnabled(true); } else { @@ -1023,7 +1025,7 @@ public class ScreenPanel3 extends Panel { } catch (Exception ex) { showException(ex); renderer.clearOverlays(); - updateServerControls(); + updatePipelineControls(); if (renderer.getDevice() == null) { //renderer.setZoom(1.0); //renderer.setMode(RendererMode.Zoom); @@ -1302,40 +1304,97 @@ public class ScreenPanel3 extends Panel { updatingColormap = false; } - boolean updatingServerControls; - - void updateServerControls() { - if (server != null) { - updatingServerControls = true; - try { - checkBackground.setSelected(server.getBackgroundSubtraction()); - Double threshold = (server.getThreshold()); - checkThreshold.setSelected(threshold != null); - spinnerThreshold.setValue((threshold == null) ? 0 : threshold); - Map gr = (server.getGoodRegion()); - checkGoodRegion.setSelected(gr != null); - if (gr != null) { - spinnerGrThreshold.setValue(((Number) gr.get("threshold")).doubleValue()); - spinnerGrScale.setValue(((Number) gr.get("gfscale")).doubleValue()); - } - Map slicing = (server.getSlicing()); - checkSlicing.setSelected(slicing != null); - if (slicing != null) { - spinnerSlNumber.setValue(((Number) slicing.get("number_of_slices")).intValue()); - spinnerSlScale.setValue(((Number) slicing.get("scale")).doubleValue()); - spinnerSlOrientation.setValue((String) slicing.get("orientation")); - } - } catch (Exception ex) { - ex.printStackTrace(); - } + void updatePipelineProperties(){ goodRegion = checkGoodRegion.isSelected(); spinnerThreshold.setVisible(checkThreshold.isSelected()); setGoodRegionOptionsVisible(goodRegion); slicing = goodRegion && checkSlicing.isSelected(); setSlicingOptionsVisible(slicing); - updatingServerControls = false; + updatingServerControls = false; + } + + boolean updatingServerControls; + + void updatePipelineControls() { + if (server != null) { + updatingServerControls = true; + if (server.isStarted()){ + try { + checkBackground.setSelected(server.getBackgroundSubtraction()); + Double threshold = (server.getThreshold()); + checkThreshold.setSelected(threshold != null); + spinnerThreshold.setValue((threshold == null) ? 0 : threshold); + Map gr = (server.getGoodRegion()); + checkGoodRegion.setSelected(gr != null); + if (gr != null) { + spinnerGrThreshold.setValue(((Number) gr.get("threshold")).doubleValue()); + spinnerGrScale.setValue(((Number) gr.get("gfscale")).doubleValue()); + } + Map slicing = (server.getSlicing()); + checkSlicing.setSelected(slicing != null); + if (slicing != null) { + spinnerSlNumber.setValue(((Number) slicing.get("number_of_slices")).intValue()); + spinnerSlScale.setValue(((Number) slicing.get("scale")).doubleValue()); + spinnerSlOrientation.setValue((String) slicing.get("orientation")); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + updatePipelineProperties(); } } + + boolean changedPipelinePars(Map pars1, Map pars2) { + String[] keys = new String[]{"image_background_enable", "image_threshold", "image_good_region", + "threshold", "gfscale", "image_slices", "number_of_slices", "scale", "orientation"}; + for (String key:keys){ + Object o1 = pars1.get(key); + Object o2 = pars2.get(key); + if (o1==null){ + if (o2!=null){ + return true; + } + } else if (!o1.equals(o2)){ + return true; + } + } + return false; + } + + void updatePipelineControls(Map pars) { + if (pars!=null){ + updatingServerControls = true; + try { + boolean background = (boolean) pars.get("image_background_enable"); + checkBackground.setSelected(background); + Double threshold = (Double) (pars.get("image_threshold")); + checkThreshold.setSelected(threshold != null); + spinnerThreshold.setValue((threshold == null) ? 0 : threshold); + Map gr = (Map) pars.get("image_good_region"); + checkGoodRegion.setSelected(gr != null); + if (gr != null) { + Double value = ((Number) gr.get("threshold")).doubleValue(); + spinnerGrThreshold.setValue(value); + Double scale = ((Number) gr.get("gfscale")).doubleValue(); + spinnerGrScale.setValue(scale); + } + Map slicing = (Map) (pars.get("image_slices")); + checkSlicing.setSelected(slicing != null); + if (slicing != null) { + int slices = ((Number) slicing.get("number_of_slices")).intValue(); + spinnerSlNumber.setValue(slices); + double scale = ((Number) slicing.get("scale")).doubleValue(); + spinnerSlScale.setValue(scale); + String orientation = (String) slicing.get("orientation"); + spinnerSlOrientation.setValue(orientation); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + updatePipelineProperties(); + } + } void setGoodRegionOptionsVisible(boolean visible) { spinnerGrThreshold.setVisible(visible); @@ -1392,6 +1451,10 @@ public class ScreenPanel3 extends Panel { updatingButtons = false; } } + + Frame lastFrame = null; + Map lastPipelinePars = null; + @Override protected void onTimer() { @@ -1415,6 +1478,23 @@ public class ScreenPanel3 extends Panel { updateColormap(); updateButtons(); checkHistogram.setSelected((histogramDialog != null) && (histogramDialog.isShowing())); + + try{ + Frame frame = getCurrentFrame(); + if (frame!=lastFrame){ + lastFrame = frame; + if (frame!=null){ + Map pars = getProcessingParameters(frame.cache); + if((lastPipelinePars==null) || changedPipelinePars(pars, lastPipelinePars)){ + //System.out.println("Update pipeline: " + pars); + lastPipelinePars = pars; + updatePipelineControls(pars); + } + } + } + } catch (Exception ex){ + ex.printStackTrace(); + } } Pen penFit = new Pen(new Color(192, 105, 0), 0); @@ -3554,7 +3634,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_spinnerThresholdonChange @@ -3568,7 +3648,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); updatingServerControls = true; checkBackground.setSelected(false); updatingServerControls = false; @@ -3589,7 +3669,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_checkThresholdActionPerformed @@ -3608,7 +3688,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_checkGoodRegionActionPerformed @@ -3621,7 +3701,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_spinnerGrThresholdonChange @@ -3655,7 +3735,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_checkSlicingActionPerformed @@ -3668,7 +3748,7 @@ public class ScreenPanel3 extends Panel { } } catch (Exception ex) { showException(ex); - updateServerControls(); + updatePipelineControls(); } } }//GEN-LAST:event_spinnerSlicingChange diff --git a/plugins/WireScan.java b/plugins/WireScan.java index e56e62b..06adc6f 100644 --- a/plugins/WireScan.java +++ b/plugins/WireScan.java @@ -4,6 +4,7 @@ import ch.psi.pshell.device.Device; import ch.psi.pshell.device.DeviceAdapter; +import ch.psi.pshell.device.DeviceListener; import ch.psi.pshell.epics.ChannelDouble; import ch.psi.pshell.epics.ChannelInteger; import ch.psi.pshell.epics.Epics; @@ -927,14 +928,70 @@ public class WireScan extends Panel { onStateChange(getState(), getState()); }//GEN-LAST:event_comboWireScannerActionPerformed +ChannelDouble channelStartX; +ChannelDouble channelEndX; +ChannelDouble channelStartY; +ChannelDouble channelEndY; + private void comboScanTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboScanTypeActionPerformed try { + + if (channelStartX != null){ + channelStartX.close(); + channelStartX = null; + } + if (channelEndX != null){ + channelEndX.close(); + channelEndX = null; + } + if (channelStartY != null){ + channelStartY.close(); + channelStartY = null; + } + if (channelEndY != null){ + channelEndY.close(); + channelEndY = null; + } if (!isBackground()){ - boolean set1 = isSet1(); - spinnerStartX.setValue(Epics.get(currentScannner + (set1 ? ":W1X" : ":W2X") + "_START_SP", Double.class)); - spinnerEndX.setValue(Epics.get(currentScannner + (set1 ? ":W1X" : ":W2X") + "_END_SP", Double.class)); - spinnerStartY.setValue(Epics.get(currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_START_SP", Double.class)); - spinnerEndY.setValue(Epics.get(currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_END_SP", Double.class)); + boolean set1 = isSet1(); + channelStartX = new ChannelDouble("Start X", currentScannner + (set1 ? ":W1X" : ":W2X") + "_START_SP"); + channelEndX = new ChannelDouble("End X", currentScannner + (set1 ? ":W1X" : ":W2X") + "_END_SP"); + channelStartY = new ChannelDouble("Start Y", currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_START_SP"); + channelEndY = new ChannelDouble("End X", currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_END_SP"); + channelStartX.initialize(); channelStartX.setMonitored(true); + channelEndX.initialize(); channelEndX.setMonitored(true); + channelStartY.initialize(); channelStartY.setMonitored(true); + channelEndY.initialize(); channelEndY.setMonitored(true); + + channelStartX.addListener(new DeviceAdapter() { + @Override + public void onValueChanged(Device device, Object value, Object former) { + spinnerStartX.setValue(((Number)value).doubleValue()); + } + }); + channelEndX.addListener(new DeviceAdapter() { + @Override + public void onValueChanged(Device device, Object value, Object former) { + spinnerEndX.setValue(((Number)value).doubleValue()); + } + }); + channelStartY.addListener(new DeviceAdapter() { + @Override + public void onValueChanged(Device device, Object value, Object former) { + spinnerStartY.setValue(((Number)value).doubleValue()); + } + }); + channelEndY.addListener(new DeviceAdapter() { + @Override + public void onValueChanged(Device device, Object value, Object former) { + spinnerEndY.setValue(((Number)value).doubleValue()); + } + }); + + spinnerStartX.setValue(channelStartX.read()); + spinnerEndX.setValue(channelEndX.read()); + spinnerStartY.setValue(channelStartY.read()); + spinnerEndY.setValue(channelEndY.read()); } } catch (Exception ex) { showException(ex); diff --git a/script/181011_1004_MKDCscanAllAT.py b/script/181011_1004_MKDCscanAllAT.py new file mode 100644 index 0000000..d32fed6 --- /dev/null +++ b/script/181011_1004_MKDCscanAllAT.py @@ -0,0 +1,49 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("MK energy", "S20SY02-MK:ENERGY-SP") +S1 = ChannelDouble("S20SY02-DBPM150:Y1", "S20SY02-DBPM150:Y1") +S2 = ChannelDouble("SATSY01-DBPM010:Y1", "SATSY01-DBPM010:Y1") +S3 = ChannelDouble("SATSY01-DBPM010:Q1", "SATSY01-DBPM010:Q1") +S4 = ChannelDouble("S20SY02-DBPM120:Y1", "S20SY02-DBPM120:Y1") +A1.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S4.initialize() +A1_init = A1.read() +A1i = 1300.0 +A1f = 3300.0 +step = 25.0 +lat = 0.1 +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 + time.sleep(4.0) + r = lscan(A1, (S1_averager, S2_averager, S3_averager, S4_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)] + S2rmsn = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rmsn = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rmsn = [val.stdev for val in r.getReadable(3)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() \ No newline at end of file diff --git a/script/181011_1011_MKDCACscanAllAT.py b/script/181011_1011_MKDCACscanAllAT.py new file mode 100644 index 0000000..d32fed6 --- /dev/null +++ b/script/181011_1011_MKDCACscanAllAT.py @@ -0,0 +1,49 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("MK energy", "S20SY02-MK:ENERGY-SP") +S1 = ChannelDouble("S20SY02-DBPM150:Y1", "S20SY02-DBPM150:Y1") +S2 = ChannelDouble("SATSY01-DBPM010:Y1", "SATSY01-DBPM010:Y1") +S3 = ChannelDouble("SATSY01-DBPM010:Q1", "SATSY01-DBPM010:Q1") +S4 = ChannelDouble("S20SY02-DBPM120:Y1", "S20SY02-DBPM120:Y1") +A1.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S4.initialize() +A1_init = A1.read() +A1i = 1300.0 +A1f = 3300.0 +step = 25.0 +lat = 0.1 +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 + time.sleep(4.0) + r = lscan(A1, (S1_averager, S2_averager, S3_averager, S4_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)] + S2rmsn = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rmsn = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rmsn = [val.stdev for val in r.getReadable(3)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() \ No newline at end of file diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index fefc095..fa48c8b 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -119,6 +119,14 @@ if do_elog: log_msg = log_msg + "\nImages: " + str(number_images) log_msg = log_msg + "\nBackground: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds) log_msg = log_msg + "\nPlot index: " + str(centroid_plot_index) + try: + log_msg = log_msg + ("Virtual catode (x,y): " + str(caget("SLG-LCAM-C103:FIT-XPOS", 's')) + ", " + str(caget("SLG-LCAM-C103:FIT-YPOS", 's'))) + log_msg = log_msg + ("Position (x,y,rx,ry,rz): " + str(caget("SINEG01-MSOL130:X", 's')) + ", " + str(caget("SINEG01-MSOL130:Y", 's')) + ", " + \ + str(caget("SINEG01-MSOL130:ROT_X", 's')) + ", " + str(caget("SINEG01-MSOL130:ROT_Y", 's')) + ", " + str(caget("SINEG01-MSOL130:ROT_Z", 's'))) + + except: + pass + log_msg = log_msg + "\n\n" + r.print() sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition diff --git a/script/Alignment/Laser_gun_alignment.py b/script/Alignment/Laser_gun_alignment.py index 218d8c5..e9bb5ae 100755 --- a/script/Alignment/Laser_gun_alignment.py +++ b/script/Alignment/Laser_gun_alignment.py @@ -124,6 +124,11 @@ if do_elog: log_msg = log_msg + "\nImages: " + str(number_images) log_msg = log_msg + "\nBackground: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds) log_msg = log_msg + "\nPlot index: " + str(centroid_plot_index) + try: + log_msg = log_msg + ("Virtual catode (x,y): " + str(caget("SLG-LCAM-C103:FIT-XPOS", 's')) + ", " + str(caget("SLG-LCAM-C103:FIT-YPOS", 's'))) + except: + pass + log_msg = log_msg + "\n\n" + r.print() sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition diff --git a/script/Diagnostics/WireScan.py b/script/Diagnostics/WireScan.py index 8e18f3a..4012deb 100644 --- a/script/Diagnostics/WireScan.py +++ b/script/Diagnostics/WireScan.py @@ -11,7 +11,7 @@ run("Diagnostics/sig_process_wrapper") #set_exec_pars(layout="default") #Paramter parsing -prefix = args[0] if has_args else SINDI01-DWSC090 # "S10DI01-DWSC010" #"S10CB07-DWSC440" #"SINDI01-DWSC090" +prefix = args[0] if has_args else "SARCL01-DWSC160" # "SINDI01-DWSC090" # "S10DI01-DWSC010" #"S10CB07-DWSC440" #"SINDI01-DWSC090" scan_type = args[1] if has_args else WireScanner.WireX1 scan_range = args[2] if has_args else [] cycles = args[3] if has_args else 2 @@ -28,7 +28,7 @@ print has_args, do_elog print "WireScan parameters: ", prefix, scan_type, scan_range, cycles, n_shot, bpms, blms, bkgrd, bunch - +FILTER_BEAM_OK = True SET_BLM_WS_MODE = True SET_BLM_WS_SETTLING_TIME = 2.0 SET_BLM_WS_BS_READBACK_TIMEOUT = 10000 #ms @@ -373,7 +373,10 @@ try: st.getChild("blm1_ws_mode").waitValue(1, SET_BLM_WS_BS_READBACK_TIMEOUT) print "Reading background..." do_background() - st.setFilter(scanner.curr_cycl.get_name() + ">0 AND SIN-CVME-TIFGUN-EVR0:BEAMOK == 1") #scanner.status_channels[0].get_name() + ">0" not used because we must the transition to know when the finished + stream_filter = scanner.curr_cycl.get_name() + ">0" + if FILTER_BEAM_OK: + stream_filter = stream_filter + " AND SIN-CVME-TIFGUN-EVR0:BEAMOK == 1" + st.setFilter(stream_filter) print "Executing scan 1..." do_scan(0) if scan_type in [WireScanner.Set1, WireScanner.Set2]: diff --git a/script/Diagnostics/WireScanCalibration.py b/script/Diagnostics/WireScanCalibration.py index ec3041b..f13c077 100644 --- a/script/Diagnostics/WireScanCalibration.py +++ b/script/Diagnostics/WireScanCalibration.py @@ -58,7 +58,7 @@ def set_wire_scan_range(wire, start, end): ################################################################################################### print "--------------- Find COM --------------- " set_status("Performing wire scan to find initial COM...") - +write_ws_gain(initial_gain) set_gain(initial_gain) print "Setting gain=", initial_gain diff --git a/script/MKscan.py b/script/MKscan.py new file mode 100644 index 0000000..a243102 --- /dev/null +++ b/script/MKscan.py @@ -0,0 +1,49 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("MK energy", "S20SY02-MK:ENERGY-SP") +S1 = ChannelDouble("S20SY02-DBPM150:Y1", "S20SY02-DBPM150:Y1") +S2 = ChannelDouble("SATSY01-DBPM010:Y1", "SATSY01-DBPM010:Y1") +S3 = ChannelDouble("SATSY01-DBPM010:Q1", "SATSY01-DBPM010:Q1") +S4 = ChannelDouble("S20SY02-DBPM120:Y1", "S20SY02-DBPM120:Y1") +A1.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S4.initialize() +A1_init = A1.read() +A1i = 1700.0 +A1f = 3500.0 +step = 25.0 +lat = 0.1 +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 + time.sleep(4.0) + r = lscan(A1, (S1_averager, S2_averager, S3_averager, S4_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)] + S2rmsn = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rmsn = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rmsn = [val.stdev for val in r.getReadable(3)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() \ No newline at end of file diff --git a/script/RFscan/GunEnergyScanNew.py b/script/RFscan/GunEnergyScanNew.py index 70fca56..6aea979 100644 --- a/script/RFscan/GunEnergyScanNew.py +++ b/script/RFscan/GunEnergyScanNew.py @@ -44,7 +44,7 @@ plt.setLegendVisible(True) #Creating Phase positioner if dry_run: phase = Positioner("Gun Phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM") - camera_name = "S10MA01-DSCR090" #"simulation" + camera_name = "simulation" else: phase = Positioner("Gun Phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE") camera_name = "SINBD01-DSCR010" @@ -68,11 +68,10 @@ dx = cam_server.stream.getChild("x_rms") cam_server.setThreshold(500) #cam_server.captureBackground(10) #Capturing background cam_server.setBackgroundSubtraction(False) -#cam_server.setRoi([144,1431,482,706]) #X, Y, W, H # something wrong thereto be fixed +#cam_server.setRoi([144,482,1431,706]) #X, Y, W, H # something wrong thereto be fixed #Creating averagers x_averager = create_averager(x, nb, -1) # -1 event based, waits for the next value -#x_averager.monitored = True # not blocking, will return last nb values dx_averager = create_averager(dx, nb, -1) dx_averager.monitored = True # not blocking, will return last nb values diff --git a/script/RFscan/phase_scan_caqtdm_set.py b/script/RFscan/phase_scan_caqtdm_set.py index bc00b91..4e61820 100644 --- a/script/RFscan/phase_scan_caqtdm_set.py +++ b/script/RFscan/phase_scan_caqtdm_set.py @@ -17,19 +17,20 @@ if (ampli_set == 'True'): amplitude_scale = caget(station + "-RSYS:SET-VSUM-AMPLT-SCALE-CALC") amplitude_scale_old = caget(station + "-RSYS:SET-VSUM-AMPLT-SCALE") caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", amplitude_scale) + caput(station + "-RSYS:CMD-LOAD-CALIB-BEAM", 1) n = n + 1 if (power_set == 'True'): power_scale = caget(station + "-RSYS:SET-VOLT-POWER-SCALE-CALC") power_scale_old = caget(station + "-RSYS:SET-VOLT-POWER-SCALE") caput(station + "-RSYS:SET-VOLT-POWER-SCALE", power_scale) + caput(station + "-RSYS:CMD-LOAD-CALIB-BEAM", 1) n = n + 1 if n > 0: - caput(station + "-RSYS:CMD-LOAD-CALIB-BEAM", 1) if do_elog == True: title = "Set RF calibration:" + station log_msg = "" - if (phase_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE: %12.2f" % phase_offset + " deg (was %12.2f" % phase_offset_old + " deg)\n" - if (ampli_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-AMPLT-SCALE: %12.3f" % amplitude_scale + " MV (was %12.3f" % amplitude_scale_old + " MV)\n" - if (power_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VOLT-POWER-SCALE: %12.7f" % power_scale + " MW/MV^2 (was %12.5f" % power_scale_old + " MW/MV^2)" + if (phase_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE: %12.2f" % phase_offset + " deg (was %12.2f" % phase_offset_old + " deg )\n" + if (ampli_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-AMPLT-SCALE: %12.3f" % amplitude_scale + " MV (was %12.3f" % amplitude_scale_old + " MV )\n" + if (power_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VOLT-POWER-SCALE: %12.7f" % power_scale + " MW/MV^2 (was %12.5f" % power_scale_old + " MW/MV^2)" attachments = [] elog(title, log_msg, attachments) diff --git a/script/Scan7.py b/script/Scan7.py new file mode 100644 index 0000000..cf887fa --- /dev/null +++ b/script/Scan7.py @@ -0,0 +1,35 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("MK energy", "S20SY02-MK:ENERGY-SP") +S1 = ChannelDouble("charge 1", "SATSY01-DBPM010:Q1") +S2 = ChannelDouble("charge 2", "SATSY01-DBPM060:Q1") +A1.initialize() +S1.initialize() +S2.initialize() +A1_init = A1.read() +A1i = 2850.0 +A1f = 2950.0 +step = 5.0 +lat = 0.1 +nav = 5 +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 + time.sleep(1.0) + r = lscan(A1, (S1_averager, S2_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)] + S2rmsn = [val.stdev for val in r.getReadable(1)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() \ No newline at end of file diff --git a/script/Scan8.py b/script/Scan8.py new file mode 100644 index 0000000..65f2cf6 --- /dev/null +++ b/script/Scan8.py @@ -0,0 +1,49 @@ +import ch.psi.pshell.epics.ChannelDouble as ChannelDouble +A1 = ChannelDouble("MK energy", "S20SY02-MK:ENERGY-SP") +S1 = ChannelDouble("", "S20SY02-DBPM150:Y1") +S2 = ChannelDouble("", "SATSY01-DBPM010:Y1") +S3 = ChannelDouble("", "SATSY01-DBPM010:Q1") +S4 = ChannelDouble("", "S20SY02-DBPM120:Y1") +A1.initialize() +S1.initialize() +S2.initialize() +S3.initialize() +S24.initialize() +A1_init = A1.read() +A1i = 1300.0 +A1f = 3300.0 +step = 100.0 +lat = 0.1 +nav = 5 +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 + time.sleep(1.0) + r = lscan(A1, (S1_averager, S2_averager, S3_averager, S4_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)] + S2rmsn = [val.stdev for val in r.getReadable(1)] + S3mean = [val.mean for val in r.getReadable(2)] + S3rmsn = [val.stdev for val in r.getReadable(2)] + S4mean = [val.mean for val in r.getReadable(3)] + S4rmsn = [val.stdev for val in r.getReadable(3)] +finally: + A1.write(A1_init) + A1.close() + S1.close() + S2.close() + S3.close() + S4.close() \ No newline at end of file diff --git a/script/Tools/CameraTools.py b/script/Tools/CameraTools.py index e4f147c..bc6078d 100644 --- a/script/Tools/CameraTools.py +++ b/script/Tools/CameraTools.py @@ -2,6 +2,7 @@ import json import java.math.BigInteger as BigInteger import org.python.core.PyLong as PyLong import org.python.core.PyFloat as PyFloat +import org.python.core.PyInteger as PyInteger import traceback import datetime @@ -31,10 +32,12 @@ def _create_tables(paths, stream_value, data_type, shape, images): create_dataset(root + id, 'd', dimensions = [images, len(val)]) elif isinstance(val, PyLong): create_dataset(root + id, 'l', dimensions = [images]) + elif isinstance(val, PyInteger): + create_dataset(root + id, 'i', dimensions = [images]) elif isinstance(val, PyFloat): create_dataset(root + id, 'd', dimensions = [images]) else: - print "Unmanaged stream type: ", val, type(val) + print "Unmanaged stream type: ", id, val, type(val) pass @@ -55,12 +58,14 @@ def _append_frame(paths, stream_value, index, data_type, shape): append_dataset(root + id, val, index) elif isinstance(val, PyLong): append_dataset(root + id, int(val), index) + elif isinstance(val, PyInteger): + append_dataset(root + id, int(val), index) elif isinstance(val, PyFloat): append_dataset(root + id, float(val), index) else: pass except: - print id, val + print "Error persisting: ", id, " - index: ", index, "-value: " , val traceback.print_exc() #print "Saved frame: ", index diff --git a/script/Tools/save_camera_data.py b/script/Tools/save_camera_data.py index 0848775..3a68747 100644 --- a/script/Tools/save_camera_data.py +++ b/script/Tools/save_camera_data.py @@ -7,9 +7,10 @@ import ch.psi.pshell.imaging.Colormap as Colormap if get_exec_pars().source == CommandSource.ui: #camera_name = "SARBD02-DSCR050" # "SLG-LCAM-C041_sp" #camera_name = "SARBD02-DSCR050_sp" # "SLG-LCAM-C041_sp" - camera_name = "simulation_sp" # "SLG-LCAM-C041_sp" + #camera_name = "simulation_Fsp" # "SLG-LCAM-C041_sp" + camera_name = "SLG-LCAM-C041_sp" shared = False - images = 1 + images = 2 interval = -1 roi = "" #roi = "[300, 200]" diff --git a/script/Undulators/K-calc.py b/script/Undulators/K-calc.py index 7e7bb07..5bd2187 100644 --- a/script/Undulators/K-calc.py +++ b/script/Undulators/K-calc.py @@ -1,16 +1,32 @@ -Eph1 = 2.165# actual photon energy -Eph2 = 2.185 # desired photon energy +Eph1 = 8.7 # actual photon energy +Eph2 = 5.8 # desired photon energy -# beam on-delay during change! +do_elog = True undlist = ("SARUN03","SARUN04","SARUN05","SARUN06","SARUN07","SARUN08","SARUN09","SARUN10","SARUN11","SARUN12","SARUN13","SARUN14","SARUN15") - +K1, K2 = {}, {} for und in undlist: - K1 = caget(und + "-UIND030:K_SET") - K2 = ((Eph1 / Eph2 * (K1**2 + 2) - 2))**0.5 - print K1,K2 - caput(und + "-UIND030:K_SET", 0.07) - time.sleep(10.0) - caput(und + "-UIND030:K_SET", K2) -print "finished" \ No newline at end of file + K = caget(und + "-UIND030:K_SET") + K1[und] = K + K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5 +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) +for und in undlist: caput(und + "-UIND030:K_SET", K2[und]) +time.sleep(10.0) +# set laser on-beam +caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel",0) +caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC",1) + +#Elog entry +if do_elog: + title = "Wavelength change" + log_msg = "Old photon energy: %0.2f" % Eph1 + " kev\n" + log_msg = log_msg + "New photon energy: %0.2f" % Eph2 + " keV\n" + attachments = none + elog(title, log_msg, attachments) \ No newline at end of file diff --git a/script/Undulators/K-calc2.py b/script/Undulators/K-calc2.py deleted file mode 100644 index 8cd71ed..0000000 --- a/script/Undulators/K-calc2.py +++ /dev/null @@ -1,31 +0,0 @@ -Eph1 = 2.165 # actual photon energy -Eph2 = 2.185 # desired photon energy - -do_elog = False - -undlist = ("SARUN03","SARUN04","SARUN05","SARUN06","SARUN07","SARUN08","SARUN09","SARUN10","SARUN11","SARUN12","SARUN13","SARUN14","SARUN15") - -K1, K2 = {}, {} -for und in undlist: - K = caget(und + "-UIND030:K_SET") - K1[und] = K - K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5 -# 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", 0.07) - time.sleep(40.0) -for und in undlist: caput(und + "-UIND030:K_SET", K2[und]) -time.sleep(40.0) -# set laser on-beam -caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel",0) -caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC",1) - -#Elog entry -if do_elog: - title = "Wavelength change" - log_msg = "Old photon energy: %0.2f" % Eph1 + " kev\n" - log_msg = log_msg + "New photon energy: %0.2f" % Eph2 + " keV\n" - attachments = none - elog(title, log_msg, attachments) \ No newline at end of file diff --git a/script/test/WireScanMock.py b/script/test/WireScanMock.py index a6e01a3..0bc3bdd 100644 --- a/script/test/WireScanMock.py +++ b/script/test/WireScanMock.py @@ -9,8 +9,8 @@ BPM_SENSORS = [("x","X1"), ("y","Y1"), ("q","Q1")] #(logic name sufix, channel s #Paramter parsing prefix = args[0] if is_panel else "S30CB09-DWSC440" #"SINDI01-DWSC090" scan_type = args[1] if is_panel else "X1" -scan_range = args[2] if is_panel else [-200, 200, -200, 200] -cycles = args[3] if is_panel else 3 +scan_range = args[2] if is_panel else [-2000, 800, 0, 0] +cycles = args[3] if is_panel else 1 velocity = args[4] if is_panel else 200 bpms = args[5] if is_panel else ["BPM1", "BPM2"] blms = args[6] if is_panel else ["BLM1", "BLM2"] @@ -115,7 +115,8 @@ def do_background(): r = tscan ( channels, bkgrd, 0.01) for i in range(len(r.getReadables())): d = r.getReadable(i) - path = get_exec_pars().group + "/"+ r.getReadables()[i].name + path = get_exec_pars().group + "/data/"+ r.getReadables()[i].name + print path set_attribute(path, "Mean", mean(d)) set_attribute(path, "Sigma", stdev(d) ) @@ -147,7 +148,7 @@ def do_scan(index): l=[Sensor("w_pos")] ; l.extend(channels); l.append(Timestamp()) #mscan (st, l, -1, -1, take_initial = True, after_read = check_end_scan) - #tscan([w_pos()] + getReadables() + [Timestamp(),], 10, 0.5) + #tscan([w_pos()] + getReadables() + [Timestamp(),], 10, 0.5) for i in range(cycles): set_exec_pars(group=wire+"_{count}", reset=(i==0)) tscan(l, 10, 0.5) @@ -177,20 +178,31 @@ def calculate(): for i in range(len(blms)): msg += "Wire " + wire + " - BLM " + str(i+1) + ":\n" try: - bg = get_attributes("background/blm" + str(i+1))["Mean"] if bkgrd>0 else 0.0 + print "-----" + print "background/data/blm" + str(i+1) + print get_attributes("background/data/blm" + str(i+1)) + bg = get_attributes("background/data/blm" + str(i+1))["Mean"] if bkgrd>0 else 0.0 samples = [[], [], [], []] for cycle in range (cycles): - pos_path = wire+"_" + ("%04d" % (cycle+1)) + "/w_pos" + """ + pos_path = wire+"_" + ("%04d" % (cycle+1)) + "/data/w_pos" pos = load_data(pos_path) - path = wire+"_" + ("%04d" % (cycle+1)) + "/blm" + str(i+1) + path = wire+"_" + ("%04d" % (cycle+1)) + "/data/blm" + str(i+1) data = load_data(path) sp = data #blm_remove_spikes(data) + """ + pos_path = wire+"_" + ("%04d" % (cycle+1)) + "/data/w_pos" + print "Loading ", pos_path + pos = load_data(pos_path+"/value") + path = wire+"_" + ("%04d" % (cycle+1)) + "/data/blm" + str(i+1) + print "Loading ", path + data = load_data(path+"/value") + sp = data #blm_remove_spikes(data) sig = sp if bg is None else [v-bg for v in sp] rms_com, rms_sigma = [10.0, 20.0] #[profile_rms_stats(pos, sig,noise_std=0, n_sigma=3.5) set_attribute(path, "RMS COM", float("nan") if (rms_com is None) else rms_com) set_attribute(path, "RMS Sigma", float("nan") if (rms_sigma is None) else rms_sigma) - #print [com, rms] [off, amp, com, sigma] = [30.0, 40.0, 50.0, 60.0] #profile_gauss_stats(pos, sig, off=None, amp=None, com=None, sigma=None) set_attribute(path, "Gauss COM", float("nan") if (com is None) else com) @@ -198,7 +210,10 @@ def calculate(): samples[0].append(rms_com);samples[1].append(rms_sigma);samples[2].append(com);samples[3].append(sigma) print get_exec_pars().path + " | "+ path - ret.append([rms_com, rms_sigma, com, sigma, get_exec_pars().path + "|"+ pos_path, get_exec_pars().path + "|"+ path]) + #ret.append([rms_com, rms_sigma, com, sigma, get_exec_pars().path + "|"+ pos_path, get_exec_pars().path + "|"+ path]) + #ret.extend([rms_com, rms_sigma, com, sigma, filename + "|"+ pos_path +"/value", filename + "|"+ path +"/value"]) + ret.append([rms_com, rms_sigma, com, sigma, filename + "|"+ pos_path +"/value", filename + "|"+ path +"/value"]) + #print [off, amp, com, sigma] #from mathutils import Gaussian @@ -225,6 +240,7 @@ def calculate(): print "Starting scan..." + try: do_background() do_scan(0)