diff --git a/config/AbsortionSpectrum/C K edge-NCM.abs b/config/AbsortionSpectrum/C K edge-NCM.abs new file mode 100644 index 0000000..e438ed5 Binary files /dev/null and b/config/AbsortionSpectrum/C K edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/Cl L edge-NCM.abs b/config/AbsortionSpectrum/Cl L edge-NCM.abs new file mode 100644 index 0000000..3b2d894 Binary files /dev/null and b/config/AbsortionSpectrum/Cl L edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/Co L edge-NCM.abs b/config/AbsortionSpectrum/Co L edge-NCM.abs new file mode 100644 index 0000000..dc10cda Binary files /dev/null and b/config/AbsortionSpectrum/Co L edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/Cr L edge NCM.abs b/config/AbsortionSpectrum/Cr L edge NCM.abs new file mode 100644 index 0000000..c463627 Binary files /dev/null and b/config/AbsortionSpectrum/Cr L edge NCM.abs differ diff --git a/config/AbsortionSpectrum/Cu_L32_fine.abs b/config/AbsortionSpectrum/Cu_L32_fine.abs new file mode 100644 index 0000000..5eb704f Binary files /dev/null and b/config/AbsortionSpectrum/Cu_L32_fine.abs differ diff --git a/config/AbsortionSpectrum/Mn L edge-NCM.abs b/config/AbsortionSpectrum/Mn L edge-NCM.abs new file mode 100644 index 0000000..86c721b Binary files /dev/null and b/config/AbsortionSpectrum/Mn L edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/Mn_L3_L2fine.abs b/config/AbsortionSpectrum/Mn_L3_L2fine.abs new file mode 100644 index 0000000..a7a8f17 Binary files /dev/null and b/config/AbsortionSpectrum/Mn_L3_L2fine.abs differ diff --git a/config/AbsortionSpectrum/Mn_L3_L2fine2.abs b/config/AbsortionSpectrum/Mn_L3_L2fine2.abs new file mode 100644 index 0000000..1ed3d55 Binary files /dev/null and b/config/AbsortionSpectrum/Mn_L3_L2fine2.abs differ diff --git a/config/AbsortionSpectrum/Mn_L3_L2medium.abs b/config/AbsortionSpectrum/Mn_L3_L2medium.abs new file mode 100644 index 0000000..db21f6c Binary files /dev/null and b/config/AbsortionSpectrum/Mn_L3_L2medium.abs differ diff --git a/config/AbsortionSpectrum/Ni L edge-NCM.abs b/config/AbsortionSpectrum/Ni L edge-NCM.abs new file mode 100644 index 0000000..58ec8df Binary files /dev/null and b/config/AbsortionSpectrum/Ni L edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/O K edge-NCM.abs b/config/AbsortionSpectrum/O K edge-NCM.abs new file mode 100644 index 0000000..a242c88 Binary files /dev/null and b/config/AbsortionSpectrum/O K edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/O_Sara.abs b/config/AbsortionSpectrum/O_Sara.abs new file mode 100644 index 0000000..2fb5bdd Binary files /dev/null and b/config/AbsortionSpectrum/O_Sara.abs differ diff --git a/config/AbsortionSpectrum/P-S L edge-NCM broad.abs b/config/AbsortionSpectrum/P-S L edge-NCM broad.abs new file mode 100644 index 0000000..dc71dab Binary files /dev/null and b/config/AbsortionSpectrum/P-S L edge-NCM broad.abs differ diff --git a/config/AbsortionSpectrum/P-S L edge-NCM.abs b/config/AbsortionSpectrum/P-S L edge-NCM.abs new file mode 100644 index 0000000..5db8da2 Binary files /dev/null and b/config/AbsortionSpectrum/P-S L edge-NCM.abs differ diff --git a/config/AbsortionSpectrum/Ti_L23_edge_fine.abs b/config/AbsortionSpectrum/Ti_L23_edge_fine.abs new file mode 100644 index 0000000..919a7fe Binary files /dev/null and b/config/AbsortionSpectrum/Ti_L23_edge_fine.abs differ diff --git a/config/AbsortionSpectrum/Ti_L3_Arik.abs b/config/AbsortionSpectrum/Ti_L3_Arik.abs new file mode 100644 index 0000000..c64c179 Binary files /dev/null and b/config/AbsortionSpectrum/Ti_L3_Arik.abs differ diff --git a/config/AbsortionSpectrum/Ti_Sara.abs b/config/AbsortionSpectrum/Ti_Sara.abs new file mode 100644 index 0000000..e98294d Binary files /dev/null and b/config/AbsortionSpectrum/Ti_Sara.abs differ diff --git a/config/ROIs/saraROI.roi b/config/ROIs/saraROI.roi new file mode 100644 index 0000000..45b5a3f Binary files /dev/null and b/config/ROIs/saraROI.roi differ diff --git a/config/ROIs/test.roi b/config/ROIs/test.roi index a465f57..b8d5f60 100755 Binary files a/config/ROIs/test.roi and b/config/ROIs/test.roi differ diff --git a/config/config.properties b/config/config.properties index b3aced4..79dcd90 100755 --- a/config/config.properties +++ b/config/config.properties @@ -1,39 +1,23 @@ -#Fri Mar 05 11:56:08 CET 2021 -imageSourcesFile={config}/imaging.properties +#Wed Oct 27 10:03:30 CEST 2021 autoSaveScanData=true simulation=false -commandExecutionEvents=true -logDaysToLive=7 dataScanSaveOutput=false userAuthenticator= -logLevelConsole=Off -scanStreamerPort=-1 dataScanSaveScript=false -dataScanSaveSetpoints=false notifiedTasks=EigerAbsSpec|Eiger2Img parallelInitialization=true dataTransferPath=~/Data1 scanStreamingPort=-1 saveConsoleSessionFiles=false devicePoolFile={config}/devices.properties -versionTrackingManual=true -dataTransferMode=Off hostName=null -userManagement=true -instanceName=SIM disableEmbeddedAttributes=false -dataServerPort=-1 -hideServerMessages=false serverPort=8080 versionTrackingEnabled=true dataPath={data}/{year}_{month}/{date}/{date}_{seq}%04d_{name} serverEnabled=false -dataScanReleaseRecords=false depthDimension=0 -dataScanPreserveTypes=false logLevel=Info -dataScanFlushRecords=true -logPath={logs}/{date}_{time} dataLayout=table disableDataFileLogs=false sessionHandling=On @@ -41,10 +25,31 @@ deviceUpdateStrategyFile={config}/update.properties terminalEnabled=false notificationLevel=Completion terminalPort=3579 -tasksFile={config}/tasks.properties dataTransferUser= -createSessionFiles=false versionTrackingLogin={context}/svcusr-hlapp_robot +noBytecodeFiles=false versionTrackingRemote=git@git.psi.ch\:pshell_config/x11ma.git +imageSourcesFile={config}/imaging.properties +commandExecutionEvents=true +logDaysToLive=7 +logLevelConsole=Off +filePermissionsConfig=Public +scanStreamerPort=-1 +dataScanSaveSetpoints=false +versionTrackingManual=true +dataTransferMode=Off +userManagement=true +instanceName=SIM +dataServerPort=-1 +hideServerMessages=false +dataScanReleaseRecords=false +dataScanPreserveTypes=false +dataScanFlushRecords=true +logPath={logs}/{date}_{time} +filePermissionsLogs=Public +filePermissionsScripts=Public +tasksFile={config}/tasks.properties +filePermissionsData=Default +createSessionFiles=false dataProvider=txt saveCommandStatistics=false diff --git a/config/devices.properties b/config/devices.properties old mode 100755 new mode 100644 index 9e39420..20a7a43 --- a/config/devices.properties +++ b/config/devices.properties @@ -1,6 +1,5 @@ -#fe_slit_V_ctr:offset=ch.psi.pshell.epics.ChannelDouble|||| +eiger=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-SD1|||true fe_slit_V_ctr=ch.psi.pshell.epics.Motor|X11MA-FE-SV:center|||true -#fe_slit_H_ctr_offset=ch.psi.pshell.epics.ChannelDouble|||| fe_slit_H_ctr=ch.psi.pshell.epics.Motor|X11MA-FE-SH:center|||true fe_slit_V_size_offs=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-DSVER.A|||true fe_slit_V_size=ch.psi.pshell.epics.Motor|X11MA-FE-SV:size|||true @@ -69,7 +68,6 @@ keithley_1a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC1|Read||true keithley_2a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC2|Read||true keithley_3a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC3|Read||true otf_start=ch.psi.pshell.epics.ChannelInteger|X11MA-OTF:GO|||true -eiger=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-SD1|||true eiger_bit_depth_rbv=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth_RBV|Read||true eiger_mode_rbv=ch.psi.pshell.epics.ChannelString|X11MA-ES1-SD1:cam1:ImageMode_RBV|Read||true eiger_exposure_rbv=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime_RBV 2|Read||true @@ -78,15 +76,15 @@ eiger_bit_depth=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth|| eiger_mode=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:ImageMode|||true eiger_exposure=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime 2|||true Ecrbk=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:CERBK|Read||true -#CADC1=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC1|Read||true -#CADC2=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC2|Read||true -#CADC3=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC3|Read||true +CADC1=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC1|Read||true +CADC2=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC2|Read||true +CADC3=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC3|Read||true #CADC4=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC4|Read||true #CADC5=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC5|Read||true #CADC6=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC6|Read||true #CADC7=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC7|Read||true girder_x=ch.psi.pshell.epics.Positioner|X11MA-HG:X_SET X11MA-HG:X1|||true cam2=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-CAM2|||true -image=ch.psi.pshell.imaging.CameraSource|eiger|||true +raw=ch.psi.pshell.imaging.CameraSource|eiger|||true image2=ch.psi.pshell.imaging.CameraSource|cam2|||true axis=ch.psi.pshell.imaging.MjpegSource|http://axis-x11ma.psi.ch/axis-cgi/mjpg/video.cgi?id=176 true||-200|false diff --git a/config/plugins.properties b/config/plugins.properties index 124b41f..3948137 100755 --- a/config/plugins.properties +++ b/config/plugins.properties @@ -1,3 +1,10 @@ +Align_ComputeShifts.java=disabled +Imaging.java=disabled +Initialization.java=disabled +TestLuka.java=disabled +Align_TranslationFilter.java=disabled +ShiftsIO.java=disabled +Align_ComplexEdgeFiltering.java=disabled OTFScanBase.java=enabled EnergyScanBase.java=enabled DelayScanBase.java=enabled diff --git a/config/session_metadata.properties b/config/session_metadata.properties index 994f00a..3744647 100755 --- a/config/session_metadata.properties +++ b/config/session_metadata.properties @@ -1,5 +1,5 @@ -#Thu Sep 02 13:21:00 CEST 2021 +#Sat Dec 04 14:45:18 CET 2021 keywords=List;[] -ownerEmail=String;jinghui.luo@psi.ch +ownerEmail=String;arik.beck@psi.ch contactEmail=String;armin.kleibert@psi.ch -owner=String;Jinghui Luo +owner=String;Federico Stramaglia diff --git a/config/sessions.properties b/config/sessions.properties index e2f6e5f..b2d0027 100755 --- a/config/sessions.properties +++ b/config/sessions.properties @@ -1,2 +1,2 @@ -#Fri Sep 03 09:21:14 CEST 2021 -SessionCounter=38 +#Mon Nov 29 10:07:24 CET 2021 +SessionCounter=54 diff --git a/config/settings.properties b/config/settings.properties old mode 100755 new mode 100644 index 53d85e4..d81d029 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,18 +1,18 @@ -#Thu Sep 09 14:50:51 CEST 2021 +#Tue Dec 14 13:48:54 CET 2021 HARMONIC_ID_1=1 RSYNC_USER= OUTLIERS_THRESHOLD=1000000000 -NORM_FILE=/sls/X11MA/data/X11MA/Data1/2021/Yona250121/s250121 +NORM_FILE=/sls/X11MA/data/e19357/Data1/2021_10 AUTO_SWITCH_VALVE=true DRY_RUN=false POL_ID_2=Lin_Hor -OFFSET_ID_1=0.0 +OFFSET_ID_1=-5.0 ID=ID2 -OFFSET_ID_2=0.0 +OFFSET_ID_2=-2.1 proposal=proposal -ENERGY=706.3 +ENERGY=800.0 proposer=proposer -POL_ID_1=Circ_Plus +POL_ID_1=Lin_Hor RSYNC_HOST= sample=sample RSYNC_PATH= diff --git a/config/variables.properties b/config/variables.properties old mode 100755 new mode 100644 index 4953e1b..beb14ca --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Mon Sep 13 13:08:47 CEST 2021 -LastRunDate=210913 -FileSequentialNumber=9757 -DaySequentialNumber=34 +#Sat Dec 11 05:45:56 CET 2021 +LastRunDate=211211 +FileSequentialNumber=11873 +DaySequentialNumber=66 diff --git a/devices/girder_x.properties b/devices/girder_x.properties old mode 100755 new mode 100644 index 626fd2d..ac9164d --- a/devices/girder_x.properties +++ b/devices/girder_x.properties @@ -1,10 +1,10 @@ -#Wed May 05 15:14:33 CEST 2021 +#Tue Nov 02 11:19:09 CET 2021 offset=0.0 maxValue=3.0 rotation=false precision=3 scale=1.0 resolution=0.005 -minValue=2.0 +minValue=-2.0 unit=mm sign_bit=0 diff --git a/devices/image.properties b/devices/image.properties index 70c8374..ee95549 100755 --- a/devices/image.properties +++ b/devices/image.properties @@ -1,4 +1,4 @@ -#Mon Sep 13 13:04:13 CEST 2021 +#Mon Oct 25 14:11:15 CEST 2021 spatialCalOffsetY=NaN spatialCalOffsetX=NaN colormapLogarithmic=false @@ -6,12 +6,12 @@ scale=1.0 grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN -colormapMax=7000.0 +colormapMax=2000.0 rescaleOffset=0.0 roiWidth=-1 colormap=Grayscale invert=false -colormapMin=2000.0 +colormapMin=0.0 rotationCrop=false rotation=0.0 rescaleFactor=1.0 @@ -19,7 +19,7 @@ spatialCalUnits=null flipVertically=false roiHeight=-1 flipHorizontally=false -colormapAutomatic=false +colormapAutomatic=true roiY=0 roiX=0 transpose=false diff --git a/devices/raw.properties b/devices/raw.properties new file mode 100644 index 0000000..f2fa40e --- /dev/null +++ b/devices/raw.properties @@ -0,0 +1,25 @@ +#Fri Nov 26 15:39:45 CET 2021 +spatialCalOffsetY=NaN +spatialCalOffsetX=NaN +colormapLogarithmic=false +scale=1.0 +grayscale=false +spatialCalScaleX=NaN +spatialCalScaleY=NaN +colormapMax=NaN +rescaleOffset=0.0 +roiWidth=-1 +colormap=Grayscale +invert=false +colormapMin=NaN +rotation=0.0 +rotationCrop=false +rescaleFactor=1.0 +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=true +roiY=0 +roiX=0 +transpose=false diff --git a/devices/tst.tiff.properties b/devices/tst.tiff.properties new file mode 100644 index 0000000..bdba2ac --- /dev/null +++ b/devices/tst.tiff.properties @@ -0,0 +1,20 @@ +#Wed Oct 27 15:54:42 CEST 2021 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/plugins/DataAcquisition.form b/plugins/DataAcquisition.form index 9b229ef..f6204cb 100755 --- a/plugins/DataAcquisition.form +++ b/plugins/DataAcquisition.form @@ -330,16 +330,23 @@ - + - - - - - - - - + + + + + + + + + + + + + + + @@ -355,10 +362,15 @@ - + + + + + + - + @@ -485,6 +497,20 @@ + + + + + + + + + + + + + + diff --git a/plugins/DataAcquisition.java b/plugins/DataAcquisition.java index f91be15..b0c1dda 100755 --- a/plugins/DataAcquisition.java +++ b/plugins/DataAcquisition.java @@ -27,6 +27,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; +import java.util.logging.Logger; +import javax.script.ScriptException; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; @@ -34,6 +36,7 @@ import javax.swing.JFileChooser; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.JToggleButton; +import javax.swing.SwingUtilities; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.filechooser.FileNameExtensionFilter; @@ -165,6 +168,22 @@ public class DataAcquisition extends Panel { public void onExecutedFile(String fileName, Object result) { } + @Override + protected void onShow() { + super.onShow(); + new Thread(()->{ + String fov=""; + try { + fov = String.valueOf(eval("microscope.get_preset_label()", true)); + } catch (Exception ex) { + } + String label =fov; + SwingUtilities.invokeLater(()->{ + textFOV.setText(label); + }); + }).start(); + } + //Callback to perform update - in event thread @Override protected void doUpdate() { @@ -261,8 +280,8 @@ public class DataAcquisition extends Panel { model.setValueAt(rois.get(i).getWidth(), i, 3); model.setValueAt(rois.get(i).getHeight(), i, 4); } - Map> roi_dict = getRois(); - setGlobalVar("DAQ_PANEL_ROIS", roi_dict); + Map> roi_dict = getRois(); + setGlobalVar("DAQ_PANEL_ROIS", roi_dict); } void addRoi(Rect roi) { @@ -493,6 +512,8 @@ public class DataAcquisition extends Panel { buttonRoiClear = new javax.swing.JButton(); buttonRoiSave = new javax.swing.JButton(); buttonRoiOpen = new javax.swing.JButton(); + textFOV = new javax.swing.JTextField(); + jLabel7 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); buttonImgStart = new javax.swing.JButton(); buttonImgAbort = new javax.swing.JButton(); @@ -860,22 +881,33 @@ public class DataAcquisition extends Panel { } }); + textFOV.setHorizontalAlignment(javax.swing.JTextField.CENTER); + textFOV.setDisabledTextColor(new java.awt.Color(0, 0, 0)); + textFOV.setEnabled(false); + + jLabel7.setText("FOV:"); + javax.swing.GroupLayout panelRoiLayout = new javax.swing.GroupLayout(panelRoi); panelRoi.setLayout(panelRoiLayout); panelRoiLayout.setHorizontalGroup( panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelRoiLayout.createSequentialGroup() .addGap(17, 17, 17) - .addComponent(rendererRoi, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE) + .addComponent(rendererRoi, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE) .addGap(18, 18, 18) - .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) - .addComponent(buttonRoiRemove, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) - .addComponent(buttonRoiAdd, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) - .addComponent(jLabel26) - .addComponent(buttonRoiClear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonRoiOpen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonRoiSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(buttonRoiRemove, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(buttonRoiAdd, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabel26) + .addComponent(buttonRoiClear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonRoiOpen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonRoiSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(panelRoiLayout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(13, 13, 13)) ); panelRoiLayout.setVerticalGroup( @@ -888,10 +920,14 @@ public class DataAcquisition extends Panel { .addComponent(buttonRoiAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonRoiRemove, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(buttonRoiClear, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -2036,6 +2072,7 @@ public class DataAcquisition extends Panel { private javax.swing.JLabel jLabel31; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; @@ -2099,6 +2136,7 @@ public class DataAcquisition extends Panel { private javax.swing.JTable tableRegions; private javax.swing.JTable tableRoi; private javax.swing.JButton textClearOutliersMask; + private javax.swing.JTextField textFOV; private javax.swing.JTextField textNorm; private javax.swing.JTextField textOutliersMask; private javax.swing.JButton textSelectOutliersMask; diff --git a/plugins/Eiger.form b/plugins/Eiger.form index 7e23739..ae26afe 100755 --- a/plugins/Eiger.form +++ b/plugins/Eiger.form @@ -20,29 +20,46 @@ - - - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,24 +77,14 @@ - - - - - - - - - - - - - - - + + + + + - + @@ -114,6 +121,11 @@ + + + + + @@ -134,7 +146,7 @@ - + @@ -329,5 +341,19 @@ + + + + + + + + + + + + + + diff --git a/plugins/Eiger.java b/plugins/Eiger.java index 64331ff..21d46bf 100755 --- a/plugins/Eiger.java +++ b/plugins/Eiger.java @@ -6,6 +6,7 @@ import ch.psi.utils.State; import java.io.IOException; import java.util.logging.Level; import java.util.concurrent.TimeUnit; +import javax.swing.SwingUtilities; /** * @@ -69,16 +70,32 @@ public class Eiger extends Panel { try{ spinnerExposure.setValue(exposure.take()); } catch (Exception ex){ - } + } comboDepth.setEnabled(bitDepth.isInitialized()); comboMode.setEnabled(mode.isInitialized()); spinnerExposure.setEnabled(exposure.isInitialized()); } finally{ updatingControls=false; - } + } } + @Override + protected void onShow() { + super.onShow(); + new Thread(()->{ + String fov=""; + try { + fov = String.valueOf(eval("microscope.get_preset_label()", true)); + } catch (Exception ex) { + } + String label =fov; + SwingUtilities.invokeLater(()->{ + textFOV.setText(label); + }); + }).start(); + } + //Callback to perform update - in event thread @Override @@ -112,6 +129,8 @@ public class Eiger extends Panel { spinnerMin = new javax.swing.JSpinner(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + textFOV = new javax.swing.JTextField(); renderer.setDeviceName("image"); renderer.setMode(ch.psi.pshell.imaging.RendererMode.Stretch); @@ -224,6 +243,12 @@ public class Eiger extends Panel { jLabel6.setText("Min:"); + jLabel7.setText("FOV:"); + + textFOV.setHorizontalAlignment(javax.swing.JTextField.CENTER); + textFOV.setDisabledTextColor(new java.awt.Color(0, 0, 0)); + textFOV.setEnabled(false); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -231,41 +256,6 @@ public class Eiger extends Panel { .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(jLabel2) - .addComponent(jLabel3)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(224, 224, 224) - .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(spinnerExposure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(comboDepth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonAquire, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonOpenVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(118, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -278,10 +268,50 @@ public class Eiger extends Panel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(spinnerMax, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spinnerMin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel7)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(spinnerExposure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addGap(86, 86, 86) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(comboDepth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonAquire, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonOpenVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(310, 310, 310) + .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(118, Short.MAX_VALUE)))) ); - layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, spinnerExposure}); + layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, spinnerExposure, textFOV}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -309,6 +339,10 @@ public class Eiger extends Panel { .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(36, 36, 36) @@ -328,10 +362,10 @@ public class Eiger extends Panel { .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)))) + .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 368, Short.MAX_VALUE)))) ); - layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, deviceValuePanel4, spinnerExposure}); + layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, deviceValuePanel4, spinnerExposure, textFOV}); }// //GEN-END:initComponents @@ -515,9 +549,11 @@ public class Eiger extends Panel { private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; private ch.psi.pshell.imaging.Renderer renderer; private javax.swing.JSpinner spinnerExposure; private javax.swing.JSpinner spinnerMax; private javax.swing.JSpinner spinnerMin; + private javax.swing.JTextField textFOV; // End of variables declaration//GEN-END:variables } diff --git a/plugins/Imaging.form b/plugins/Imaging.form new file mode 100644 index 0000000..264ed59 --- /dev/null +++ b/plugins/Imaging.form @@ -0,0 +1,595 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/Imaging.java b/plugins/Imaging.java new file mode 100644 index 0000000..a0c930c --- /dev/null +++ b/plugins/Imaging.java @@ -0,0 +1,747 @@ +import ch.psi.pshell.imaging.Overlay; +import ch.psi.pshell.imaging.Overlays.Rect; +import ch.psi.pshell.imaging.Renderer; +import ch.psi.pshell.imaging.RendererListener; +import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; +import java.awt.Rectangle; +import java.util.HashMap; + +/** + * + */ +public class Imaging extends Panel { + static double NaNd = Double.NaN; //Bug on editor? + + public Imaging() { + initComponents(); + renderer.addListener(rendererListener); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + try { + setGlobalVar("IMAGING_RENDERER", renderer); + setRoi(getRoi()); + } catch (Exception ex) { + showException(ex); + } + } + + @Override + public void onStateChange(State state, State former) { + buttonAbort.setEnabled(state.isProcessing()); + updateButtons(); + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + + //Callback to perform update - in event thread + @Override + protected void doUpdate() { + } + + void updateButtons(){ + boolean enabled = getState()==State.Ready; + boolean hasRoi = false; + try{ + hasRoi = getRoi()!=null; + } catch (Exception ex){ + } + buttonStartAutoFocus.setEnabled(hasRoi && enabled); + buttonStartAutoIntensity.setEnabled(enabled); + buttonRoiClear.setEnabled(hasRoi && enabled); + buttonRoiSet.setEnabled(!hasRoi && enabled); + spinnerAverage.setEnabled(enabled); + spinnerRuns.setEnabled(enabled); + spinnerExposition.setEnabled(enabled); + spinnerRangeObj.setEnabled((radioObjective.isSelected() || radioAll.isSelected()) && enabled); + spinnerStepObj.setEnabled(spinnerRangeObj.isEnabled()); + spinnerRangeStig.setEnabled((!radioObjective.isSelected()) && enabled); + spinnerStepStig.setEnabled(spinnerRangeStig.isEnabled()); + radioObjective.setEnabled(enabled); + radioStigA.setEnabled(enabled); + radioStigB.setEnabled(enabled); + radioAll.setEnabled(enabled); + } + + @Override + protected void onShow() { + super.onShow(); + renderer.setDeviceName("image"); + + } + + @Override + protected void onHide() { + super.onHide(); + renderer.setDeviceName(null); + } + + Rectangle getRoi(){ + return (Rectangle) getGlobalVar("IMAGING_ROI"); + } + + void setRoi(Rectangle roi){ + setGlobalVar("IMAGING_ROI", roi); + try{ + renderer.clearOverlays(); + if (roi!=null){ + Rect ov = new Rect(renderer.getPenProfile(), roi.getLocation(), roi.getSize()); + ov.setMovable(true); + renderer.addOverlay(ov); + } + } finally { + updateButtons(); + } + } + + + final RendererListener rendererListener = new RendererListener(){ + @Override + public void onMoveFinished(Renderer renderer, Overlay overlay) { + setGlobalVar("IMAGING_ROI", overlay.getBounds()); + } + + @Override + public void onDeleted(Renderer renderer, Overlay overlay) { + if (getRoi()!=null){ + setRoi(null); + } + } + }; + + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + buttonGroup1 = new javax.swing.ButtonGroup(); + renderer = new ch.psi.pshell.imaging.Renderer(); + jPanel4 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + buttonStartAutoIntensity = new javax.swing.JButton(); + buttonAbort = new javax.swing.JButton(); + jPanel1 = new javax.swing.JPanel(); + buttonRoiSet = new javax.swing.JButton(); + buttonRoiClear = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + spinnerWidth = new javax.swing.JSpinner(); + jLabel2 = new javax.swing.JLabel(); + spinnerHeight = new javax.swing.JSpinner(); + jPanel3 = new javax.swing.JPanel(); + buttonStartAutoFocus = new javax.swing.JButton(); + jLabel3 = new javax.swing.JLabel(); + spinnerAverage = new javax.swing.JSpinner(); + jLabel4 = new javax.swing.JLabel(); + spinnerRuns = new javax.swing.JSpinner(); + jPanel5 = new javax.swing.JPanel(); + radioObjective = new javax.swing.JRadioButton(); + radioStigA = new javax.swing.JRadioButton(); + radioStigB = new javax.swing.JRadioButton(); + radioAll = new javax.swing.JRadioButton(); + jPanel6 = new javax.swing.JPanel(); + spinnerRangeObj = new javax.swing.JSpinner(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + spinnerStepObj = new javax.swing.JSpinner(); + jLabel7 = new javax.swing.JLabel(); + spinnerRangeStig = new javax.swing.JSpinner(); + jLabel8 = new javax.swing.JLabel(); + spinnerStepStig = new javax.swing.JSpinner(); + jLabel9 = new javax.swing.JLabel(); + spinnerExposition = new javax.swing.JSpinner(); + + renderer.setMode(ch.psi.pshell.imaging.RendererMode.Fit); + + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Auto-Intensity")); + + buttonStartAutoIntensity.setText("Start"); + buttonStartAutoIntensity.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonStartAutoIntensityActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonStartAutoIntensity) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonStartAutoIntensity) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + buttonAbort.setText("Abort"); + buttonAbort.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonAbortActionPerformed(evt); + } + }); + + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("ROI")); + + buttonRoiSet.setText("Set"); + buttonRoiSet.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonRoiSetActionPerformed(evt); + } + }); + + buttonRoiClear.setText("Clear"); + buttonRoiClear.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonRoiClearActionPerformed(evt); + } + }); + + jLabel1.setText("Width:"); + + spinnerWidth.setModel(new javax.swing.SpinnerListModel(new String[] {"16", "32", "64", "128", "256", "512"})); + spinnerWidth.setValue("256"); + spinnerWidth.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerWidthStateChanged(evt); + } + }); + + jLabel2.setText("Height"); + + spinnerHeight.setModel(new javax.swing.SpinnerListModel(new String[] {"16", "32", "64", "128", "256", "512"})); + spinnerHeight.setValue("256"); + spinnerHeight.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerHeightStateChanged(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(buttonRoiClear) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonRoiSet, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, Short.MAX_VALUE) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + ); + + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2}); + + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerHeight, spinnerWidth}); + + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonRoiClear, buttonRoiSet}); + + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(buttonRoiClear) + .addComponent(buttonRoiSet) + .addComponent(jLabel1) + .addComponent(spinnerWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(spinnerHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Auto-Focus")); + + buttonStartAutoFocus.setText("Start"); + buttonStartAutoFocus.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonStartAutoFocusActionPerformed(evt); + } + }); + + jLabel3.setText("Average:"); + + spinnerAverage.setModel(new javax.swing.SpinnerNumberModel(1, 1, 10, 1)); + spinnerAverage.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerAverageStateChanged(evt); + } + }); + + jLabel4.setText("Runs:"); + + spinnerRuns.setModel(new javax.swing.SpinnerNumberModel(1, 0, 10, 1)); + spinnerRuns.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerRunsStateChanged(evt); + } + }); + + buttonGroup1.add(radioObjective); + radioObjective.setSelected(true); + radioObjective.setText("Objective"); + radioObjective.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + radioObjectiveActionPerformed(evt); + } + }); + + buttonGroup1.add(radioStigA); + radioStigA.setText("Stigmator A"); + radioStigA.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + radioStigAActionPerformed(evt); + } + }); + + buttonGroup1.add(radioStigB); + radioStigB.setText("Stigmator B"); + radioStigB.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + radioStigBActionPerformed(evt); + } + }); + + buttonGroup1.add(radioAll); + radioAll.setText("All"); + radioAll.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + radioAllActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); + jPanel5.setLayout(jPanel5Layout); + jPanel5Layout.setHorizontalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(radioObjective) + .addComponent(radioStigA) + .addComponent(radioStigB) + .addComponent(radioAll)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel5Layout.setVerticalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(radioObjective) + .addGap(0, 0, 0) + .addComponent(radioStigA) + .addGap(0, 0, 0) + .addComponent(radioStigB) + .addGap(0, 0, 0) + .addComponent(radioAll) + .addGap(0, 0, 0)) + ); + + spinnerRangeObj.setModel(new javax.swing.SpinnerNumberModel(4.0d, 1.0d, 10.0d, 1.0d)); + spinnerRangeObj.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerRangeObjStateChanged(evt); + } + }); + + jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel5.setText("Range Objective:"); + + jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel6.setText("Step Objective:"); + + spinnerStepObj.setModel(new javax.swing.SpinnerNumberModel(0.2d, 0.1d, 1.0d, 0.1d)); + spinnerStepObj.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerStepObjStateChanged(evt); + } + }); + + jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel7.setText("Range Stigmator:"); + + spinnerRangeStig.setModel(new javax.swing.SpinnerNumberModel(20.0d, 1.0d, 40.0d, 1.0d)); + spinnerRangeStig.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerRangeStigStateChanged(evt); + } + }); + + jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel8.setText("Step Stigmator:"); + + spinnerStepStig.setModel(new javax.swing.SpinnerNumberModel(2.0d, 1.0d, 10.0d, 1.0d)); + spinnerStepStig.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerStepStigStateChanged(evt); + } + }); + + javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); + jPanel6.setLayout(jPanel6Layout); + jPanel6Layout.setHorizontalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerStepObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, 0)) + ); + + jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel5, jLabel6, jLabel7, jLabel8}); + + jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerRangeObj, spinnerRangeStig, spinnerStepObj, spinnerStepStig}); + + jPanel6Layout.setVerticalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(0, 0, 0) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, 0) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(spinnerStepObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, 0) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + jLabel9.setText("Exposure:"); + + spinnerExposition.setModel(new javax.swing.SpinnerNumberModel(NaNd, 0.01d, NaNd, 1.0d)); + spinnerExposition.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerExpositionStateChanged(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spinnerAverage, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerRuns, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerExposition, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(97, 97, 97) + .addComponent(buttonStartAutoFocus) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerAverage, spinnerExposition, spinnerRuns}); + + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(4, 4, 4) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(spinnerAverage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(4, 4, 4) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(spinnerRuns, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(4, 4, 4) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(spinnerExposition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonStartAutoFocus) + .addContainerGap()) + ); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonAbort) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonAbort) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + private void buttonRoiClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRoiClearActionPerformed + try { + setRoi(null); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonRoiClearActionPerformed + + private void buttonRoiSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRoiSetActionPerformed + try { + Rectangle roi = new Rectangle(0,0,Integer.valueOf(spinnerWidth.getValue().toString()),Integer.valueOf(spinnerHeight.getValue().toString())); + setRoi(roi); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonRoiSetActionPerformed + + private void spinnerWidthStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerWidthStateChanged + try { + Rectangle roi = getRoi(); + if (roi!=null){ + roi.width = Integer.valueOf(spinnerWidth.getValue().toString()); + setRoi(roi); + } + + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_spinnerWidthStateChanged + + private void spinnerHeightStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerHeightStateChanged + try { + Rectangle roi = getRoi(); + if (roi!=null){ + roi.height = Integer.valueOf(spinnerHeight.getValue().toString()); + setRoi(roi); + } + + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_spinnerHeightStateChanged + + private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed + try { + abort(); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonAbortActionPerformed + + private void buttonStartAutoFocusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartAutoFocusActionPerformed + try { + HashMap args = new HashMap(); + String scan_type = "all"; + if (radioObjective.isSelected()){ + scan_type = "obj"; + } else if (radioStigA.isSelected()){ + scan_type = "stiga"; + } else if (radioStigB.isSelected()){ + scan_type = "stigb"; + } + int average = (Integer)spinnerAverage.getValue(); + int runs = (Integer)spinnerRuns.getValue(); + Double exposure = (Double) spinnerExposition.getValue(); + + //runAsync("templates/AutoFocus", args).handle((ret, t) -> { + //auto_focus(range_obj=4.0, step_obj=0.2, range_stig=20.0, step_stig=2.0, average=1, runs=2, roi=None): + String cmd = "auto_focus(scan_type='" + scan_type + "'" + + ", range_obj=" + spinnerRangeObj.getValue() + + ", step_obj=" + spinnerStepObj.getValue() + + ", range_stig=" + spinnerRangeStig.getValue() + + ", step_stig=" + spinnerStepStig.getValue() + + ", average=" + average + + ", runs=" + runs + + ", renderer=IMAGING_RENDERER"+ + ", roi=IMAGING_ROI"+ + ", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) + ")"; + this.evalAsync(cmd).handle((ret, t) -> { + if ((t != null) && (!getContext().isAborted())) { + showException((Exception) t); + } + return t; + }); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonStartAutoFocusActionPerformed + + private void buttonStartAutoIntensityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartAutoIntensityActionPerformed + try { + //String cmd = "scan_contrast(girder_x, 0.05, 0.005, average=3)"; + String cmd = "auto_intensity(roi=IMAGING_ROI)"; + this.evalAsync(cmd).handle((ret, t) -> { + if ((t != null) && (!getContext().isAborted())) { + showException((Exception) t); + } + return t; + }); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonStartAutoIntensityActionPerformed + + private void spinnerAverageStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerAverageStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerAverageStateChanged + + private void spinnerRunsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRunsStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRunsStateChanged + + private void radioStigAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigAActionPerformed + updateButtons(); + }//GEN-LAST:event_radioStigAActionPerformed + + private void spinnerRangeObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeObjStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRangeObjStateChanged + + private void spinnerStepObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepObjStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerStepObjStateChanged + + private void spinnerRangeStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeStigStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRangeStigStateChanged + + private void spinnerStepStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepStigStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerStepStigStateChanged + + private void radioAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioAllActionPerformed + updateButtons(); + }//GEN-LAST:event_radioAllActionPerformed + + private void radioObjectiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioObjectiveActionPerformed + updateButtons(); + }//GEN-LAST:event_radioObjectiveActionPerformed + + private void radioStigBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigBActionPerformed + updateButtons(); + }//GEN-LAST:event_radioStigBActionPerformed + + private void spinnerExpositionStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExpositionStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerExpositionStateChanged + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton buttonAbort; + private javax.swing.ButtonGroup buttonGroup1; + private javax.swing.JButton buttonRoiClear; + private javax.swing.JButton buttonRoiSet; + private javax.swing.JButton buttonStartAutoFocus; + private javax.swing.JButton buttonStartAutoIntensity; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JPanel jPanel5; + private javax.swing.JPanel jPanel6; + private javax.swing.JRadioButton radioAll; + private javax.swing.JRadioButton radioObjective; + private javax.swing.JRadioButton radioStigA; + private javax.swing.JRadioButton radioStigB; + private ch.psi.pshell.imaging.Renderer renderer; + private javax.swing.JSpinner spinnerAverage; + private javax.swing.JSpinner spinnerExposition; + private javax.swing.JSpinner spinnerHeight; + private javax.swing.JSpinner spinnerRangeObj; + private javax.swing.JSpinner spinnerRangeStig; + private javax.swing.JSpinner spinnerRuns; + private javax.swing.JSpinner spinnerStepObj; + private javax.swing.JSpinner spinnerStepStig; + private javax.swing.JSpinner spinnerWidth; + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/Initialization.form b/plugins/Initialization.form new file mode 100644 index 0000000..3dfafc2 --- /dev/null +++ b/plugins/Initialization.form @@ -0,0 +1,47 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/Initialization.java b/plugins/Initialization.java new file mode 100644 index 0000000..849dcc8 --- /dev/null +++ b/plugins/Initialization.java @@ -0,0 +1,83 @@ + +import ch.psi.pshell.ui.Panel; +import javax.swing.JButton; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author gac-x11ma + */ +public class Initialization extends Panel { + + /** + * Creates new form Initialization + */ + public Initialization() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + buttonExecShellCmd = new javax.swing.JButton(); + + buttonExecShellCmd.setText("Init"); + buttonExecShellCmd.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonExecShellCmdActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(49, 49, 49) + .addComponent(buttonExecShellCmd, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(100, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(30, 30, 30) + .addComponent(buttonExecShellCmd) + .addContainerGap(243, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void buttonExecShellCmdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExecShellCmdActionPerformed + try { + String shellCommand = "exec_cmd(\"ls\")"; + boolean background = false; + + evalAsync(shellCommand, background).handle((ret, ex) -> { + ((JButton) evt.getSource()).setEnabled(true); + if (ex != null) { + showException((Exception) ex); + } else { + getContext().scriptingLog(String.format("Shell command '%s' return value: %s", shellCommand, String.valueOf(ret))); + } + return ret; + }); + + ((JButton) evt.getSource()).setEnabled(false); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonExecShellCmdActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton buttonExecShellCmd; + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/TestLuka.form b/plugins/TestLuka.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/TestLuka.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/TestLuka.java b/plugins/TestLuka.java new file mode 100644 index 0000000..14a92f2 --- /dev/null +++ b/plugins/TestLuka.java @@ -0,0 +1,52 @@ +import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; + +/** + * + */ +public class TestLuka extends Panel { + + public TestLuka() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + + //Callback to perform update - in event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/script/Test_Autofocus_Armin.py b/script/Test_Autofocus_Armin.py index 471baa9..5085c04 100755 --- a/script/Test_Autofocus_Armin.py +++ b/script/Test_Autofocus_Armin.py @@ -47,17 +47,17 @@ def update_roi(): r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) update_roi() -r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -update_roi() -r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -update_roi() -r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -update_roi() -r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -update_roi() -r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -update_roi() -r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# update_roi() +# r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# update_roi() +# r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# update_roi() +# r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# update_roi() +# r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +# update_roi() +# r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) final_state = objective.read(),obj_stig_a.read(),obj_stig_b.read() print "Final state:" , final_state diff --git a/script/Users/Beck/stack_image_and_spectrum.py b/script/Users/Beck/stack_image_and_spectrum.py new file mode 100644 index 0000000..f8309dd --- /dev/null +++ b/script/Users/Beck/stack_image_and_spectrum.py @@ -0,0 +1,34 @@ + #auto_intensity() + #time_sleep(2) +#TakeImage at 710 eV at the given polarization + +# do autoajust, give 1 minute to settle, do image aquisition with 5 frame average and go to sleep after +# entire run should take 10 min per loop execution +#Constants +# otf_img(700, 750, time=1, delay = 0.1, exposure=0.2, roi="test", name="test", save_images=True) + +AVERAGE1 = 1 +AVERAGE2 = 5 +EXPOSURE1 = 0.5 +EXPOSURE2 = 1.0 +MEASUREMENTS = 1 +i = 0 +#change_energy(709.4) +time.sleep(20) +for i in range(0, 30): + # open_vg10() + #time.sleep(1) + #auto_intensity() + #close_vg10() + time.sleep(30) + #open_vg10() + #otf_img(704, 720, time=1.5, delay = 0.1, exposure=0.5, roi="test", name="400C_H2", save_images=True) + #time.sleep(10) + #close_vg10() + abs_spec(ranges="Fe_L3__Arik_Beck_fine", roi="test", switch_pol = False, scans=1, exposure=EXPOSURE1, average=AVERAGE1) + time.sleep(10) + change_energy(709.4) + time.sleep(10) + take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE1, average=AVERAGE2) + time.sleep(270) + print(i) diff --git a/script/Users/Beck/stack_scan.py b/script/Users/Beck/stack_scan.py new file mode 100644 index 0000000..67078de --- /dev/null +++ b/script/Users/Beck/stack_scan.py @@ -0,0 +1,22 @@ + #auto_intensity() + #time_sleep(2) +#TakeImage at 710 eV at the given polarization + +# do autoajust, give 1 minute to settle, do image aquisition with 5 frame average and go to sleep after +# entire run should take 10 min per loop execution +#Constants +AVERAGE = 5 +EXPOSURE = 1.0 +MEASUREMENTS = 1 +i = 0 +change_energy(709.4) +time.sleep(60) +for i in range(0, 23): + # open_vg10() + #time.sleep(1) + #auto_intensity() + #close_vg10() + time.sleep(60) + take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) + time.sleep(534) + print(i) diff --git a/script/Users/SaraG/Sara_script1.py b/script/Users/SaraG/Sara_script1.py new file mode 100644 index 0000000..5574e71 --- /dev/null +++ b/script/Users/SaraG/Sara_script1.py @@ -0,0 +1,74 @@ + +#Constants +AVERAGE = 10 +EXPOSURE = 5 +MEASUREMENTS = 40 + +#TwoImages Two Pol with C+/C- and ID1 + ID2, tune-detune, at 710 eV +set_beamline_setup(id ="ID1_ID2", en=706.7, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0) +two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +time.sleep(2.0) + +#TwoEnergies with lin hor polarization ID2 only (normal) +set_beamline_setup(id ="ID2", en=706.7, pol1="Lin_Hor") +two_energies(706.7, 703, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +time.sleep(2.0) + +#TwoEnergies with lin hor polarization ID2 only (normal) +set_beamline_setup(id ="ID2", en=464.2, pol1="Lin_Hor") +two_energies(462.6, 458.2, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +time.sleep(2.0) + + + +#Constants +AVERAGE2 = 4 +EXPOSURE2 = 4.0 + +change_energy(703) +abs_spec(ranges="Fe_L32__Arik_Beck_fine", roi="saraROI", switch_pol=False, scans=1, exposure=EXPOSURE2, average=AVERAGE2) + + +#Constants +AVERAGE3 = 1 +EXPOSURE3 = 4.0 + +change_energy(450) +abs_spec(ranges="Ti_Sara", roi="saraROI", switch_pol=False, scans=1, exposure=EXPOSURE3, average=AVERAGE3) + +change_energy(523) +abs_spec(ranges="O_Sara", roi="saraROI", switch_pol=False, scans=1, exposure=EXPOSURE3, average=AVERAGE3) + + + + + +#TakeImage at 710 eV at the given polarization +#change_energy(710) +#take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +#time.sleep(2.0) + +#TwoImages Two Pol with C+/C- and ID1 + ID2, tune-detune, at 710 eV +#set_beamline_setup(id ="ID1_ID2", en=710, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0) +#two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +#time.sleep(2.0) + +#TwoEnergies with lin hor polarization ID2 only (normal) +#set_beamline_setup(id ="ID2", en=710, pol1="Lin_Hor") +#two_energies(705, 710, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +#time.sleep(2.0) + +#abs_spec(ranges=[[500.0, 1000.0, 100.0],], switch_pol=False, scans=1, exposure=EXPOSURE, average=AVERAGE) #Use manulally defined ranges and rois defined in GUI + + +#Direct functions to change energy, pol, offset: +#change_energy(700) +#change_pol(1, "Circ_Plus" ) #Pol on ID1: "Circ_Plus", "Circ_Minus" , "Lin_Hor", "Lin_Ver" +#change_pol(1, "Lin" , alpha = "0" ) #Lin pol on ID 1 +#change_offset(1, 0.0) #offset on ID1 + +#Auto-switching: +#switch_pol() + +#Restoring beamline state defined in last set_beamline_setut: +#restore_beamline_setup() \ No newline at end of file diff --git a/script/Users/SaraG/Sara_script2.py b/script/Users/SaraG/Sara_script2.py new file mode 100644 index 0000000..c4e203e --- /dev/null +++ b/script/Users/SaraG/Sara_script2.py @@ -0,0 +1,11 @@ + +set_exec_pars(open=False) +print('la') + +run("templates/Eiger2Img", { \ + "METHOD": "Take_Image", "AUTO_SAVE": True, \ + "MEASUREMENTS": 1, "EXPOSURE": 1, "AVERAGE": 1, \ + "SWITCHING": None, "SEQUENCE": None, \ + "ENERGY_1":None, "ENERGY_2":None, \ + "NUMBER_SCANS":1, "SWITCH_POL": False, \ + }) diff --git a/script/Users/ales/Holder4.py b/script/Users/ales/Holder4.py index 6a16208..0fc51e9 100755 --- a/script/Users/ales/Holder4.py +++ b/script/Users/ales/Holder4.py @@ -1,900 +1,1216 @@ -######Sample SL-freshpellet -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL-freshpellet/") -#open_vg13() -# -#TRY.write(20.00) -#TRZ.write(12.45) -# -# -#time.sleep(1) - - -##Survey -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_Survey', folder='XAS/2020/11/SL-freshpellet/') -# -##Nickel L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_Ni', folder='XAS/2020/11/SL-freshpellet/') - -##Cobalt L edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_Co', folder='XAS/2020/11/SL-freshpellet/') -# -##Fluor + Fe edges -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_F-Fe', folder='XAS/2020/11/SL-freshpellet/') - -##Manganese L edge -#nr_loops=4 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_Mn', folder='XAS/2020/11/SL-freshpellet/') -# -##Oxygen K edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_O', folder='XAS/2020/11/SL-freshpellet/') -# -##Carbon K edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-freshpellet_C', folder='XAS/2020/11/SL-freshpellet/') - - - - - - -#time.sleep(1) -# -######Sample SLF-freshpellet -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SLF-freshpellet/") -#open_vg13() -# -#TRY.write(09.00) -#TRZ.write(24.45) -# -# -#time.sleep(1) - - -##Survey -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_Survey', folder='XAS/2020/11/SLF-freshpellet/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_Ni', folder='XAS/2020/11/SLF-freshpellet/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_Co', folder='XAS/2020/11/SLF-freshpellet/') -# -##Fluor + Fe edges -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_F-Fe', folder='XAS/2020/11/SLF-freshpellet/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_Mn', folder='XAS/2020/11/SLF-freshpellet/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_O', folder='XAS/2020/11/SLF-freshpellet/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-freshpellet_C', folder='XAS/2020/11/SLF-freshpellet/') -# -# - -# -# -# -# -#time.sleep(1) -# -######Sample SL-EISAged -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL-EISAged/") -#open_vg13() -# -#TRY.write(07.00) -#TRZ.write(14.95) -# -# -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_Survey', folder='XAS/2020/11/SL-EISAged/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_Ni', folder='XAS/2020/11/SL-EISAged/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_Co', folder='XAS/2020/11/SL-EISAged/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_F-Fe', folder='XAS/2020/11/SL-EISAged/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_Mn', folder='XAS/2020/11/SL-EISAged/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_O', folder='XAS/2020/11/SL-EISAged/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-EISAged_C', folder='XAS/2020/11/SL-EISAged/') -# - - - - -# -# -#time.sleep(1) -# -######Sample SLF-EISAged -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SLF-EISAged/") -#open_vg13() -# -#TRY.write(20.75) -#TRZ.write(23.95) - - -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_Survey', folder='XAS/2020/11/SLF-EISAged/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_Ni', folder='XAS/2020/11/SLF-EISAged/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_Co', folder='XAS/2020/11/SLF-EISAged/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_F-Fe', folder='XAS/2020/11/SLF-EISAged/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_Mn', folder='XAS/2020/11/SLF-EISAged/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_O', folder='XAS/2020/11/SLF-EISAged/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SLF-EISAged_C', folder='XAS/2020/11/SLF-EISAged/') -# -# -# -# -# -# -# -#time.sleep(1) -# -######Sample SL-AG4 -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL-AG4/") -#open_vg13() -# -#TRY.write(22.00) -#TRZ.write(17.70) -# -# -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_Survey', folder='XAS/2020/11/SL-AG4/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_Ni', folder='XAS/2020/11/SL-AG4/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_Co', folder='XAS/2020/11/SL-AG4/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_F-Fe', folder='XAS/2020/11/SL-AG4/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_Mn', folder='XAS/2020/11/SL-AG4/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_O', folder='XAS/2020/11/SL-AG4/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-AG4_C', folder='XAS/2020/11/SL-AG4/') -# -# -# -# - -# -# -#time.sleep(1) -# -######Sample SL-FRP2 -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL-FRP2/") -#open_vg13() -# -#TRY.write(02.25) -#TRZ.write(20.45) -# -# -#time.sleep(1) -## -## -###Survey -##nr_loops=1 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_Survey', folder='XAS/2020/11/SL-FRP2/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_Ni', folder='XAS/2020/11/SL-FRP2/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_Co', folder='XAS/2020/11/SL-FRP2/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_F-Fe', folder='XAS/2020/11/SL-FRP2/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_Mn', folder='XAS/2020/11/SL-FRP2/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_O', folder='XAS/2020/11/SL-FRP2/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL-FRP2_C', folder='XAS/2020/11/SL-FRP2/') -# -# -# -# -# -# -# -##time.sleep(1) -## -######Sample SL5F -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL5F/") -#open_vg13() -# -#TRY.write(04.50) -#TRZ.write(10.20) -## -# -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_Survey', folder='XAS/2020/11/SL5F/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_Ni', folder='XAS/2020/11/SL5F/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_Co', folder='XAS/2020/11/SL5F/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_F-Fe', folder='XAS/2020/11/SL5F/') -# -##Manganese L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_Mn', folder='XAS/2020/11/SL5F/') -# -##Oxygen K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_O', folder='XAS/2020/11/SL5F/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL5F_C', folder='XAS/2020/11/SL5F/') -# -# - - -# -# -# -#time.sleep(1) -# -######Sample SL7-IN -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL7-IN/") -#open_vg13() -# -#TRY.write(12.75) -#TRZ.write(13.20) -# -# -#time.sleep(1) -## -## -###Survey -##nr_loops=1 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_Survey', folder='XAS/2020/11/SL7-IN/') -## -###Nickel L edge -##nr_loops=2 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_Ni', folder='XAS/2020/11/SL7-IN/') -## -###Cobalt L edge -##nr_loops=3 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_Co', folder='XAS/2020/11/SL7-IN/') -## -###Fluor + Fe edges -##nr_loops=1 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_F-Fe', folder='XAS/2020/11/SL7-IN/') -## -###Manganese L edge -##nr_loops=3 -##for i in range(nr_loops): -## caput('X11MA-KEI10:RANGE', 7) -## caput('X11MA-KEI11:RANGE', 8) -## caput('X11MA-KEI12:RANGE', 10) -## otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_Mn', folder='XAS/2020/11/SL7-IN/') -## -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_O', folder='XAS/2020/11/SL7-IN/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7-IN_C', folder='XAS/2020/11/SL7-IN/') -# -# -# -# -# -# -# -#time.sleep(1) -# -######Sample SL7F-IN -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL7F-IN/") -#open_vg13() -# -#TRY.write(15.00) -#TRZ.write(27.70) -# -# -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_Survey', folder='XAS/2020/11/SL7F-IN/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_Ni', folder='XAS/2020/11/SL7F-IN/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_Co', folder='XAS/2020/11/SL7F-IN/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_F-Fe', folder='XAS/2020/11/SL7F-IN/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_Mn', folder='XAS/2020/11/SL7F-IN/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_O', folder='XAS/2020/11/SL7F-IN/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL7F-IN_C', folder='XAS/2020/11/SL7F-IN/') -# - - - -# -# -# -#time.sleep(1) -# -######Sample SL10-IN -#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL10-IN/") -#open_vg13() -# -#TRY.write(09.75) -#TRZ.write(09.95) -# -# -#time.sleep(1) -# -# -##Survey -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_Survey', folder='XAS/2020/11/SL10-IN/') -# -##Nickel L edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_Ni', folder='XAS/2020/11/SL10-IN/') -# -##Cobalt L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_Co', folder='XAS/2020/11/SL10-IN/') -# -##Fluor + Fe edges -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_F-Fe', folder='XAS/2020/11/SL10-IN/') -# -##Manganese L edge -#nr_loops=3 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_Mn', folder='XAS/2020/11/SL10-IN/') -# -##Oxygen K edge -#nr_loops=2 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_O', folder='XAS/2020/11/SL10-IN/') -# -##Carbon K edge -#nr_loops=1 -#for i in range(nr_loops): -# caput('X11MA-KEI10:RANGE', 7) -# caput('X11MA-KEI11:RANGE', 8) -# caput('X11MA-KEI12:RANGE', 10) -# otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10-IN_C', folder='XAS/2020/11/SL10-IN/') -# - - - - - - -time.sleep(1) - -#####Sample SL10F-INCB -set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL10F-INCB/") +####Sample DB1 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB1/") open_vg13() -TRY.write(15.25) -TRZ.write(17.95) +TRY.write(7.40) +TRZ.write(22.20) time.sleep(1) - + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB1_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + #Survey nr_loops=1 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_Survey', folder='XAS/2020/11/SL10F-INCB/') - -#Nickel L edge -nr_loops=2 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_Ni', folder='XAS/2020/11/SL10F-INCB/') - -#Cobalt L edge -nr_loops=3 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_Co', folder='XAS/2020/11/SL10F-INCB/') - -#Fluor + Fe edges -nr_loops=1 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_F-Fe', folder='XAS/2020/11/SL10F-INCB/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB1_Survey') #Manganese L edge -nr_loops=3 +nr_loops=2 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_Mn', folder='XAS/2020/11/SL10F-INCB/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB1_Mn') #Oxygen K edge nr_loops=2 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_O', folder='XAS/2020/11/SL10F-INCB/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB1_O') #Carbon K edge -nr_loops=1 +nr_loops=2 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL10F-INCB_C', folder='XAS/2020/11/SL10F-INCB/') - - - - - - + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB1_C') time.sleep(1) -#####Sample SL11F-IN -set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2020/11/SL11F-IN/") + + + + + +###Sample DB4 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB4/") open_vg13() -TRY.write(04.25) -TRZ.write(26.70) +TRY.write(3.40) +TRZ.write(22.20) time.sleep(1) - + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + #Survey nr_loops=1 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_Survey', folder='XAS/2020/11/SL11F-IN/') - -#Nickel L edge -nr_loops=2 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_Ni', folder='XAS/2020/11/SL11F-IN/') - -#Cobalt L edge -nr_loops=3 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_Co', folder='XAS/2020/11/SL11F-IN/') - -#Fluor + Fe edges -nr_loops=1 -for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_F-Fe', folder='XAS/2020/11/SL11F-IN/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_Survey') #Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_Mn') + +#Fluor + Fe edges nr_loops=3 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_Mn', folder='XAS/2020/11/SL11F-IN/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_F-Fe') #Oxygen K edge nr_loops=2 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_O', folder='XAS/2020/11/SL11F-IN/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_O') #Carbon K edge -nr_loops=1 +nr_loops=2 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) - caput('X11MA-KEI11:RANGE', 8) - caput('X11MA-KEI12:RANGE', 10) - otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='SL11F-IN_C', folder='XAS/2020/11/SL11F-IN/') + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB4_C') + time.sleep(1) + + + +###Sample DB5 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB5/") +open_vg13() + +TRY.write(-0.80) +TRZ.write(22.60) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_Mn') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB5_C') + + +time.sleep(1) + + + + + +####Sample DB6 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB6/") +open_vg13() + +TRY.write(-5.20) +TRZ.write(23.20) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_Mn') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB6_C') + + +time.sleep(1) + + + + + +####Sample DB7 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB7/") +open_vg13() + +TRY.write(-9.00) +TRZ.write(23.60) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_Mn') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB7_C') + + +time.sleep(1) + + + + + +####Sample DB11 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB11/") +open_vg13() + +TRY.write(-5.80) +TRZ.write(29.60) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB11_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB11_Mn') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB11_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB11_C') + + +time.sleep(1) + + + + + +####Sample DB10 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB10/") +open_vg13() + +TRY.write(-1.40) +TRZ.write(28.20) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB10_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB10_Survey') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB10_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB10_C') + + +time.sleep(1) + + + + + +####Sample DB9 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB9/") +open_vg13() + +TRY.write(4.00) +TRZ.write(27.40) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_Survey') + +Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_Mn') + +Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_F-Fe') + +Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_O') + +Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB9_C') + + +time.sleep(1) + + + + + +####Sample DB8 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_10/DB8/") +open_vg13() + +TRY.write(8.00) +TRZ.write(26.80) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_Mn') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB8_C') + + +time.sleep(1) + + + + + +####Sample DB12 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB12/") +open_vg13() + +TRY.write(9.00) +TRZ.write(33.00) + + +time.sleep(1) + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB12_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB12_Mn') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB12_O') + + + + +time.sleep(1) + + + + + +####Sample DB13 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB106/") +open_vg13() + +TRY.write(5.20) +TRZ.write(34.20) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB13_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB13_Mn') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB13_O') + + + + +time.sleep(1) + + + + + +####Sample DB14 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB117/") +open_vg13() + +TRY.write(-3.20) +TRZ.write(34.40) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB14_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB14_Mn') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB14_O') + + + +time.sleep(1) + + + + + +####Sample DB15 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB110/") +open_vg13() + +TRY.write(-7.20) +TRZ.write(35.20) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB15_Survey') + + +#Fluor + Fe edges +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB15_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB15_O') + + + + +time.sleep(1) + + + + + + +####Sample DB16 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB110/") +open_vg13() + +TRY.write(-7.00) +TRZ.write(41.40) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB16_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB816_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB16_Mn') + +#Fluor + Fe edges +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB16_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB16_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB16_C') + + +time.sleep(1) + + + + + + +####Sample DB19 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB121/") +open_vg13() + +TRY.write(-3.40) +TRZ.write(41.40) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_Mn') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB19_C') + + +time.sleep(1) + + + + + +####Sample DB30 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB101/") +open_vg13() + +TRY.write(1.40) +TRZ.write(41.20) + + +time.sleep(1) + + + +#Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_Mn') + +##Fluor + Fe edges +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB30_C') + + +time.sleep(1) + + + + + +####Sample DB31 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB1114/") +open_vg13() + +TRY.write(6.00) +TRZ.write(40.40) + + +time.sleep(1) + + + +##Sodium K edge ***requires 3rd Harmonic*** +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=1050, end=1150, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_Na') +caput('X11MA-ID2:HARMONIC', 1) +time.sleep(15) + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_Survey') + +#Manganese L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=630, end=670, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_Mn') + +#Fluor + Fe edges +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB31_C') + + +time.sleep(1) + + + + + +####Sample DB17 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB113/") +open_vg13() + +TRY.write(10.60) +TRZ.write(39.00) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB17_Survey') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB17_F-Fe') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB17_O') + + + + +time.sleep(1) + + + + + + +####Sample Au1 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB112/") +open_vg13() + +TRY.write(7.00) +TRZ.write(43.20) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 8) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au1_Survey') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au1_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au1_C') + + +time.sleep(1) + + + + + +####Sample Au2 +#set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/DB111/") +open_vg13() + +TRY.write(2.60) +TRZ.write(46.00) + + +time.sleep(1) + + + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au2_Survey') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au2_O') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 6) + caput('X11MA-KEI11:RANGE', 7) + caput('X11MA-KEI12:RANGE', 9) + otf2(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='Au2_C') + + +time.sleep(1) + + + + + + + + + + + +time.sleep(1) + close_vg13() + + diff --git a/script/Users/filianina/E_scan_XMCD.py b/script/Users/filianina/E_scan_XMCD.py index 9b6dde3..3b75db9 100644 --- a/script/Users/filianina/E_scan_XMCD.py +++ b/script/Users/filianina/E_scan_XMCD.py @@ -1,15 +1,21 @@ #Constants AVERAGE = 1 -EXPOSURE = 1.0 +EXPOSURE = 2.0 MEASUREMENTS = 50 -#Energies=[635, 635.5] -Energies=[637, 637.2, 637.4, 637.6, 637.8, 638, 638.2, 638.4, 638.6, 638.8, 639] +Energies=[] +step=0.2 +for item in range(0,20,1): + Energies.append(round(642.0 - item*step, 1)) + +#Energies=[ 640.8,641,641.2,641.4,641.6,] #5 maximum #Energies=[637, 637.2, 637.4, 637.6, 637.8, 638, 638.2, 638.4, 638.6, 638.8, 639, 639.2, 639.4, 639.6, 639.8, 640, 640.5, 641] #TakeImage at 710 eV at the given polarization -change_energy(636) +change_energy(638.2) #TwoImages Two Pol with C+/C- and ID1 + ID2, tune-detune, at 710 eV -set_beamline_setup(id ="ID1_ID2", en=636, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0) +set_beamline_setup(id ="ID1_ID2", en=638.2, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0) +time.sleep(2.0) +two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) time.sleep(2.0) for item in Energies: change_energy(item) diff --git a/script/Users/filianina/lupa_scan.py b/script/Users/filianina/lupa_scan.py index 9f4c67e..f6ea227 100644 --- a/script/Users/filianina/lupa_scan.py +++ b/script/Users/filianina/lupa_scan.py @@ -1,5 +1,5 @@ #Constants -AVERAGE = 1 +AVERAGE = 3 EXPOSURE = 2.0 MEASUREMENTS = 50 @@ -9,11 +9,11 @@ change_energy(639) time.sleep(2.0) #TwoImages Two Pol with Lin_hor/lin_ver and ID1 + ID2, tune-detune, at 638.8 eV -set_beamline_setup(id ="ID1_ID2", en=638.6, pol1="Lin_Hor", alp1=0.0, har1=1, off1=0.0, pol2="Lin_Ver", alp2=90.0, har2=1, off2=0.0) +set_beamline_setup(id ="ID1_ID2", en=638.8, pol1="Lin_Hor", alp1=0.0, har1=1, off1=0.0, pol2="Lin_Ver", alp2=90.0, har2=1, off2=0.0) two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) time.sleep(2.0) -change_energy(637.6) +change_energy(637.5) time.sleep(2.0) two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) time.sleep(2.0) diff --git a/script/Users/filianina/xmld_xmcd_cicle.py b/script/Users/filianina/xmld_xmcd_cicle.py new file mode 100644 index 0000000..e835b41 --- /dev/null +++ b/script/Users/filianina/xmld_xmcd_cicle.py @@ -0,0 +1,32 @@ +#Constants +AVERAGE = 4 +EXPOSURE = 2.0 +MEASUREMENTS = 50 + +#TakeImage at 710 eV at the given polarization +#change_energy(639) +#take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +#time.sleep(2.0) + +#TwoImages Two Pol with Lin_hor/lin_ver and ID1 + ID2, tune-detune, at 638.8 eV +#set_beamline_setup(id ="ID1_ID2", en=638.9, pol1="Lin_Hor", alp1=0.0, har1=1, off1=0.0, pol2="Lin_Ver", alp2=90.0, har2=1, off2=0.0) +#two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +#time.sleep(2.0) +for i in range(1): + change_energy(638.2) + time.sleep(2.0) + + #TwoImages Two Pol with C+/C- and ID1 + ID2, tune-detune, at 710 eV + set_beamline_setup(id ="ID1_ID2", en=638.2, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0) + two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) + time.sleep(2.0) + + change_energy(637.6) + time.sleep(2.0) + + set_beamline_setup(id ="ID1_ID2", en=637.6, pol1="Lin_Hor", alp1=0.0, har1=1, off1=0.0, pol2="Lin_Ver", alp2=90.0, har2=1, off2=0.0) + time.sleep(2.0) + two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) + time.sleep(2.0) + + \ No newline at end of file diff --git a/script/Users/steven/March2021_Holder7.py b/script/Users/steven/March2021_Holder7.py index 2a4f130..de3c40e 100755 --- a/script/Users/steven/March2021_Holder7.py +++ b/script/Users/steven/March2021_Holder7.py @@ -8,16 +8,18 @@ TRY.write(3.0) TRZ.write(41.25) -time.sleep(1) - ##Sodium K edge ***requires 3rd Harmonic*** +#caput('X11MA-ID2:HARMONIC', 3) +#time.sleep(15) #nr_loops=1 #for i in range(nr_loops): # caput('X11MA-KEI10:RANGE', 7) # caput('X11MA-KEI11:RANGE', 8) # caput('X11MA-KEI12:RANGE', 9) # otf(start=1070, end=1110, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB53_Na', folder='XAS/2021/2021_03/DB53/') - +#caput('X11MA-ID2:HARMONIC', 1) +#time.sleep(15) + ##Survey #nr_loops=1 #for i in range(nr_loops): @@ -29,7 +31,7 @@ time.sleep(1) #Fluor + Fe edges nr_loops=1 for i in range(nr_loops): - caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI10aput(':RANGE', 7) caput('X11MA-KEI11:RANGE', 8) caput('X11MA-KEI12:RANGE', 9) otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='DB53_F-Fe', folder='XAS/2021/2021_03/DB53/') diff --git a/script/Users/steven/September2021_Holder1.py b/script/Users/steven/September2021_Holder1.py new file mode 100644 index 0000000..87fe39d --- /dev/null +++ b/script/Users/steven/September2021_Holder1.py @@ -0,0 +1,1333 @@ + +####Sample AS31 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS31/") +open_vg13() + +TRY.write(9.00) +TRZ.write(22.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_Survey', folder='XAS/2021/2021_09/AS31/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_Ni', folder='XAS/2021/2021_09/AS31/') +# +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_Co', folder='XAS/2021/2021_09/AS31/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_F-Fe', folder='XAS/2021/2021_09/AS31/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_O', folder='XAS/2021/2021_09/AS31/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 10) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS31_C', folder='XAS/2021/2021_09/AS31/') + + +time.sleep(1) + + + + + +####Sample AS32 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS32/") +open_vg13() + +TRY.write(4.00) +TRZ.write(22.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_Survey', folder='XAS/2021/2021_09/AS32/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_Ni', folder='XAS/2021/2021_09/AS32/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_Co', folder='XAS/2021/2021_09/AS32/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_F-Fe', folder='XAS/2021/2021_09/AS32/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_O', folder='XAS/2021/2021_09/AS32/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS32_C', folder='XAS/2021/2021_09/AS32/') + + +time.sleep(1) + + + +# +# +# +#####Sample AS33 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS33/") +open_vg13() + +TRY.write(0.00) +TRZ.write(22.00) +# +# +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_Survey', folder='XAS/2021/2021_09/AS33/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_Ni', folder='XAS/2021/2021_09/AS33/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_Co', folder='XAS/2021/2021_09/AS33/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_F-Fe', folder='XAS/2021/2021_09/AS33/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_O', folder='XAS/2021/2021_09/AS33/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS33_C', folder='XAS/2021/2021_09/AS33/') + + +time.sleep(1) + + + + +# + +#####Sample AS34 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS34/") +open_vg13() + +TRY.write(-4.00) +TRZ.write(22.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_Survey', folder='XAS/2021/2021_09/AS34/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_Ni', folder='XAS/2021/2021_09/AS34/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_Co', folder='XAS/2021/2021_09/AS34/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_F-Fe', folder='XAS/2021/2021_09/AS34/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_O', folder='XAS/2021/2021_09/AS34/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS34_C', folder='XAS/2021/2021_09/AS34/') + + +time.sleep(1) + + + + + + +####Sample AS35 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS35/") +open_vg13() + +TRY.write(-7.50) +TRZ.write(21.50) + + +time.sleep(1) +# + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_Survey', folder='XAS/2021/2021_09/AS35/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_Ni', folder='XAS/2021/2021_09/AS35/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_Co', folder='XAS/2021/2021_09/AS35/') +# +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_F-Fe', folder='XAS/2021/2021_09/AS35/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_O', folder='XAS/2021/2021_09/AS35/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS35_C', folder='XAS/2021/2021_09/AS35/') + + +time.sleep(1) + + + + + +#####Sample AS36 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS36/") +open_vg13() + +TRY.write(9.00) +TRZ.write(28.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_Survey', folder='XAS/2021/2021_09/AS36/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_Ni', folder='XAS/2021/2021_09/AS36/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_Co', folder='XAS/2021/2021_09/AS36/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_F-Fe', folder='XAS/2021/2021_09/AS36/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_O', folder='XAS/2021/2021_09/AS36/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS36_C', folder='XAS/2021/2021_09/AS36/') + + +time.sleep(1) +# + + + + + +#####Sample AS37 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS37/") +open_vg13() + +TRY.write(4.50) +TRZ.write(28.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_Survey', folder='XAS/2021/2021_09/AS37/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_Ni', folder='XAS/2021/2021_09/AS37/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_Co', folder='XAS/2021/2021_09/AS37/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_F-Fe', folder='XAS/2021/2021_09/AS37/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_O', folder='XAS/2021/2021_09/AS37/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS37_C', folder='XAS/2021/2021_09/AS37/') + + +time.sleep(1) + + + + + + + +####Sample AS38 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS38/") +open_vg13() + +TRY.write(0.50) +TRZ.write(28.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_Survey', folder='XAS/2021/2021_09/AS38/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_Ni', folder='XAS/2021/2021_09/AS38/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_Co', folder='XAS/2021/2021_09/AS38/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_F-Fe', folder='XAS/2021/2021_09/AS38/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_O', folder='XAS/2021/2021_09/AS38/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS38_C', folder='XAS/2021/2021_09/AS38/') + + +time.sleep(1) + + + + + + +#####Sample AS39 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS39/") +open_vg13() + +TRY.write(-3.00) +TRZ.write(28.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_Survey', folder='XAS/2021/2021_09/AS39/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_Ni', folder='XAS/2021/2021_09/AS39/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_Co', folder='XAS/2021/2021_09/AS39/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_F-Fe', folder='XAS/2021/2021_09/AS39/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_O', folder='XAS/2021/2021_09/AS39/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS39_C', folder='XAS/2021/2021_09/AS39/') + + +time.sleep(1) + + + + + + +#####Sample AS40 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS40/") +open_vg13() + +TRY.write(-7.50) +TRZ.write(28.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_Survey', folder='XAS/2021/2021_09/AS40/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_Ni', folder='XAS/2021/2021_09/AS40/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_Co', folder='XAS/2021/2021_09/AS40/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_F-Fe', folder='XAS/2021/2021_09/AS40/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_O', folder='XAS/2021/2021_09/AS40/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS40_C', folder='XAS/2021/2021_09/AS40/') + + +time.sleep(1) + + + + + + +#####Sample AS41 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS41/") +open_vg13() + +TRY.write(8.00) +TRZ.write(36.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_Survey', folder='XAS/2021/2021_09/AS41/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_Ni', folder='XAS/2021/2021_09/AS41/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_Co', folder='XAS/2021/2021_09/AS41/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_F-Fe', folder='XAS/2021/2021_09/AS41/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_O', folder='XAS/2021/2021_09/AS41/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS41_C', folder='XAS/2021/2021_09/AS41/') + + +time.sleep(1) + + + + + + +#####Sample AS42 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS42/") +open_vg13() + +TRY.write(4.00) +TRZ.write(36.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_Survey', folder='XAS/2021/2021_09/AS42/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_Ni', folder='XAS/2021/2021_09/AS42/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_Co', folder='XAS/2021/2021_09/AS42/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_F-Fe', folder='XAS/2021/2021_09/AS42/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_O', folder='XAS/2021/2021_09/AS42/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS42_C', folder='XAS/2021/2021_09/AS42/') + + +time.sleep(1) + + + + + +#####Sample AS43 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS43/") +open_vg13() + +TRY.write(0.00) +TRZ.write(36.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_Survey', folder='XAS/2021/2021_09/AS43/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_Ni', folder='XAS/2021/2021_09/AS43/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_Co', folder='XAS/2021/2021_09/AS43/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_F-Fe', folder='XAS/2021/2021_09/AS43/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_O', folder='XAS/2021/2021_09/AS43/') + + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS43_C', folder='XAS/2021/2021_09/AS43/') + + +time.sleep(1) + + + + + +#####Sample AS44 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS44/") +open_vg13() + +TRY.write(-4.00) +TRZ.write(36.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_Survey', folder='XAS/2021/2021_09/AS44/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_Ni', folder='XAS/2021/2021_09/AS44/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_Co', folder='XAS/2021/2021_09/AS44/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_F-Fe', folder='XAS/2021/2021_09/AS44/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_O', folder='XAS/2021/2021_09/AS44/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS44_C', folder='XAS/2021/2021_09/AS44/') + + +time.sleep(1) + + + + + +#####Sample AS45 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS45/") +open_vg13() + +TRY.write(-8.00) +TRZ.write(36.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_Survey', folder='XAS/2021/2021_09/AS45/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_Ni', folder='XAS/2021/2021_09/AS45/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_Co', folder='XAS/2021/2021_09/AS45/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_F-Fe', folder='XAS/2021/2021_09/AS45/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_O', folder='XAS/2021/2021_09/AS45/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS45_C', folder='XAS/2021/2021_09/AS45/') + + +time.sleep(1) + + + + + + +#####Sample AS46 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS46/") +open_vg13() + +TRY.write(8.00) +TRZ.write(41.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_Survey', folder='XAS/2021/2021_09/AS46/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_Ni', folder='XAS/2021/2021_09/AS46/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_Co', folder='XAS/2021/2021_09/AS46/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_F-Fe', folder='XAS/2021/2021_09/AS46/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_O', folder='XAS/2021/2021_09/AS46/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS46_C', folder='XAS/2021/2021_09/AS46/') + + +time.sleep(1) + + + + + +#####Sample AS47 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS47/") +open_vg13() + +TRY.write(3.50) +TRZ.write(41.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_Survey', folder='XAS/2021/2021_09/AS47/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_Ni', folder='XAS/2021/2021_09/AS47/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_Co', folder='XAS/2021/2021_09/AS47/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_F-Fe', folder='XAS/2021/2021_09/AS47/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_O', folder='XAS/2021/2021_09/AS47/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS47_C', folder='XAS/2021/2021_09/AS47/') + + +time.sleep(1) + + + + + +#####Sample AS48 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS48/") +open_vg13() + +TRY.write(-0.50) +TRZ.write(41.50) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_Survey', folder='XAS/2021/2021_09/AS48/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_Ni', folder='XAS/2021/2021_09/AS48/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_Co', folder='XAS/2021/2021_09/AS48/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_F-Fe', folder='XAS/2021/2021_09/AS48/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_O', folder='XAS/2021/2021_09/AS48/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS48_C', folder='XAS/2021/2021_09/AS48/') + + +time.sleep(1) + + + + + +#####Sample AS49 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS49/") +open_vg13() + +TRY.write(-4.50) +TRZ.write(41.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_Survey', folder='XAS/2021/2021_09/AS49/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_Ni', folder='XAS/2021/2021_09/AS49/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_Co', folder='XAS/2021/2021_09/AS49/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_F-Fe', folder='XAS/2021/2021_09/AS49/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_O', folder='XAS/2021/2021_09/AS49/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS49_C', folder='XAS/2021/2021_09/AS49/') + + +time.sleep(1) + + + + + + +#####Sample AS50 +set_exec_pars(path="/sls/X11MA/data/X11MA/Data1/XAS/2021/2021_09/AS50/") +open_vg13() + +TRY.write(-8.50) +TRZ.write(41.00) + + +time.sleep(1) + + +#Survey +nr_loops=1 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=500, end=900, time=3, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_Survey', folder='XAS/2021/2021_09/AS50/') + +#Nickel L edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_Ni', folder='XAS/2021/2021_09/AS50/') + +#Cobalt L edge +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_Co', folder='XAS/2021/2021_09/AS50/') + +#Fluor + Fe edges +nr_loops=3 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=680, end=735, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_F-Fe', folder='XAS/2021/2021_09/AS50/') + +#Oxygen K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_O', folder='XAS/2021/2021_09/AS50/') + +#Carbon K edge +nr_loops=2 +for i in range(nr_loops): + caput('X11MA-KEI10:RANGE', 7) + caput('X11MA-KEI11:RANGE', 8) + caput('X11MA-KEI12:RANGE', 9) + otf(start=270, end=320, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=0.0, name='AS50_C', folder='XAS/2021/2021_09/AS50/') + + +time.sleep(1) + +close_vg13() + + diff --git a/script/beamline_init/ESlitCalib.py b/script/beamline_init/ESlitCalib.py new file mode 100644 index 0000000..182d800 --- /dev/null +++ b/script/beamline_init/ESlitCalib.py @@ -0,0 +1,14 @@ +#seting parameters +caput('X11MA-KEI10:RANGE', 6) # 6 --> 200 nA +exit_slit.move(30.0) +speed = exit_slit.getSpeed() +min_speed=exit_slit.getMinSpeed() +exit_slit.setSpeed(min_speed) + +#scan Energy Slit +run('beamline_init/SlitCalib.py',{"Slit":exit_slit, "Slit_offset":exit_slit_offset, "detector":keithley_1a, "start":30, "end":-20.0, "step_size":1.0, "final_pos":20.0}) +time.sleep(1) + +#resetting parameters +caput('X11MA-KEI10:RANGE', 0) # 0--> AUTO +exit_slit.setSpeed(speed) \ No newline at end of file diff --git a/script/beamline_init/FESlitCalib.py b/script/beamline_init/FESlitCalib.py new file mode 100644 index 0000000..4b562f0 --- /dev/null +++ b/script/beamline_init/FESlitCalib.py @@ -0,0 +1,14 @@ +#seting parameters +caput('X11MA-KEI10:RANGE', 6) # 6 --> 200 nA +fe_slit_H_size.move(1.0) +fe_slit_V_size.move(1.0) + +#scan SizeH +run('beamline_init/SlitCalib.py',{"Slit":fe_slit_H_size, "Slit_offset":fe_slit_H_size_offs, "detector":keithley_1a, "start":1.0, "end":-0.5, "step_size":0.03, "final_pos":1.0}) +time.sleep(1) +#scan SizeV +#SlitCalib(Slit=fe_slit_V_size, Slit_offset=fe_slit_V_size_offs, detector = keithley_1a, start=1.0, end=-0.5, step_size=0.03, final_pos=1.0) + +#resetting parameters +caput ('X11MA-FE-DSAPER', 0) # 0--> closed +caput('X11MA-KEI10:RANGE', 0) # 0--> AUTO \ No newline at end of file diff --git a/script/beamline_init/FE_Slit2DScan.py b/script/beamline_init/FE_Slit2DScan.py new file mode 100644 index 0000000..c229fb1 --- /dev/null +++ b/script/beamline_init/FE_Slit2DScan.py @@ -0,0 +1,17 @@ +STEPS = 10 + +class Line(ReadableArray): + def read(self): + r1 = cscan(fe_slit_V_ctr, (Keithley_1_raw), -0.5, 1.0 , steps=STEPS, save=False, hidden=True) + return r1[Keithley_1_raw] + + def getSize(self): + return STEPS+1 + + def getCalibration(self): + return ArrayCalibration(0.15,-0.5) + +line=Line() +set_device_alias(line, "FE scan") + +lscan(fe_slit_H_ctr, line, -0.5, 1.0, 0.1, latency=1.0) diff --git a/script/test/FE_ctrSlitCalib.py b/script/beamline_init/FE_ctrSlitCalib.py similarity index 100% rename from script/test/FE_ctrSlitCalib.py rename to script/beamline_init/FE_ctrSlitCalib.py diff --git a/script/beamline_init/InitCMU.py b/script/beamline_init/InitCMU.py new file mode 100644 index 0000000..e51bcd9 --- /dev/null +++ b/script/beamline_init/InitCMU.py @@ -0,0 +1,122 @@ +import subprocess +import time +import traceback + +running = False +counts = {} + +def countHS(motor): + global counts + try: + time.sleep(1.0) + counts[motor]=0 + def on_change(value): + global counts + print "HomeSW changed on" , motor, "to", value + if int(value) == 1: + counts[motor]=counts[motor]+1 + + with Channel(motor+".ATHM", callback=on_change, monitored=True, name="test") as ch: + if int(ch.read()) == 1: + counts[motor]=1 + while(running==True): + time.sleep(0.1) + print "Home Switch motor "+motor +" reached "+ str(counts[motor]) + " times" + return counts[motor] + except: + print "Exception counting "+str(motor) + traceback.print_exc() + raise + +def init(): + try: + global running + running = True + + print "startint CMU initilization" + x = caget('X11MA-OP-CM:ox') + y = caget('X11MA-OP-CM:oy') + z = caget('X11MA-OP-CM:oz') + Rx= caget('X11MA-OP-CM:oRx') + Ry= caget('X11MA-OP-CM:oRy') + Rz= caget('X11MA-OP-CM:oRz') + baf=caget('X11MA-OP2-CM:TRB.RBV') + + print "Old motor positions: x = " +str(x)+ \ + ", y = " +str(y)+ \ + ", z = " +str(z)+ \ + ", Rx = " +str(Rx)+ \ + ", Ry = " +str(Ry)+ \ + ", Rz = " +str(Rz)+ \ + ", baffle = " +str(baf) + + subprocess.call("X_X11MA_init-CMU.sh", shell=True) + print "Positions after initialisation: x = " +str(caget('X11MA-OP-CM:ox'))+ \ + ", y = " +str(caget('X11MA-OP-CM:oy'))+ \ + ", z = " +str(caget('X11MA-OP-CM:oz'))+ \ + ", Rx = " +str(caget('X11MA-OP-CM:oRx'))+ \ + ", Ry = " +str(caget('X11MA-OP-CM:oRy'))+ \ + ", Rz = " +str(caget('X11MA-OP-CM:oRz'))+ \ + ", baffle = " +str(caget('X11MA-OP2-CM:TRB.RBV')) + + print "Restoring old motor positions" + caput('X11MA-OP-CM:y',y) + caput('X11MA-OP-CM:z',z) + caput('X11MA-OP-CM:Rx',Rx) + caput('X11MA-OP-CM:Ry',Ry) + caput('X11MA-OP-CM:Rz',Rz) + +#check restored positions after restore + print "Restored positions: x = " +str(caget('X11MA-OP-CM:ox'))+ \ + ", y = " +str(caget('X11MA-OP-CM:oy'))+ \ + ", z = " +str(caget('X11MA-OP-CM:oz'))+ \ + ", Rx = " +str(caget('X11MA-OP-CM:oRx'))+ \ + ", Ry = " +str(caget('X11MA-OP-CM:oRy'))+ \ + ", Rz = " +str(caget('X11MA-OP-CM:oRz'))+ \ + ", baffle = " +str(caget('X11MA-OP2-CM:TRB.RBV')) + if(abs(caget('X11MA-OP-CM:ox')-x)>0.001): + print "X position not ok" + elif(abs(caget('X11MA-OP-CM:oy')-y)>0.001): + print "Y position not ok" + elif(abs(caget('X11MA-OP-CM:oz')-z)>0.001): + print "Z position not ok" + elif(abs(caget('X11MA-OP-CM:oRx')-Rx)>0.001): + print "Rx position not ok" + elif(abs(caget('X11MA-OP-CM:oRy')-Ry)>0.001): + print "Ry position not ok" + elif(abs(caget('X11MA-OP-CM:oRz')-Rz)>0.001): + print "Rz position not ok" + elif(abs(caget('X11MA-OP2-CM:TRB.RBV')-baf)>0.001): + print "baffle position not ok" + else: + print "All positions OK" + + running = False + return 0 + except: + print "Exception in init" + traceback.print_exc() + raise + +#Fork and join +futures = fork(init,(countHS,("X11MA-OP2-CM:TRY",)), \ + (countHS,("X11MA-OP2-CM:TRZ",)), \ + (countHS,("X11MA-OP2-CM:ROX",)), \ + (countHS,("X11MA-OP2-CM:ROY",)), \ + (countHS,("X11MA-OP2-CM:ROZ",)), \ + (countHS,("X11MA-OP2-CM:TRB",)) ) +ret = join(futures) + +#check home switch status after init +homesw=True +for i in range(1,5): + if(ret[i]!=1): + homesw=False +print "Home switch status for all motors: %s" %("OK" if homesw == True else "Not OK") + +#final status report +if(homesw==True and ret[0]==0): + print "init-CMU: ==> done. OK!" +else: + print "init-CMU: ==> not done. NOT OK!" + diff --git a/script/beamline_init/InitFE.py b/script/beamline_init/InitFE.py new file mode 100644 index 0000000..f63ebfd --- /dev/null +++ b/script/beamline_init/InitFE.py @@ -0,0 +1,123 @@ +import time +import traceback + +running = False +counts = {} +encoder_raw = {} + + +def crossZero(encoder): + global counts + global encoder_raw + try: + time.sleep(1.0) + counts[encoder]=0 + if caget(encoder+".RVAL") > 0: + encoder_raw[encoder]=1 + elif caget(encoder+".RVAL") < 0: + encoder_raw[encoder]=-1 + def on_change(value): + global counts + global encoder_raw + if (encoder_raw[encoder]==1 and value < 0): + counts[encoder]=counts[encoder]+1 + encoder_raw[encoder]=-1 + print "Zero on" , encoder, "crossed" + elif(encoder_raw[encoder]==-1 and value > 0): + counts[encoder]=counts[encoder]+1 + encoder_raw[encoder]=1 + print "Zero on" , encoder, "crossed" + + #if int(value) == 0: + # print "Raw vlaue on" , encoder, "crossed", value + # counts[encoder]=counts[encoder]+1 + + with Channel(encoder+".RVAL", callback=on_change, monitored=True, name="test") as ch: + while(running==True): + time.sleep(0.1) + print "Encoder "+encoder +" crossed 0 "+ str(counts[encoder]) + " times" + return counts[encoder] + except: + print "Exception counting "+str(encoder) + traceback.print_exc() + raise + +def init(): + try: + global running + running = True + + print "startint FE slit initilization" + cenV = caget('X11MA-FE-SV:center') + cenH = caget('X11MA-FE-SH:center') + offV = caget('X11MA-FE-DSVER.A') + offH = caget('X11MA-FE-DSHOR.A') + + print "Old motor positions: centerV = " +str(cenV)+ \ + ", centerH = " +str(cenH)+ \ + ", offset V = " +str(offV)+ \ + ", offset H = " +str(offH) + + print "Initializing UP motor." + caput('X11MA-FE-DSUP:II.PROC',1) + time.sleep(1.0) + cawait('X11MA-FE-SV1:TR1.DMOV', 1) + print "Initializing DOWN motor." + caput('X11MA-FE-DSDW:II.PROC',1) + time.sleep(1.0) + cawait('X11MA-FE-SV1:TR2.DMOV', 1) + print "Initializing RING motor." + caput('X11MA-FE-DSRI:II.PROC',1) + time.sleep(1.0) + cawait('X11MA-FE-SH1:TR1.DMOV', 1) + print "Initializing WALL motor." + caput('X11MA-FE-DSWA:II.PROC',1) + time.sleep(1.0) + cawait('X11MA-FE-SH1:TR2.DMOV', 1) + + print "Setting offH and offV to 0." + caput('X11MA-FE-DSVER.A',0) + caput('X11MA-FE-DSHOR.A',0) + + print "Checking encoder offset values." + if(abs(caget('X11MA-FE-SV1:EC1Off')+42683)>10): + print "Up position not ok" + elif(abs(caget('X11MA-FE-SV1:EC2Off')+41362)>10): + print "Down position not ok" + elif(abs(caget('X11MA-FE-SH1:EC1Off')+40782)>10): + print "Ring position not ok" + elif(abs(caget('X11MA-FE-SH1:EC2Off')+39548)>10): + print "Wall position not ok" + else: + print "All positions OK" + + print "restoring Center and off values" + caput('X11MA-FE-SV:center',cenV) + caput('X11MA-FE-SH:center',cenH) + caput('X11MA-FE-DSVER.A',offV) + caput('X11MA-FE-DSHOR.A',offH) + + running = False + return 0 + except: + print "Exception in init" + traceback.print_exc() + raise + +#Fork and join +futures = fork(init,(crossZero,("X11MA-FE-SV1:EC1",)), \ + (crossZero,("X11MA-FE-SV1:EC2",)), \ + (crossZero,("X11MA-FE-SH1:EC1",)), \ + (crossZero,("X11MA-FE-SH1:EC2",)) ) +ret = join(futures) + +#check zero crossing status after init +zerocr=True +for i in range(1,4): + if(ret[i] != 2): + zerocr=False +#final status report +print "Zero crossing status for all motors: %s" %("OK" if zerocr == True else "Not OK") +print "init FE-slits: ==> done. %s" % ("OK" if zerocr == True else "Not OK") + + diff --git a/script/test/SlitCalib.py b/script/beamline_init/SlitCalib.py similarity index 75% rename from script/test/SlitCalib.py rename to script/beamline_init/SlitCalib.py index c1a902c..f1e8d72 100644 --- a/script/test/SlitCalib.py +++ b/script/beamline_init/SlitCalib.py @@ -5,24 +5,14 @@ from mathutils import fit_polynomial from mathutils import PolynomialFunction -# Input parameters -Slit = exit_slit -Slit_offset = exit_slit_offset -detector = keithley_1a -start = 30.0 -end = -20.0 -step_size = 1.0 -final_pos = 20.0 - -#setting parameters -if(Slit==exit_slit): - caput('X11MA-KEI10:RANGE', 6) # 6 --> 200 nA - Slit.move(start) - speed = Slit.getSpeed() - min_speed=Slit.getMinSpeed() - Slit.setSpeed(min_speed) - -time.sleep(1) +# Input parameters (example) +#Slit = exit_slit +#Slit_offset = exit_slit_offset +#detector = keithley_1a +#start = 30.0 +#end = -20.0 +#step_size = 1.0 +#final_pos = 20.0 # Execute the scan result=cscan(Slit, detector, start, end, float(step_size)) @@ -70,12 +60,7 @@ print k #change the offset offset=Slit_offset.read() -Slit_offset.write(offset+k) - -#resetting parameters -if(Slit == exit_slit): - caput('X11MA-KEI10:RANGE', 0) # 0--> AUTO - Slit.setSpeed(speed) +#Slit_offset.write(offset+k) Slit.write(final_pos) diff --git a/script/beamline_init/test.sh b/script/beamline_init/test.sh new file mode 100755 index 0000000..fa783a3 --- /dev/null +++ b/script/beamline_init/test.sh @@ -0,0 +1,3 @@ +ls +whoami +echo "init-CMU: ==> done" diff --git a/script/devices/LEEM2000.py b/script/devices/LEEM2000.py old mode 100755 new mode 100644 index 2dc9155..2327d3a --- a/script/devices/LEEM2000.py +++ b/script/devices/LEEM2000.py @@ -24,7 +24,7 @@ class LEEM2000(TcpDevice): try: pl = self.get_preset_label() except: - pl = "unknown" if microscope.client.isConnected() else "offline" + pl = "unknown" if self.client.isConnected() else "offline" value = "%1.3f | %s" % (hv,pl) if hv!="" or pl!="" else None self.setCache(value, None) @@ -113,7 +113,7 @@ class LEEM2000(TcpDevice): cmd = "prl" return self.send_receive(cmd, timeout, retries) - def get_high_voltage(c): + def get_high_voltage(self): return self.high_voltage.get(False) def get_child(self, var, name=None): diff --git a/script/devices/eiger.py b/script/devices/eiger.py old mode 100755 new mode 100644 index a1c234e..85aa9b2 --- a/script/devices/eiger.py +++ b/script/devices/eiger.py @@ -25,12 +25,30 @@ def stop_eiger_ioc(): subprocess.call("/work/sls/bin/X_X11MA_EigerStop.sh") print "IOC stopped" - +""" def integrate_roi(source, x,y, w, h): if source.data is None: source.update() roi = source.data.getRoi(Rectangle(x,y, w, h)) return roi.integrate(False) +""" + +def integrate_roi(source, x,y, w, h): + if source.data is None: + source.update() + rect = Rectangle(x,y, w, h) + roi = source.data.getRoi(rect) + """ + outliers_mask = get_outliers_mask() + if outliers_mask is not None: + mask = outliers_mask.getRoi(rect) + roi.mult(mask) + + outliers_threshold = get_outliers_threshold() + if outliers_threshold>0: + roi.threshold(outliers_threshold, False, 0.0) + """ + return roi.integrate(False) class RoiIntensitySourceListener (ImageListener): @@ -78,10 +96,12 @@ def create_roi_devices(roi_list, add = True): def grab_frame(source, roi=None, wait_next=False, outliers_threshold=None, outliers_mask=None, retries=None, timeout=None): global eiger_averaging_number_of_samples #, chrono_grab #chrono_grab.waitTimeout(GRAB_MIN_TIME) + """ if outliers_threshold is None: outliers_threshold = get_outliers_threshold() if outliers_mask is None: outliers_mask = get_outliers_mask() + """ if wait_next: if retries is None: retries = 3 @@ -89,11 +109,14 @@ def grab_frame(source, roi=None, wait_next=False, outliers_threshold=None, outli timeout=10.0 exposures = 1 if (eiger_averaging_number_of_samples is None) else eiger_averaging_number_of_samples retries=max(retries,1) - timeout = int(((eiger.exposure * eiger_averaging_number_of_samples) + timeout) * 1000) + timeout = int(((eiger.exposure * exposures) + timeout) * 1000) for try_count in range(retries): if str(eiger.grabMode)=="Single": eiger.waitReady(5000) - eiger.start() + eiger.start() + elif str(eiger.grabMode)=="Continuous": + if not eiger.isStarted(): + eiger.start() try: #eiger.getDataArray().waitCacheChange(timeout) source.waitNext(timeout) @@ -324,7 +347,9 @@ def apply_averaging_detector(value): def average_eiger_frames(samples, roi=None, wait_next=False, sleep=0, outliers_threshold=None, outliers_mask=None, retries=None, timeout=None): global eiger_averaging_number_of_samples #, chrono_eiger sample = int(samples) - if is_averaging_detector(): + if is_averaging_detector(): + if caget("X11MA-ES1-SD1:Proc1:EnableFilter")!="Enable": + raise Excetion("Cannot average frames in Eiger: filter is disabled") #chrono_eiger.waitTimeout(1000) caput("X11MA-ES1-SD1:Proc1:NumFilter", samples) caput("X11MA-ES1-SD1:cam1:NumCycles", samples) @@ -371,7 +396,38 @@ def get_outliers_mask(data_type='f'): eiger.setDataType(DataType.Float32) eiger.getDataArray().monitored=True - +class ProcImage(Filter): + def __init__(self): + Filter.__init__(self, "image") + self.roi=None + self.outliers_threshold=None + self.outliers_mask =None + + def processData(self, data): + outliers_threshold = get_outliers_threshold() if (self.outliers_threshold is None) else self.outliers_threshold + outliers_mask = get_outliers_mask() if (self.outliers_mask is None) else self.outliers_mask + roi = self.roi + data=data.copy() + if roi is not None: + data = data.getRoi(Rectangle(roi[0], roi[1], roi[2], roi[3])) + #ret = load_image(img) + if outliers_mask is not None: + data.mult(outliers_mask) + if outliers_threshold>0: + data.threshold(outliers_threshold, False, None) + #chrono_grab = Chrono() + return data + + def process(self, image, data): + return None #Does not generate BufferedImage here + +#image.removeAllListeners() +proc_image=ProcImage() +raw.addListener(proc_image) + + +add_device(proc_image, True) +image.refresh() if False: integrate_roi(image, 10, 5, 20, 10) diff --git a/script/local.py b/script/local.py old mode 100755 new mode 100644 index 345cf47..3ea4e03 --- a/script/local.py +++ b/script/local.py @@ -251,6 +251,15 @@ def otf2(start, end, time, delay = 0.0, mode = None, offset = None, alpha = None """ #folder = get_context().setup.expandPath("{year}_{month}/{date}"); run("templates/EnergyScan_v2", {"E1":start, "E2":end, "TIME":time, "DELAY":float(delay), "MODE":mode, "OFFSET":(offset), "FOLDER":folder, "FILE":name, "TAG":name, "ALPHA":float(alpha) if alpha is not None else None}) + +def otf_img(start, end, time, delay = 0.0, exposure=0.2, roi=None, name = None, save_images=False): + folder = get_context().setup.expandPath("{year}_{month}/{date}"); + if is_string(roi): + with open(expand_path("{config}/ROIs/" + roi + ".roi"), 'rb') as f: + roi = OrderedDict() + for r in Serializer.decode(f.read(), Serializer.EncoderType.bin)[0]: + roi[str(r[0])] = [int(r[1]), int(r[2]), int(r[3]), int(r[4])] + run("templates/EnergyScan_img", {"E1":start, "E2":end, "TIME":time, "DELAY":float(delay), "FOLDER":folder, "FILE":name, "ROI":roi, "EXPOSURE":exposure, "SAVE_IMAGES": save_images}) def two_pol(switching="Tune_Detune", sequence="A", measurements=1, exposure=1.0, average=1, name = None): @@ -323,6 +332,42 @@ def abs_spec(ranges, roi=None, switch_pol=False, scans=1, exposure=1.0, average= }) +################################################################################################### +#Settings +################################################################################################### + + +def set_dry_run(value): + """ + """ + set_setting("DRY_RUN", bool(value)) + +def get_dry_run(): + """ + """ + return str(get_setting("DRY_RUN")).lower() == "true" + +def set_outliers_threshold(value): + set_setting("OUTLIERS_THRESHOLD", int(value)) + +def get_outliers_threshold(): + try: + return int(get_setting("OUTLIERS_THRESHOLD")) + except: + return 0 + +def get_outliers_mask_file(): + return get_setting("OUTLIERS_MASK_FILE") + +def write_metadata(): + for name in ["proposer", "proposal", "pgroup", "sample"]: + value = get_setting(name) + set_attribute("/", name, value) + setting = get_setting("authors") + set_attribute("/", "authors", setting.split("|") if setting is not None else [""]) + + + ################################################################################################### #Devices @@ -534,8 +579,10 @@ class MeasurementsFilter(Filter): filter_measurements = None -def start_measurements(measurements=["StdDev"], source = image, renderer=None): +def start_measurements(measurements=["StdDev"], source = None, renderer=None): global filter_measurements + if source is None: + source = image stop_measurements() filter_measurements = MeasurementsFilter(measurements) filter_measurements.start(string_to_obj(source), string_to_obj(renderer)) @@ -612,7 +659,9 @@ def play_sound(name): try: Audio.playFile(File(get_context().setup.expandPath("{home}/sounds/" + name + ".wav")), False) except: - log("Error playing sound " + name + ": " + str(sys.exc_info()[1]), False) + #TODO: sound does not work when logged as e-account + if not Sys.getUserName().startswith("e"): + log("Error playing sound " + name + ": " + str(sys.exc_info()[1]), False) ################################################################################################### @@ -786,44 +835,32 @@ def fit(ydata, xdata = None, limit_to_range=False): run("templates/FocusScan") -def auto_focus(): - run("templates/AutoFocus") +def auto_focus(scan_type="all", range_obj=4.0, step_obj=0.2, range_stig=20.0, step_stig=2.0, average=1, runs=2, renderer = None, roi=None, exposure=None): + """ + RANGE_OBJ = 4.0 + STEP_OBJ = 0.2 + RANGE_STIG = 20.0 + STEP_STIG = 2.0 + UPDATE_POSITION = True + AVERAGE = 1 + RUNS = 2 + width, height = eiger.getImageSize() + ROI = Rectangle(width/3, height/3, width/3, height/3,) + """ + run("templates/AutoFocus", { \ + "SCAN_TYPE": scan_type, \ + "RANGE_OBJ": float(range_obj), \ + "STEP_OBJ": float(step_obj), \ + "RANGE_STIG": float(range_stig), \ + "STEP_STIG": float(step_stig), \ + "AVERAGE": int(average), \ + "RUNS": int(runs), \ + "UPDATE_POSITION": True, \ + "RENDERER": renderer, \ + "ROI":roi, \ + "EXPOSURE":exposure \ + }) -def auto_intensity(): - return scan_focus(girder_x, 0.05, 0.005, average=3) +def auto_intensity(roi=None): + return scan_contrast(girder_x, 0.05, 0.005, roi, average=3) -################################################################################################### -#Settings -################################################################################################### - - -def set_dry_run(value): - """ - """ - set_setting("DRY_RUN", bool(value)) - -def get_dry_run(): - """ - """ - return str(get_setting("DRY_RUN")).lower() == "true" - -def set_outliers_threshold(value): - set_setting("OUTLIERS_THRESHOLD", int(value)) - -def get_outliers_threshold(): - try: - return int(get_setting("OUTLIERS_THRESHOLD")) - except: - return 0 - -def get_outliers_mask_file(): - return get_setting("OUTLIERS_MASK_FILE") - -def write_metadata(): - for name in ["proposer", "proposal", "pgroup", "sample"]: - value = get_setting(name) - set_attribute("/", name, value) - setting = get_setting("authors") - set_attribute("/", "authors", setting.split("|") if setting is not None else [""]) - - diff --git a/script/saved_dcument2_13sep2021 b/script/saved_dcument2_13sep2021 new file mode 100644 index 0000000..bdb79da --- /dev/null +++ b/script/saved_dcument2_13sep2021 @@ -0,0 +1,32 @@ +#wold be nice to print relative changes of the parameters +RANGE_OBJ = 1.0 +STEP_OBJ = 0.1 +RANGE_STIG = 10.0 +STEP_STIG = 1.0 +UPDATE_POSITION = True +AVERAGE = 1 +width, height = eiger.getImageSize() +#ROI = Rectangle(width/3, height/3, width/3, height/3,) +#ROI = Rectangle(0, 0, width, height,) +ROI = Rectangle(200,100,256,256) #(x0,y0,delta_x(2**n), delta_y(2**n)) +ROI = Rectangle(130,74,256,256) +ROI = Rectangle(180,170,256,256) + + +initial_state = get_focus_scan_pos() +print "Initial state:" , initial_state + +set_focus_scan_roi(ROI) + + + +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ,average = AVERAGE, update_position = UPDATE_POSITION) +r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG,average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, average = AVERAGE, update_position = UPDATE_POSITION)# + +final_state = get_focus_scan_pos() +print "Final state:" , final_state diff --git a/script/saved_document_13sep2021 b/script/saved_document_13sep2021 new file mode 100644 index 0000000..36d214a --- /dev/null +++ b/script/saved_document_13sep2021 @@ -0,0 +1,44 @@ +#wold be nice to print relative changes of the parameters +RANGE_OBJ = 1.0 +STEP_OBJ = 0.1 +RANGE_STIG = 10.0 +STEP_STIG = 1.0 +UPDATE_POSITION = True +AVERAGE = 1 +SETTLING_TIME =0.5 +width, height = eiger.getImageSize() +#ROI = Rectangle(width/3, height/3, width/3, height/3,) +#ROI = Rectangle(0, 0, width, height,) +ROI = Rectangle(200,100,256,256)#(x0,y0,delta_x(2**n), delta_y(2**n)) +ROI = Rectangle(130,74,256,256) + + +initial_state = objective.read(),obj_stig_a.read(),obj_stig_b.read() +print "Initial state:" , initial_state + +def apply_pos(pos): + objective.write(pos[0]) + obj_stig_a.write(pos[1]) + obj_stig_b.write(pos[2]) + +def show_roi(): + global ROI + pn=show_panel(image) + ov=Overlays.Rect(Pen(Color.BLUE), Point(ROI.x,ROI.y),Dimension(ROI.width,ROI.height)) + pn.clearOverlays() + ov.setMovable(True) + pn.addOverlay(ov) +show_roi() + + + +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) +#r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION)# + +final_state = objective.read(),obj_stig_a.read(),obj_stig_b.read() +print "Final state:" , final_state diff --git a/script/templates/AutoFocus.py b/script/templates/AutoFocus.py old mode 100755 new mode 100644 index 67acd8d..8f2ee72 --- a/script/templates/AutoFocus.py +++ b/script/templates/AutoFocus.py @@ -1,28 +1,49 @@ -RANGE_OBJ = 4.0 -STEP_OBJ = 0.2 -RANGE_STIG = 20.0 -STEP_STIG = 2.0 -UPDATE_POSITION = True -AVERAGE = 1 -width, height = eiger.getImageSize() -ROI = Rectangle(width/3, height/3, width/3, height/3,) +if (get_exec_pars().source == CommandSource.ui) and (get_exec_pars().script == "AutoFocus") : + SCAN_TYPE = "all" + RANGE_OBJ = 2.0 + STEP_OBJ = 0.2 + RANGE_STIG = 20.0 + STEP_STIG = 2.0 + UPDATE_POSITION = True + AVERAGE = 1 + RUNS = 1 + width, height = eiger.getImageSize() + RENDERER = None + ROI = Rectangle(width/3, height/3, width/3, height/3,) + EXPOSURE = None + +print "Auto Focus: ", SCAN_TYPE, RANGE_OBJ, STEP_OBJ, RANGE_STIG , STEP_STIG, UPDATE_POSITION, AVERAGE, RUNS, ROI, EXPOSURE initial_state = objective.read(),obj_stig_a.read(),obj_stig_b.read() print "Initial state:" , initial_state +set_focus_scan_roi(ROI, RENDERER) -def apply_pos(pos): - objective.write(pos[0]) - obj_stig_a.write(pos[1]) - obj_stig_b.write(pos[2]) - - -r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) -r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, roi = ROI, average = AVERAGE, update_position = UPDATE_POSITION) - +former_exposure = None +try: + if EXPOSURE: + former_exposure = eiger.getExposure() + if former_exposure!=EXPOSURE: + set_exposure_time(EXPOSURE) + grab_frame(image, None, True) #Update reference image if changing exposure + + for run_no in range(RUNS): + if SCAN_TYPE in ("all", "obj"): + #print "Scan obj" + r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, average = AVERAGE, update_position = UPDATE_POSITION) + if SCAN_TYPE in ("all", "stiga"): + #print "Scan stig a" + r=scan_focus(obj_stig_a, RANGE_STIG, STEP_STIG, average = AVERAGE, update_position = UPDATE_POSITION) + if SCAN_TYPE in ("all", "stigb"): + #print "Scan stig b" + r=scan_focus(obj_stig_b, RANGE_STIG, STEP_STIG, average = AVERAGE, update_position = UPDATE_POSITION) + if SCAN_TYPE in ("all"): + #print "Scan obj" + r=scan_focus(objective, RANGE_OBJ, STEP_OBJ, average = AVERAGE, update_position = UPDATE_POSITION) +finally: + if EXPOSURE: + if (former_exposure is not None) and (former_exposure!=EXPOSURE): + set_exposure_time(former_exposure) + restore_eiger() + final_state = objective.read(),obj_stig_a.read(),obj_stig_b.read() print "Final state:" , final_state diff --git a/script/templates/Eiger2Img.py b/script/templates/Eiger2Img.py old mode 100755 new mode 100644 index 6026d60..61c1a66 --- a/script/templates/Eiger2Img.py +++ b/script/templates/Eiger2Img.py @@ -18,6 +18,7 @@ print "Starting 2Img: ", METHOD, SWITCHING, SEQUENCE , MEASUREMENTS, AUTO_SAVE, SHOW_IMAGES = True SAVE_DIAGS = True +CORRECT_DRIFTS = False ID = get_setting("ID") @@ -84,8 +85,21 @@ def imageinfo(info): def save_image_file(frame, cycle=-1, frame_index=0): + if frame is None: + raise Exception("Cannot save frame - None: cycle: " + str(cycle) + " index: " + str(frame_index)) if SHOW_IMAGES: - plot(frame.matrix if (type(frame) == Data) else get_ip_array(frame), name = get_image_file_name(cycle, frame_index, True)) + plot_name = get_image_file_name(cycle, frame_index, True) + plot_data = frame.matrix if (type(frame) == Data) else get_ip_array(frame) + if plot_data is None: + raise Exception("Cannot save frame - plot_data is None: cycle: " + str(cycle) + " index: " + str(frame_index)) + plots=plot(plot_data, name = plot_name) + if (len(plots)==0): + msg = "Error creating plots - cycle: " + str(cycle) + " index: " + str(frame_index) + print msg + log(msg) + else: + p=plots[0] + p.getAxis(p.AxisId.Y).setInverted(True) if AUTO_SAVE and (frame is not None): filename = get_image_file_name(cycle, frame_index) threads.append(save_as_tiff(frame, filename, check=False, parallel=True, metadata=(get_diags() if SAVE_DIAGS else {}))) @@ -100,6 +114,12 @@ run_index = get_context().getDaySequentialNumber() print " ---- Run index : %d" %(run_index,) max_index=0 +if CORRECT_DRIFTS: + roi = get_focus_scan_roi() + calc_roi = None if (roi is None) else Roi(roi.x,roi.y,roi.width, roi.height) + calc_roi=Roi(0,0,512,512) + ref_image = None # grab_frame(image, None, True) + #print "Startup time: " + str(time.time() - start) try: for scan in range(NUMBER_SCANS): @@ -119,10 +139,10 @@ try: #s=time.time() av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) #print "--- Time: " + str(time.time() - s) + #time.sleep(1) #added by Armin frames.append(av) - imageinfo("I") + imageinfo("I") save_image_file(frames[i], cycle, i) - if METHOD == "Take_Image": break @@ -141,7 +161,18 @@ try: frames.append(frames[1].copy()) frames[2].div(frames[0]) save_image_file(frames[2],cycle, 2) - + if CORRECT_DRIFTS and (calc_roi is not None): + if ref_image is None: + ref_image = frames[0] + print "-> Saved shift ref image" + else: + cur_image = frames[0] + xoff, yoff, error, diffphase = calculate_shift(ref_image,cur_image, calc_roi) + if (0 Calculated shift: ", xoff, yoff, error, diffphase + else: + print "-> Error - shift too big:", xoff, yoff + # objective = getObjective() # temp = getLEEMtemp() # log(0 , "Temp : " + Format(temp,"0.00") + " OB : " + Format(objective,"0.00") + " StigmaA : " + " StigmaB : " ) diff --git a/script/templates/Eiger2Img_Hannes_valve_close.py b/script/templates/Eiger2Img_Hannes_valve_close.py new file mode 100644 index 0000000..d118fea --- /dev/null +++ b/script/templates/Eiger2Img_Hannes_valve_close.py @@ -0,0 +1,238 @@ +#If running from editor +if (get_exec_pars().source == CommandSource.ui) and (get_exec_pars().script == "Eiger2Img") : + METHOD = "Two_Pol" + SWITCHING = "Tune_Detune" + SEQUENCE = "A" + MEASUREMENTS = 4 + AUTO_SAVE = True + EXPOSURE = 1.0 + AVERAGE = 2.0 + ENERGY_1 = 850.0 + ENERGY_2= 900.0 + SWITCH_POL=False + NUMBER_SCANS =1 + +print "Starting 2Img: ", METHOD, SWITCHING, SEQUENCE , MEASUREMENTS, AUTO_SAVE, EXPOSURE, AVERAGE, ENERGY_1, ENERGY_2, SWITCH_POL,NUMBER_SCANS +#SEQUENCE = "A": C+,C-,C-,C+,C+;C-,C-,C+, +#SEQUENCE = "B": C+,C-,C+,C-,C+,-;C+,C-. + +SHOW_IMAGES = True +SAVE_DIAGS = True +CORRECT_DRIFTS = False + +ID = get_setting("ID") + +ENERGY = [ENERGY_1, ENERGY_2] +#POLARIZATION = [POLARIZATION_1, POLARIZATION_2] + +if METHOD == "Two_Energies": + for en in [ENERGY_1, ENERGY_2]: + if en < 89.9 or en > 2000: + raise Exception("Bad energy argument") + +start = time.time() +threads = [] + + +#path = "{data}/{year}_{month}/{date}" + "/" + "{seq}%03d_" + METHOD +#set_exec_pars(path= path, format="txt", layout="table", open=True) +#data_path = get_context().setup.expandPath(path) +data_path = "{data}/{year}_{month}/{date}/{date}_{name}" +set_exec_pars(name=METHOD, path = data_path, format="txt", layout="table", open=True) +#data_path = get_exec_pars().path + +#get_context().incrementFileSequentialNumber() + + +def get_image_file_name(cycle=-1, frame_index=0, short_name=False): + global max_index + if (METHOD == "Two_Pol") and (SEQUENCE == "A") and (frame_index<2) and ((cycle%2)==0): #Swapped + frame_index = 0 if frame_index else 1 + root = "" if short_name else (data_path + "/") + #prefix = get_context().setup.expandPath("i{seq}%03d" + "_" + ("%d" % frame_index)) + abs_index=run_index + frame_index + max_index= max(max_index, frame_index) + #prefix = get_context().setup.expandPath("i{date}%02d_{seq}%03d") + prefix = get_context().setup.expandPath("i{date}%02d_" + ("%03d" % (abs_index,))) + + if cycle < 0: + ret = root + prefix + ".tif" + else: + ret= root + prefix + "/i{date}%02d"+ ("_%03d#%03d" % (abs_index,cycle)) + ".tif" + return get_context().setup.expandPath(ret) + + + + +""" +def getLEEM(): + global startvoltage,objective, LEEMtemp + startvoltage=getStartvoltage() + objective=getObjective() + LEEMtemp=getLEEMtemp() +""" + +#Initialize vartiables +if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true": + open_vg10() + +#rbkEnergy=energy_rbk.read() +if METHOD == "Two_Pol" or (SWITCH_POL and (METHOD == "Take_Image")): + init_pol_switch(SWITCHING) + +def imageinfo(info): + pass + + +def save_image_file(frame, cycle=-1, frame_index=0): + + if SHOW_IMAGES: + p=plot(frame.matrix if (type(frame) == Data) else get_ip_array(frame), name = get_image_file_name(cycle, frame_index, True))[0] + p.getAxis(p.AxisId.Y).setInverted(True) + if AUTO_SAVE and (frame is not None): + filename = get_image_file_name(cycle, frame_index) + threads.append(save_as_tiff(frame, filename, check=False, parallel=True, metadata=(get_diags() if SAVE_DIAGS else {}))) + + log(filename) + print filename + # log("SV:"+Format(startvoltage,"0.000")+" OB:"+Format(objective,"0.00")+" ST:"+Format(LEEMtemp,"0.0")) + +init_eiger(exposure=EXPOSURE) + +run_index = get_context().getDaySequentialNumber() +print " ---- Run index : %d" %(run_index,) +max_index=0 + +if CORRECT_DRIFTS: + roi = get_focus_scan_roi() + calc_roi = None if (roi is None) else Roi(roi.x,roi.y,roi.width, roi.height) + calc_roi=Roi(0,0,512,512) + ref_image = None # grab_frame(image, None, True) + +#print "Startup time: " + str(time.time() - start) +try: + for scan in range(NUMBER_SCANS): + #Do the measurement loop + for cycle in range(1, MEASUREMENTS + 1): + frames = [] + if MEASUREMENTS > 1: + log("nround = " + str(cycle) + " / " + str(MEASUREMENTS)) + + + for i in range(2): + + if i > 0: + open_vg10() #added by Hannes + time.sleep(5) #added by Hannes + if (cycle == 1) or (METHOD != "Take_Image"): + assert_status_ok() + if METHOD == "Two_Energies": + change_energy(ENERGY[i]) + print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) + #s=time.time() + av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) + #print "--- Time: " + str(time.time() - s) + time.sleep(1) #added by Armin + frames.append(av) + imageinfo("I") + time.sleep(1) #added by Armin + save_image_file(frames[i], cycle, i) + close_vg10() #added by Hannes + time.sleep(10) #added by Hannes should take 1 image every 10 minutes with shutter closed in between + if METHOD == "Take_Image": + break + + if METHOD == "Two_Pol": + if (i==0) or (SEQUENCE == "B"): + switch_pol() + #time.sleep(1) + + if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"): + if (METHOD == "Two_Energies") or (SEQUENCE == "B") or ((cycle%2)==1): + print "Divide first frame by second" + frames.append(frames[0].copy()) + frames[2].div(frames[1]) + else: + print "Divide second frame by first" + frames.append(frames[1].copy()) + frames[2].div(frames[0]) + save_image_file(frames[2],cycle, 2) + if CORRECT_DRIFTS and (calc_roi is not None): + if ref_image is None: + ref_image = frames[0] + print "-> Saved shift ref image" + else: + cur_image = frames[0] + xoff, yoff, error, diffphase = calculate_shift(ref_image,cur_image, calc_roi) + if (0 Calculated shift: ", xoff, yoff, error, diffphase + else: + print "-> Error - shift too big:", xoff, yoff + + # objective = getObjective() + # temp = getLEEMtemp() + # log(0 , "Temp : " + Format(temp,"0.00") + " OB : " + Format(objective,"0.00") + " StigmaA : " + " StigmaB : " ) + # Auto average and save + + print "Waiting file writing threads to finish..." + for t in threads: + join(t) + if (MEASUREMENTS > 1) and (AUTO_SAVE == 1): + print "--- Averaging..." + for i in range(len(frames)): + """ + measures = [] + for cycle in range(1, MEASUREMENTS + 1): + filename = get_image_file_name(cycle, i) + ip = open_image(filename) + #measures.append(Data(get_ip_array(ip))) + measures.append(ip) + #av = average_frames(measures) #Result is transposed??? + av=average_ips (measures, roi=None, as_float=True) + """ + integration = None + for cycle in range(1, MEASUREMENTS + 1): + filename = get_image_file_name(cycle, i) + print "Open " , filename + ip = open_image(filename) + if integration is None: + integration = ip + else: + integration =integrate_ips ([integration, ip], as_float=True) + av=op_const(integration, "divide", float(MEASUREMENTS), in_place=True) + save_image_file(av, -1, i) + + + if SWITCH_POL and (METHOD == "Take_Image"): + switch_pol() + + #SWITCH_POL = False + #set_exec_pars(then_success="run('templates/Eiger2Img')") + + """ + get_context().incrementDaySequentialNumber() + set_exec_pars(open=False) + set_exec_pars(open=True) + + for cycle in range(1, MEASUREMENTS + 1): + frames = [] + if MEASUREMENTS > 1: + log("nround = " + str(cycle) + " / " + str(MEASUREMENTS)) + print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) + av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) + imageinfo("I") + save_image_file(av, cycle, i) + + """ + #TODO: This is a workaround to handle 2-Images, should be removed + run_index = run_index + 1 + if scan>0: + max_index=max_index+1 + print " ---- New un index : %d" %(run_index,) +finally: + for i in range(max_index): + get_context().incrementDaySequentialNumber() + if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true": + close_vg10() + restore_eiger() + print "Running time: " + str(time.time() - start) \ No newline at end of file diff --git a/script/templates/Eiger2Img_Original.py b/script/templates/Eiger2Img_Original.py new file mode 100644 index 0000000..10fef2a --- /dev/null +++ b/script/templates/Eiger2Img_Original.py @@ -0,0 +1,232 @@ +#If running from editor +if (get_exec_pars().source == CommandSource.ui) and (get_exec_pars().script == "Eiger2Img") : + METHOD = "Two_Pol" + SWITCHING = "Tune_Detune" + SEQUENCE = "A" + MEASUREMENTS = 4 + AUTO_SAVE = True + EXPOSURE = 1.0 + AVERAGE = 2.0 + ENERGY_1 = 850.0 + ENERGY_2= 900.0 + SWITCH_POL=False + NUMBER_SCANS =1 + +print "Starting 2Img: ", METHOD, SWITCHING, SEQUENCE , MEASUREMENTS, AUTO_SAVE, EXPOSURE, AVERAGE, ENERGY_1, ENERGY_2, SWITCH_POL,NUMBER_SCANS +#SEQUENCE = "A": C+,C-,C-,C+,C+;C-,C-,C+, +#SEQUENCE = "B": C+,C-,C+,C-,C+,-;C+,C-. + +SHOW_IMAGES = True +SAVE_DIAGS = True +CORRECT_DRIFTS = False + +ID = get_setting("ID") + +ENERGY = [ENERGY_1, ENERGY_2] +#POLARIZATION = [POLARIZATION_1, POLARIZATION_2] + +if METHOD == "Two_Energies": + for en in [ENERGY_1, ENERGY_2]: + if en < 89.9 or en > 2000: + raise Exception("Bad energy argument") + +start = time.time() +threads = [] + + +#path = "{data}/{year}_{month}/{date}" + "/" + "{seq}%03d_" + METHOD +#set_exec_pars(path= path, format="txt", layout="table", open=True) +#data_path = get_context().setup.expandPath(path) +data_path = "{data}/{year}_{month}/{date}/{date}_{name}" +set_exec_pars(name=METHOD, path = data_path, format="txt", layout="table", open=True) +#data_path = get_exec_pars().path + +#get_context().incrementFileSequentialNumber() + + +def get_image_file_name(cycle=-1, frame_index=0, short_name=False): + global max_index + if (METHOD == "Two_Pol") and (SEQUENCE == "A") and (frame_index<2) and ((cycle%2)==0): #Swapped + frame_index = 0 if frame_index else 1 + root = "" if short_name else (data_path + "/") + #prefix = get_context().setup.expandPath("i{seq}%03d" + "_" + ("%d" % frame_index)) + abs_index=run_index + frame_index + max_index= max(max_index, frame_index) + #prefix = get_context().setup.expandPath("i{date}%02d_{seq}%03d") + prefix = get_context().setup.expandPath("i{date}%02d_" + ("%03d" % (abs_index,))) + + if cycle < 0: + ret = root + prefix + ".tif" + else: + ret= root + prefix + "/i{date}%02d"+ ("_%03d#%03d" % (abs_index,cycle)) + ".tif" + return get_context().setup.expandPath(ret) + + + + +""" +def getLEEM(): + global startvoltage,objective, LEEMtemp + startvoltage=getStartvoltage() + objective=getObjective() + LEEMtemp=getLEEMtemp() +""" + +#Initialize vartiables +if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true": + open_vg10() + +#rbkEnergy=energy_rbk.read() +if METHOD == "Two_Pol" or (SWITCH_POL and (METHOD == "Take_Image")): + init_pol_switch(SWITCHING) + +def imageinfo(info): + pass + + +def save_image_file(frame, cycle=-1, frame_index=0): + if SHOW_IMAGES: + p=plot(frame.matrix if (type(frame) == Data) else get_ip_array(frame), name = get_image_file_name(cycle, frame_index, True))[0] + p.getAxis(p.AxisId.Y).setInverted(True) + if AUTO_SAVE and (frame is not None): + filename = get_image_file_name(cycle, frame_index) + threads.append(save_as_tiff(frame, filename, check=False, parallel=True, metadata=(get_diags() if SAVE_DIAGS else {}))) + + log(filename) + print filename + # log("SV:"+Format(startvoltage,"0.000")+" OB:"+Format(objective,"0.00")+" ST:"+Format(LEEMtemp,"0.0")) + +init_eiger(exposure=EXPOSURE) + +run_index = get_context().getDaySequentialNumber() +print " ---- Run index : %d" %(run_index,) +max_index=0 + +if CORRECT_DRIFTS: + roi = get_focus_scan_roi() + calc_roi = None if (roi is None) else Roi(roi.x,roi.y,roi.width, roi.height) + calc_roi=Roi(0,0,512,512) + ref_image = None # grab_frame(image, None, True) + +#print "Startup time: " + str(time.time() - start) +try: + for scan in range(NUMBER_SCANS): + #Do the measurement loop + for cycle in range(1, MEASUREMENTS + 1): + frames = [] + if MEASUREMENTS > 1: + log("nround = " + str(cycle) + " / " + str(MEASUREMENTS)) + + + for i in range(2): + if (cycle == 1) or (METHOD != "Take_Image"): + assert_status_ok() + if METHOD == "Two_Energies": + change_energy(ENERGY[i]) + print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) + #s=time.time() + av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) + #print "--- Time: " + str(time.time() - s) + time.sleep(1) #added by Armin + frames.append(av) + imageinfo("I") + time.sleep(1) #added by Armin + save_image_file(frames[i], cycle, i) + + if METHOD == "Take_Image": + break + + if METHOD == "Two_Pol": + if (i==0) or (SEQUENCE == "B"): + switch_pol() + #time.sleep(1) + + if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"): + if (METHOD == "Two_Energies") or (SEQUENCE == "B") or ((cycle%2)==1): + print "Divide first frame by second" + frames.append(frames[0].copy()) + frames[2].div(frames[1]) + else: + print "Divide second frame by first" + frames.append(frames[1].copy()) + frames[2].div(frames[0]) + save_image_file(frames[2],cycle, 2) + if CORRECT_DRIFTS and (calc_roi is not None): + if ref_image is None: + ref_image = frames[0] + print "-> Saved shift ref image" + else: + cur_image = frames[0] + xoff, yoff, error, diffphase = calculate_shift(ref_image,cur_image, calc_roi) + if (0 Calculated shift: ", xoff, yoff, error, diffphase + else: + print "-> Error - shift too big:", xoff, yoff + + # objective = getObjective() + # temp = getLEEMtemp() + # log(0 , "Temp : " + Format(temp,"0.00") + " OB : " + Format(objective,"0.00") + " StigmaA : " + " StigmaB : " ) + # Auto average and save + + print "Waiting file writing threads to finish..." + for t in threads: + join(t) + if (MEASUREMENTS > 1) and (AUTO_SAVE == 1): + print "--- Averaging..." + for i in range(len(frames)): + """ + measures = [] + for cycle in range(1, MEASUREMENTS + 1): + filename = get_image_file_name(cycle, i) + ip = open_image(filename) + #measures.append(Data(get_ip_array(ip))) + measures.append(ip) + #av = average_frames(measures) #Result is transposed??? + av=average_ips (measures, roi=None, as_float=True) + """ + integration = None + for cycle in range(1, MEASUREMENTS + 1): + filename = get_image_file_name(cycle, i) + print "Open " , filename + ip = open_image(filename) + if integration is None: + integration = ip + else: + integration =integrate_ips ([integration, ip], as_float=True) + av=op_const(integration, "divide", float(MEASUREMENTS), in_place=True) + save_image_file(av, -1, i) + + + if SWITCH_POL and (METHOD == "Take_Image"): + switch_pol() + + #SWITCH_POL = False + #set_exec_pars(then_success="run('templates/Eiger2Img')") + + """ + get_context().incrementDaySequentialNumber() + set_exec_pars(open=False) + set_exec_pars(open=True) + + for cycle in range(1, MEASUREMENTS + 1): + frames = [] + if MEASUREMENTS > 1: + log("nround = " + str(cycle) + " / " + str(MEASUREMENTS)) + print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) + av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) + imageinfo("I") + save_image_file(av, cycle, i) + + """ + #TODO: This is a workaround to handle 2-Images, should be removed + run_index = run_index + 1 + if scan>0: + max_index=max_index+1 + print " ---- New un index : %d" %(run_index,) +finally: + for i in range(max_index): + get_context().incrementDaySequentialNumber() + if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true": + close_vg10() + restore_eiger() + print "Running time: " + str(time.time() - start) \ No newline at end of file diff --git a/script/templates/FocusScan.py b/script/templates/FocusScan.py old mode 100755 new mode 100644 index a076ffa..e244092 --- a/script/templates/FocusScan.py +++ b/script/templates/FocusScan.py @@ -1,6 +1,6 @@ SETTLING_TIME =0.5 MAX_CONTRAST = 10e14 -MAX_SHIFT = 100 +MAX_SHIFT = 300 import java.awt.Rectangle as Rectangle @@ -30,26 +30,36 @@ def apply_focus_scan_pos(pos): obj_stig_b.write(pos[2]) -fucus_scan_roi=None +focus_scan_roi=None +focus_scan_renderer=None def show_focus_scan_roi(): - global fucus_scan_roi - pn=show_panel(image) - ov=Overlays.Rect(Pen(Color.BLUE), Point(fucus_scan_roi.x,fucus_scan_roi.y),Dimension(fucus_scan_roi.width,fucus_scan_roi.height)) - pn.clearOverlays() - #ov.setMovable(True) - pn.addOverlay(ov) + global focus_scan_roi, focus_scan_renderer + if focus_scan_renderer is None: + pn=show_panel(image) + ov=Overlays.Rect(Pen(Color.BLUE), Point(focus_scan_roi.x,focus_scan_roi.y),Dimension(focus_scan_roi.width,focus_scan_roi.height)) + pn.clearOverlays() + #ov.setMovable(True) + pn.addOverlay(ov) + else: + pn = focus_scan_renderer + if len(pn.overlays)==0: + pn.addOverlay(Overlays.Rect(pn.getPenProfile())) + pn.overlays[0].setMovable(True) + ov=pn.overlays[0] + ov.update(Point(focus_scan_roi.x,focus_scan_roi.y),Dimension(focus_scan_roi.width,focus_scan_roi.height)) + pn.refresh() -def set_focus_scan_roi(roi): - global fucus_scan_roi - fucus_scan_roi = roi +def set_focus_scan_roi(roi, renderer=None): + global focus_scan_roi, focus_scan_renderer + focus_scan_renderer = renderer + focus_scan_roi = roi show_focus_scan_roi() def get_focus_scan_roi(): - return fucus_scan_roi + return focus_scan_roi -""" -def scan_focus(positioner, pos_range, pos_step, roi = None, average = 1, update_position = True, update_roi = True)): +def scan_contrast(positioner, pos_range, pos_step, roi = None, average = 1, update_position = True): def after_read(rec): if rec[positioner] > MAX_CONTRAST: print "Invalid contrast value" @@ -60,6 +70,9 @@ def scan_focus(positioner, pos_range, pos_step, roi = None, average = 1, update_ print "Waiting to reach scan init pos" time.sleep(1.0) + cur = positioner.read() + if (cur < positioner.minValue+pos_range) or (cur > positioner.maxValue-pos_range): + raise Exception("Cannot perform contrast scan: " + positioner.name + " too close to limit") if roi is None: sensor = image_contrast @@ -89,7 +102,8 @@ def scan_focus(positioner, pos_range, pos_step, roi = None, average = 1, update_ print "Invalid fit for ", positioner.name, mn, range_scan time.sleep(1.0) # Wait restoring positions return r -""" + + def update_roi_pos(cur_data, former_data): roi=get_focus_scan_roi() calc_roi = Roi(roi.x,roi.y,roi.width, roi.height) @@ -101,10 +115,10 @@ def update_roi_pos(cur_data, former_data): print "Updating ROI location to ", x, y x,y=max(x,0), max(y,0) x,y=min(x,cur_data.width-roi.width), min(y,cur_data.height-roi.height) - ROI.setLocation(x,y) + roi.setLocation(x,y) show_focus_scan_roi() else: - print "Error - sshift too big: xoff, yoff" + print "Error - shift too big: xoff, yoff" except: print "Error calculating shift: " + str(sys.exc_info()[1]) @@ -168,9 +182,10 @@ def scan_focus(positioner, pos_range, pos_step, average = 1, update_position = T #time.sleep(1.0) # Wait restoring positions #print "Updating position: ", positioner.name, mn #show_message("Setting mx pos", blocking = True) + #time.sleep(3.0) former_data = image.data positioner.write(mn) - time.sleep(eiger.exposure+SETTLING_TIME) + time.sleep(eiger.exposure+SETTLING_TIME) #show_message("Updating ROI", blocking = True) update_roi_pos(image.data, former_data) else: diff --git a/script/test/FESlitCalib.py b/script/test/FESlitCalib.py deleted file mode 100644 index 33a564d..0000000 --- a/script/test/FESlitCalib.py +++ /dev/null @@ -1,21 +0,0 @@ -#seting parameters -caput('X11MA-KEI10:RANGE', 6) # 6 --> 200 nA -fe_slit_H_size.move(1.0) -fe_slit_V_size.move(1.0) - -#scan SizeH -SlitCalib(Slit=fe_slit_H_size, Slit_offset=fe_slit_H_size_offs, detector = keithley_1a, start=1.0, end=-0.5, step_size=0.03, final_pos=1.0) -time.sleep(1) -#scan SizeV -SlitCalib(Slit=fe_slit_V_size, Slit_offset=fe_slit_V_size_offs, detector = keithley_1a, start=1.0, end=-0.5, step_size=0.03, final_pos=1.0) - -ctrH=fe_slit_H_ctr.getPosition() -wdthH=2.6 -ctrV=fe_slit_V_ctr.getPosition() -wdthV=1.3 -#scan CenterH -SlitCalib(Slit=fe_slit_H_ctr, Slit_offset=fe_slit_H_ctr, detector = Keithley_1_raw, start=ctrH - wdthH/2, end=ctrH + wdth/2, step_size=0.1, ctrH - wdth/2) - -#resetting parameters -caput ('X11MA-FE-DSAPER', 0) # 0--> closed -caput('X11MA-KEI10:RANGE', 0) # 0--> AUTO \ No newline at end of file diff --git a/script/test/OutlierFix.py b/script/test/OutlierFix.py new file mode 100644 index 0000000..661f9ec --- /dev/null +++ b/script/test/OutlierFix.py @@ -0,0 +1,15 @@ + +def integrate_roi(source, x,y, w, h): + if source.data is None: + source.update() + rect = Rectangle(x,y, w, h) + roi = source.data.getRoi(rect) + + outliers_mask = get_outliers_mask() + if outliers_mask is not None: + mask = outliers_mask.getRoi(rect) + roi.mult(mask) + + outliers_threshold = get_outliers_threshold() + if outliers_threshold>0: + roi.threshold(outliers_threshold, False, 0.0) \ No newline at end of file diff --git a/script/test/TestFilter.py b/script/test/TestFilter.py new file mode 100644 index 0000000..ebfbbd7 --- /dev/null +++ b/script/test/TestFilter.py @@ -0,0 +1,33 @@ +class PreProcImage(Filter): + def __init__(self): + Filter.__init__(self, "preproc_image") + self.roi=None + self.outliers_threshold=None + self.outliers_mask =None + + def processData(self, data): + outliers_threshold = get_outliers_threshold() if (self.outliers_threshold is None) else self.outliers_threshold + outliers_mask = get_outliers_mask() if (self.outliers_mask is None) else self.outliers_mask + roi = self.roi + data=data.copy() + if roi is not None: + data = data.getRoi(Rectangle(roi[0], roi[1], roi[2], roi[3])) + #ret = load_image(img) + if outliers_mask is not None: + data.mult(outliers_mask) + if outliers_threshold>0: + data.threshold(outliers_threshold, False, None) + #chrono_grab = Chrono() + return data + + def process(self, image, data): + return None #Does not generate BufferedImage here + +image.removeAllListeners() + +preproc_image=PreProcImage() +image.addListener(preproc_image) + + +add_device(preproc_image, True) +image.refresh() \ No newline at end of file diff --git a/script/test/test_3rd_ahrm.py b/script/test/test_3rd_ahrm.py new file mode 100644 index 0000000..0ef83ca --- /dev/null +++ b/script/test/test_3rd_ahrm.py @@ -0,0 +1,4 @@ +caput('X11MA-ID2:HARMONIC', 3) +time.sleep(15) +caput('X11MA-ID2:HARMONIC', 1) +#time.sleep(10) diff --git a/script/test/test_exposure.py b/script/test/test_exposure.py new file mode 100644 index 0000000..4974f5e --- /dev/null +++ b/script/test/test_exposure.py @@ -0,0 +1,20 @@ + +EXPOSURE=1.0 + +for i in range(100): + former_exposure = eiger.getExposure() + if former_exposure !=0.2: + raise Exception("Bad exposure") + set_exposure_time(EXPOSURE) + grab_frame(image, None, True) #Update reference image if changing exposure + + + time.sleep(1.0) + if former_exposure!=EXPOSURE: + set_exposure_time(former_exposure) + restore_eiger() + if (i%3)==0: + eiger.stop() + time.sleep(1.0) + print"Stop" + \ No newline at end of file diff --git a/script/test_speed.py b/script/test_speed.py new file mode 100644 index 0000000..c448976 --- /dev/null +++ b/script/test_speed.py @@ -0,0 +1 @@ +otf2(start=680, end=900, time=1, delay=1, mode='LINEAR', alpha = 0.0, offset=-1.2, name='AS31_Survey') \ No newline at end of file diff --git a/script/unknown b/script/unknown new file mode 100644 index 0000000..1d570a1 --- /dev/null +++ b/script/unknown @@ -0,0 +1,19 @@ + +source=image +samples=10 +roi=None +wait_next=False +sleep=0 + + +outliers_threshold=None +outliers_mask=None +retries=None +timeout=None +frames = [] +for i in range(samples): + if (i>0) and (sleep>0): + time.sleep(sleep) + aux = grab_frame(source, roi, wait_next, outliers_threshold, outliers_mask, retries, timeout) + frames.append(aux) +ret=average_frames(frames) if samples > 1 else frames[0] \ No newline at end of file