commit d4ccb471149b3d48b70c5aa9bd5792e316600d96 Author: gobbo_a Date: Fri Jan 9 16:22:50 2026 +0100 Creation diff --git a/config/config.properties b/config/config.properties new file mode 100755 index 0000000..fd71ee5 --- /dev/null +++ b/config/config.properties @@ -0,0 +1,60 @@ +#Fri Jan 09 16:22:24 CET 2026 +autoSaveScanData=true +simulation=false +xscanCrlogicChannel=null +dataScanSaveOutput=true +userAuthenticator= +dataScanSaveScript=true +notifiedTasks= +parallelInitialization=false +fdaSerialization=false +dataTransferPath= +saveConsoleSessionFiles=false +xscanAppendSuffix=true +hostName= +disableEmbeddedAttributes=false +serverPort=8080 +versionTrackingEnabled=true +dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name} +serverEnabled=false +depthDimension=0 +logLevel=Info +dataLayout=default +disableDataFileLogs=false +dataScanSaveTimestamps=false +sessionHandling=Off +terminalEnabled=false +notificationLevel=Off +terminalPort=3579 +dataTransferUser= +xscanContinuousUpdate=false +versionTrackingLogin= +noBytecodeFiles=false +versionTrackingRemote= +dataScanLazyTableCreation=false +pythonHome= +xscanMoveTimeout=600 +logDaysToLive=-1 +xscanCrlogicSimulated=false +logLevelConsole=Off +filePermissionsConfig=Public +scanStreamerPort=-1 +dataScanSaveSetpoints=true +versionTrackingManual=false +dataTransferMode=Off +userManagement=false +instanceName=CR +dataServerPort=-1 +hideServerMessages=false +dataScanReleaseRecords=false +dataScanPreserveTypes=false +dataScanFlushRecords=false +filePermissionsLogs=Public +logPath={logs}/{date}_{time} +filePermissionsScripts=Public +xscanCrlogicPrefix=null +filePermissionsData=Default +xscanCrlogicAbortable=true +dataProvider=txt +xscanCrlogicIoc=null +saveCommandStatistics=false diff --git a/config/devices.properties b/config/devices.properties new file mode 100755 index 0000000..c55d334 --- /dev/null +++ b/config/devices.properties @@ -0,0 +1,11 @@ +PBPS149_XPOS=ch.psi.pshell.bs.Scalar|SAROP31-PBPS149:XPOS|||true +dispatcher=ch.psi.pshell.bs.Dispatcher|https://dispatcher-api.psi.ch/sf||| +cam_server=ch.psi.pshell.bs.PipelineServer|sf-daqsync-01:8889||| +charge=ch.psi.pshell.epics.ProcessVariable|SINEG01-DICT215:B1_CHARGE_AVERAGE-OP|||true +rep_rate_bunch_1=ch.psi.pshell.epics.ProcessVariable|SIN-TIMAST-TMA:Bunch-1-Appl-Freq-RB|||true +rep_rate_bunch_2=ch.psi.pshell.epics.ProcessVariable|SIN-TIMAST-TMA:Bunch-2-Appl-Freq-RB|||true +destination_AR=ch.psi.pshell.epics.ChannelString|SF:MODE_AR false|||true +pulse_energy=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US|||true +slit_oh_h=ch.psi.pshell.epics.Motor|SAROP31-OAPU107:MOTOR_X|||true +energy_AR=ch.psi.pshell.epics.ProcessVariable|SF:ENERGY_AR|||true +laser=ch.psi.pshell.epics.ChannelString|SLG-LGEN:WHICH_LASER false|||true diff --git a/config/jcae.properties b/config/jcae.properties new file mode 100755 index 0000000..5440381 --- /dev/null +++ b/config/jcae.properties @@ -0,0 +1,12 @@ +#Mon Feb 07 16:59:57 CET 2022 +ch.psi.jcae.ContextFactory.addressList= +ch.psi.jcae.ContextFactory.serverPort= +ch.psi.jcae.ContextFactory.maxArrayBytes=50000000 +ch.psi.jcae.ContextFactory.maxSendArrayBytes= +ch.psi.jcae.ChannelFactory.retries=1 +ch.psi.jcae.ChannelFactory.timeout=1250 +ch.psi.jcae.impl.DefaultChannelService.retries=4 +ch.psi.jcae.impl.DefaultChannelService.timeout=1000 +ch.psi.jcae.ContextFactory.autoAddressList=true +ch.psi.jcae.ContextFactory.useShellVariables=true +ch.psi.jcae.ContextFactory.addLocalBroadcastInterfaces=false diff --git a/config/mail.properties b/config/mail.properties new file mode 100755 index 0000000..48776ea --- /dev/null +++ b/config/mail.properties @@ -0,0 +1,9 @@ +#Mon Feb 07 16:57:19 CET 2022 +port=0 +usr= +auth=None +smsSuffix=@sms.switch.ch +host= +from= +to= +pwd= diff --git a/config/preferences.json b/config/preferences.json new file mode 100755 index 0000000..f48d2bc --- /dev/null +++ b/config/preferences.json @@ -0,0 +1,119 @@ +{ + "fontShellPanel" : { + "name" : "Monospaced", + "style" : 0, + "size" : 13 + }, + "fontShellCommand" : { + "name" : "SansSerif", + "style" : 0, + "size" : 13 + }, + "fontOutput" : { + "name" : "Monospaced", + "style" : 0, + "size" : 13 + }, + "fontEditor" : { + "name" : "Monospaced", + "style" : 0, + "size" : 13 + }, + "fontPlotLabel" : { + "name" : "SansSerif", + "style" : 0, + "size" : 11 + }, + "fontPlotTick" : { + "name" : "SansSerif", + "style" : 0, + "size" : 10 + }, + "fontPlotTitle" : { + "name" : "SansSerif", + "style" : 1, + "size" : 13 + }, + "fontTerminal" : null, + "tabSize" : 4, + "contentWidth" : 0, + "editorBackground" : null, + "editorForeground" : null, + "simpleEditor" : false, + "hideEditorLineNumbers" : false, + "hideEditorContextMenu" : false, + "consoleLocation" : "Document", + "dataPanelLocation" : null, + "openDataFilesInDocTab" : false, + "noVariableEvaluationPropagation" : false, + "processingScripts" : [ ], + "asyncViewersUpdate" : false, + "scanPlotDisabled" : false, + "scanTableDisabled" : false, + "cachedDataPanel" : false, + "dataExtensions" : null, + "dataSubFiles" : null, + "hideFileName" : false, + "showEmergencyStop" : false, + "showHomingButtons" : false, + "showJogButtons" : false, + "hideScanPanel" : false, + "hideOutputPanel" : false, + "showXScanFileBrowser" : false, + "showQueueBrowser" : false, + "backgroundRendering" : false, + "showImageStatusBar" : true, + "persistRendererWindows" : false, + "defaultRendererColormap" : "Grayscale", + "linePlot" : "ch.psi.pshell.plot.LinePlotJFree", + "matrixPlot" : "ch.psi.pshell.plot.MatrixPlotJFree", + "surfacePlot" : "null", + "timePlot" : "ch.psi.pshell.plot.TimePlotJFree", + "plotsDetached" : false, + "plotLayout" : "Vertical", + "quality" : "High", + "defaultPlotColormap" : "Temperature", + "markerSize" : 2, + "plotBackground" : null, + "gridColor" : null, + "outlineColor" : null, + "disableOffscreenBuffer" : false, + "defaultPanels" : [ { + "deviceClassName" : "ch.psi.pshell.epics.Scaler", + "panelClassName" : "ch.psi.pshell.swing.ScalerPanel" + }, { + "deviceClassName" : "ch.psi.pshell.epics.Scienta", + "panelClassName" : "ch.psi.pshell.swing.ScientaPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.Motor", + "panelClassName" : "ch.psi.pshell.swing.MotorPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.MasterPositioner", + "panelClassName" : "ch.psi.pshell.swing.MasterPositionerPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.ProcessVariable", + "panelClassName" : "ch.psi.pshell.swing.ProcessVariablePanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.MotorGroup", + "panelClassName" : "ch.psi.pshell.swing.MotorGroupPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.DiscretePositioner", + "panelClassName" : "ch.psi.pshell.swing.DiscretePositionerPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.Camera", + "panelClassName" : "ch.psi.pshell.swing.CameraPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.Slit", + "panelClassName" : "ch.psi.pshell.swing.SlitPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.HistogramGenerator", + "panelClassName" : "ch.psi.pshell.swing.HistogramGeneratorPanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister$ReadonlyRegisterArray", + "panelClassName" : "ch.psi.pshell.swing.DeviceValueChart" + }, { + "deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister$ReadonlyRegisterMatrix", + "panelClassName" : "ch.psi.pshell.swing.DeviceValueChart" + } ], + "scriptPopupDialog" : "Exception" +} \ No newline at end of file diff --git a/config/setup.properties b/config/setup.properties new file mode 100755 index 0000000..cba350f --- /dev/null +++ b/config/setup.properties @@ -0,0 +1,25 @@ +#Tue Aug 16 17:07:05 CEST 2022 +scriptPath={home}/script +sessionsPath={outp}/sessions +configFileDevices={config}/devices.properties +xscanPath={script} +queuePath={script} +extensionsPath={home}/extensions +configPath={home}/config +configFileSessions={config}/sessions.properties +userSessionsPath={sessions}/user +dataPath={outp}/data +configFileVariables={config}/variables.properties +wwwPath={home}/www +logPath={outp}/log +configFile={config}/config.properties +configFileTasks={config}/tasks.properties +pluginsPath={home}/plugins +consoleSessionsPath={sessions}/console +libraryPath={script}; {script}/Lib +contextPath={outp}/context +configFilePlugins={config}/plugins.properties +devicesPath={home}/devices +configFileSettings={config}/settings.properties +imagesPath={outp}/images +scriptType=py diff --git a/config/variables.properties b/config/variables.properties new file mode 100755 index 0000000..6e5bfbd --- /dev/null +++ b/config/variables.properties @@ -0,0 +1,4 @@ +#Thu Oct 30 14:09:10 CET 2025 +LastRunDate=251030 +DaySequentialNumber=4 +FileSequentialNumber=400 diff --git a/devices/CamServer.properties b/devices/CamServer.properties new file mode 100755 index 0000000..9f5e938 --- /dev/null +++ b/devices/CamServer.properties @@ -0,0 +1,25 @@ +#Mon Feb 07 17:10:12 CET 2022 +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=false +roiY=0 +roiX=0 +transpose=false diff --git a/devices/Camera Server.properties b/devices/Camera Server.properties new file mode 100755 index 0000000..595bc77 --- /dev/null +++ b/devices/Camera Server.properties @@ -0,0 +1,25 @@ +#Sun Mar 20 11:13:16 CET 2022 +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=false +roiY=0 +roiX=0 +transpose=false diff --git a/devices/CameraServer.properties b/devices/CameraServer.properties new file mode 100755 index 0000000..85fe72c --- /dev/null +++ b/devices/CameraServer.properties @@ -0,0 +1,25 @@ +#Thu Jan 19 13:54:21 CET 2023 +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=false +roiY=0 +roiX=0 +transpose=false diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties new file mode 100755 index 0000000..2e53eda --- /dev/null +++ b/devices/CurrentCamera.properties @@ -0,0 +1,29 @@ +#Tue Apr 29 16:15:28 CEST 2025 +spatialCalOffsetY=-616.0000075906464 +spatialCalOffsetX=-779.9999974141 +colormapLogarithmic=false +scale=1.0 +grayscale=false +spatialCalScaleX=-2.0338983065225418 +spatialCalScaleY=-1.408450716176002 +colormapMax=1.0 +rescaleOffset=0.0 +roiWidth=-1 +colormap=Flame +imageWidth=2560 +invert=false +colormapMin=0.0 +rotation=0.0 +rotationCrop=false +rescaleFactor=1.0 +imageHeight=2160 +spatialCalUnits=null +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=true +roiY=0 +roiX=0 +transpose=false +regionStartX=1 +regionStartY=1 diff --git a/devices/Sample.properties b/devices/Sample.properties new file mode 100755 index 0000000..15d9734 --- /dev/null +++ b/devices/Sample.properties @@ -0,0 +1,10 @@ +#Thu Feb 17 15:10:13 CET 2022 +minValue=NaN +unit=null +offset=0.0 +maxValue=NaN +rotation=false +precision=-1 +sign_bit=0 +scale=1.0 +resolution=NaN diff --git a/devices/Time.properties b/devices/Time.properties new file mode 100755 index 0000000..f9339a3 --- /dev/null +++ b/devices/Time.properties @@ -0,0 +1,11 @@ +#Wed Feb 22 17:48:31 CET 2023 +minValue=NaN +unit=null +offset=0.0 +maxValue=NaN +rotation=false +precision=-1 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/cam_server.properties b/devices/cam_server.properties new file mode 100755 index 0000000..5015781 --- /dev/null +++ b/devices/cam_server.properties @@ -0,0 +1,25 @@ +#Wed Feb 22 20:28:29 CET 2023 +spatialCalOffsetY=-619.5736918340126 +spatialCalOffsetX=-861.5983157300177 +colormapLogarithmic=false +scale=1.0 +grayscale=false +spatialCalScaleX=-0.4878048873593859 +spatialCalScaleY=-0.4914004915394752 +colormapMax=NaN +rescaleOffset=0.0 +roiWidth=-1 +colormap=Flame +invert=false +colormapMin=NaN +rotationCrop=false +rotation=0.0 +rescaleFactor=1.0 +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=true +roiY=0 +roiX=0 +transpose=false diff --git a/devices/charge.properties b/devices/charge.properties new file mode 100755 index 0000000..201c66a --- /dev/null +++ b/devices/charge.properties @@ -0,0 +1,10 @@ +#Tue Aug 16 17:07:08 CEST 2022 +minValue=NaN +unit=pC +offset=0.0 +maxValue=NaN +precision=1 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/dispatcher.properties b/devices/dispatcher.properties new file mode 100755 index 0000000..34a8f04 --- /dev/null +++ b/devices/dispatcher.properties @@ -0,0 +1,14 @@ +#Tue Nov 28 11:04:15 CET 2023 +sendStrategy=complete_all +disableCompression=false +keepListeningOnStop=false +sendBuildChannelConfig=at_startup +parallelHandlerProcessing=true +analizeHeader=false +sendAwaitFirstMessage=false +headerReservingAllocator=false +socketType=DEFAULT +validationInconsistency=keep_as_is +byteBufferAllocator=false +mappingIncomplete=fill_null +sendSyncTimeout=0 diff --git a/devices/energy_AR.properties b/devices/energy_AR.properties new file mode 100755 index 0000000..69e02a3 --- /dev/null +++ b/devices/energy_AR.properties @@ -0,0 +1,10 @@ +#Tue Aug 16 17:07:08 CEST 2022 +minValue=NaN +unit=MeV +offset=0.0 +maxValue=NaN +precision=3 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/rep_rate.properties b/devices/rep_rate.properties new file mode 100755 index 0000000..29e04fa --- /dev/null +++ b/devices/rep_rate.properties @@ -0,0 +1,9 @@ +#Thu Feb 17 09:02:40 CET 2022 +minValue=NaN +unit=null +offset=0.0 +maxValue=NaN +precision=-1 +sign_bit=0 +scale=1.0 +resolution=NaN diff --git a/devices/rep_rate_bunch_1.properties b/devices/rep_rate_bunch_1.properties new file mode 100755 index 0000000..6ba100a --- /dev/null +++ b/devices/rep_rate_bunch_1.properties @@ -0,0 +1,10 @@ +#Tue Aug 16 17:07:08 CEST 2022 +minValue=0.0 +unit=Hz +offset=0.0 +maxValue=0.0 +precision=2 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/rep_rate_bunch_2.properties b/devices/rep_rate_bunch_2.properties new file mode 100755 index 0000000..6ba100a --- /dev/null +++ b/devices/rep_rate_bunch_2.properties @@ -0,0 +1,10 @@ +#Tue Aug 16 17:07:08 CEST 2022 +minValue=0.0 +unit=Hz +offset=0.0 +maxValue=0.0 +precision=2 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/sim_positioner.properties b/devices/sim_positioner.properties new file mode 100755 index 0000000..13376be --- /dev/null +++ b/devices/sim_positioner.properties @@ -0,0 +1,11 @@ +#Tue Aug 16 17:07:11 CEST 2022 +minValue=NaN +unit=null +offset=0.0 +maxValue=NaN +rotation=false +precision=-1 +sign_bit=0 +scale=1.0 +description=null +resolution=NaN diff --git a/devices/slit_oh_h.properties b/devices/slit_oh_h.properties new file mode 100755 index 0000000..2923b8a --- /dev/null +++ b/devices/slit_oh_h.properties @@ -0,0 +1,19 @@ +#Tue Aug 16 17:07:08 CEST 2022 +offset=0.0 +maxValue=1.0E10 +precision=3 +rotation=false +scale=1.0 +description=null +estbilizationDelay=0 +maxSpeed=NaN +resolution=0.05 +homingType=None +startRetries=1 +minValue=-1.0E10 +unit=mm +defaultSpeed=1.0 +sign_bit=0 +hasEnable=false +monitorByPosition=false +minSpeed=NaN diff --git a/script/Bernina_DCM.scan b/script/Bernina_DCM.scan new file mode 100755 index 0000000..3094086 --- /dev/null +++ b/script/Bernina_DCM.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 12670.0, 12690.0, 10.0 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11102 intensity", 50, 0.1, "Enabled" ], [ "CamServer", "tcp://sf-daqsync-14.psi.ch:9007 intensity", 50, 0.05, "Disabled" ], [ "Stream", "SAROP21-PPRM113:intensity", 50, 0.05, "Disabled" ], [ "CamServer", "tcp://sf-daqsync-03.psi.ch:9009 intensity", 50, 0.05, "Disabled" ], [ "Channel", "SAROP21-PBPS103:INTENSITY", 50, 0.05, "Disabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Bernina_DCM.scan_a b/script/Bernina_DCM.scan_a new file mode 100755 index 0000000..ed8d80f --- /dev/null +++ b/script/Bernina_DCM.scan_a @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 12670.0, 12690.0, 10.0 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11102 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Bernina_DCM_PPRM102.scan b/script/Bernina_DCM_PPRM102.scan new file mode 100755 index 0000000..c7deed6 --- /dev/null +++ b/script/Bernina_DCM_PPRM102.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 11850.0, 12000.0, 2.5 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11115 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Bernina_DCM_PPRM113.scan b/script/Bernina_DCM_PPRM113.scan new file mode 100755 index 0000000..cd5573f --- /dev/null +++ b/script/Bernina_DCM_PPRM113.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 12200.0, 12460.0, 2.5 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11134 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Bernina_DCM_a.scan b/script/Bernina_DCM_a.scan new file mode 100755 index 0000000..a2cb4a0 --- /dev/null +++ b/script/Bernina_DCM_a.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 7950.0, 8060.0, 2.5 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11133 intensity", 50, 0.1, "Enabled" ], [ "Stream", "SAROP21-PBPS103:INTENSITY", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Bernina_DCM_b.scan b/script/Bernina_DCM_b.scan new file mode 100755 index 0000000..acec434 --- /dev/null +++ b/script/Bernina_DCM_b.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP21-ARAMIS:ENERGY_SP.VAL", 8300.0, 8440.0, 2.5 ] ], [ [ "CamServer", "tcp://sf-daqsync-14.psi.ch:11154 intensity", 50, 0.05, "Enabled" ], [ "Stream", "SAROP21-PBPS103:INTENSITY", 50, 0.05, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/IFC_trigger_scan.scan b/script/IFC_trigger_scan.scan new file mode 100755 index 0000000..9d4fadc --- /dev/null +++ b/script/IFC_trigger_scan.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SARES30-LTIM01-EVR0:Pul0_NEW_DELAY", 7200.0, 7500.0, 1 ] ], [ [ "Channel", "SARES30-LSCP1-FNS:CH0:VAL_GET", 10, 0.01, "Enabled" ] ], false, [ ], "", 1, 1.0, 0.0, false, false, true, true, "", "", " ", "", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/OAPU107_X.scan b/script/OAPU107_X.scan new file mode 100755 index 0000000..a396051 --- /dev/null +++ b/script/OAPU107_X.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU107:MOTOR_X.VAL", -1.0, 1.0, 0.2 ] ], [ [ "Stream", "SAROP31-PPRM113:intensity", 50, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS113:INTENSITY", 50, 0.1, "Enabled" ] ], false, [ ], "OAPU107 X-scan", 1, 1.0, 0.0, false, false, true, true, "", "", "", "h5", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/OAPU107_Y.scan b/script/OAPU107_Y.scan new file mode 100755 index 0000000..622bc67 --- /dev/null +++ b/script/OAPU107_Y.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU107:MOTOR_H.VAL", 0.0, 2.0, 0.02 ] ], [ [ "CamServer", "http://sf-daqsync-01:8889/SAROP31-PPRM113_sp1 intensity", 10, 0.1, "Enabled" ] ], false, [ ], "OAPU149 X-scan", 1, 1.0, 0.0, false, false, true, true, "test2", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/OAPU149_X-scan_PPRM150.scan b/script/OAPU149_X-scan_PPRM150.scan new file mode 100755 index 0000000..ac89ad9 --- /dev/null +++ b/script/OAPU149_X-scan_PPRM150.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU149:MOTOR_X.VAL", -1.3, 2.1, 0.05 ] ], [ [ "CamServer", "tcp://sf-daqsync-16.psi.ch:11112 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "OAPU149 X-scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "csv", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/OAPU149_Y-scan_PPRM150.scan b/script/OAPU149_Y-scan_PPRM150.scan new file mode 100755 index 0000000..5dca06c --- /dev/null +++ b/script/OAPU149_Y-scan_PPRM150.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU149:MOTOR_Y.VAL", -1.2, 1.2, 0.05 ] ], [ [ "CamServer", "tcp://sf-daqsync-16.psi.ch:11112 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "OAPU149 Y-scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "csv", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/ODCC110_E.scan b/script/ODCC110_E.scan new file mode 100755 index 0000000..5c1def9 --- /dev/null +++ b/script/ODCC110_E.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-ODCC110:MOT_ENY.VAL", 7.94, 8.06, 0.002 ] ], [ [ "CamServer", "SAROP31-PPRM113_sp intensity", 80, 0.1, "Disabled" ], [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD4", 80, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/ODCC110_Eoffset.scan b/script/ODCC110_Eoffset.scan new file mode 100755 index 0000000..4c730d9 --- /dev/null +++ b/script/ODCC110_Eoffset.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-ODCC110:MOT_OFS.VAL", 0.018, 0.026, 2.5E-4 ] ], [ [ "CamServer", "SAROP31-PPRM113_sp intensity", 50, 0.1, "Disabled" ], [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD4", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/ODCC110_RX2.scan b/script/ODCC110_RX2.scan new file mode 100755 index 0000000..96fedeb --- /dev/null +++ b/script/ODCC110_RX2.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-ODCC110:MOT_RX2.VAL", 8.725, 8.731, 2.5E-4 ] ], [ [ "CamServer", "SAROP31-PPRM113_sp intensity", 50, 0.1, "Enabled" ] ], false, [ ], "Bernina DCM scan", 1, 1.0, 0.0, false, false, true, true, "", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/PBPS113_X_calibration.scan b/script/PBPS113_X_calibration.scan new file mode 100755 index 0000000..f483849 --- /dev/null +++ b/script/PBPS113_X_calibration.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-PBPS113:MOTOR_X1.VAL", -0.2, 0.2, 0.025 ] ], [ [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD0", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD2", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD1", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD3", 20, 0.1, "Enabled" ] ], false, [ ], "PBPS113 X calibration", 1, 1.0, 0.0, false, false, true, true, "", "", " ", "h5", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/PBPS149_X_calibration.scan b/script/PBPS149_X_calibration.scan new file mode 100755 index 0000000..d3680b6 --- /dev/null +++ b/script/PBPS149_X_calibration.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-PBPS149:MOTOR_X1.VAL", -0.2, 0.2, 0.05 ] ], [ [ "Stream", "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD0", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD2", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD1", 20, 0.1, "Enabled" ], [ "Stream", "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD3", 20, 0.1, "Enabled" ] ], false, [ ], "PBPS149 X calibration", 1, 1.0, 0.0, false, false, false, true, "", "", "", "", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/Sample_F-Trans_Y.scan b/script/Sample_F-Trans_Y.scan new file mode 100755 index 0000000..d970ab8 --- /dev/null +++ b/script/Sample_F-Trans_Y.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAR-EXPMX:MOT_FY.VAL", -0.385, -0.375, 5.0E-4 ], [ "Channel", "", 0.0, 0.0, 1 ] ], [ [ "CamServer", "http://sf-daqsync-01:8889/SARES30-CAMS156-X8M_sp1 intensity", 50, 0.1, "Enabled" ] ], false, [ ], "Sample F-Trans Y", 1, 1.0, 0.0, false, false, true, true, "", "", "", "csv", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/SwissMX_EdgeScan.scan b/script/SwissMX_EdgeScan.scan new file mode 100755 index 0000000..05dc72d --- /dev/null +++ b/script/SwissMX_EdgeScan.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAR-EXPMX:MOT_FY.VAL", 3.6053, 3.6253, 5.0E-4 ] ], [ [ "CamServer", "tcp://sf-daqsync-09.psi.ch:11113 intensity", 10, 0.1, "Enabled" ] ], false, [ ], "SwissMX edge scan", 1, 1.0, 0.0, false, false, true, true, "p22553_y1.txt", "", "Default", "txt", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/example.scan b/script/example.scan new file mode 100755 index 0000000..75f9b44 --- /dev/null +++ b/script/example.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU149:MOTOR_X.VAL", -2.0, 2.0, 0.1 ] ], [ [ "CamServer", "http://sf-daqsync-01:8889/SAROP31-PPRM150_sp1 intensity", 10, 0.1, "Enabled" ], [ "Device", "create_device(\"bs://SAROP31-PBPS149:INTENSITY\")", 10, 0.1, "Enabled" ] ], false, [ ], "", 1, 1.0, 0.0, false, false, true, true, "", "", " ", "", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/local.groovy b/script/local.groovy new file mode 100755 index 0000000..eef7106 --- /dev/null +++ b/script/local.groovy @@ -0,0 +1,3 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.groovy +/////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/script/local.js b/script/local.js new file mode 100755 index 0000000..e2eeaad --- /dev/null +++ b/script/local.js @@ -0,0 +1,4 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.js +/////////////////////////////////////////////////////////////////////////////////////////////////// + diff --git a/script/local.py b/script/local.py new file mode 100755 index 0000000..008e007 --- /dev/null +++ b/script/local.py @@ -0,0 +1,369 @@ +################################################################################################### +# Deployment specific global definitions - executed after startup.py +################################################################################################### + +from mathutils import estimate_peak_indexes, fit_gaussians, create_fit_point_list, Gaussian +from mathutils import fit_polynomial,fit_gaussian, fit_harmonic, calculate_peaks +from mathutils import PolynomialFunction, Gaussian, HarmonicOscillator + +import java.awt.Color as Color + +################################################################################################### +# Layout setup +################################################################################################### +import ch.psi.pshell.data.LayoutSF as LayoutSF +LayoutSF.setExperimentArguments([charge, laser, rep_rate_bunch_1, rep_rate_bunch_2, destination_AR, energy_AR]) + + +################################################################################################### +# Machine utilities +################################################################################################### + +LASER_SETTLING_TIME = 3.0 + +def laser_on(bunch=None): + print "Laser On - bunch “ + str(bunch) + #caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 0) + if (bunch==1) or (bunch is None): + caput("SWISSFEL-STATUS:Bunch-1-OnDelay-Sel", 0) + if (bunch==2) or (bunch is None): + caput("SWISSFEL-STATUS:Bunch-2-OnDelay-Sel", 0) + caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1) + time.sleep(LASER_SETTLING_TIME) + +def laser_off(bunch=None): + print "Laser Off - bunch “ + str(bunch) + #caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 1) + if (bunch==1) or (bunch is None): + caput("SWISSFEL-STATUS:Bunch-1-OnDelay-Sel", 1) + if (bunch==2) or (bunch is None): + caput("SWISSFEL-STATUS:Bunch-2-OnDelay-Sel", 1) + caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1) + time.sleep(LASER_SETTLING_TIME) + +def is_laser_on(bunch=None): + #return (caget ("SIN-TIMAST-TMA:Beam-Las-Delay-Sel",'d') == 0 ) + if bunch==1: + return (caget ("SWISSFEL-STATUS:Bunch-1-OnDelay-Sel",'d') == 0 ) + if bunch==2: + return (caget ("SWISSFEL-STATUS:Bunch-2-OnDelay-Sel",'d') == 0 ) + if bunch is None: + return is_laser_on(1) and is_laser_on(2) + +def save_laser_state(): + global laser_was_on_1, laser_was_on_2 + laser_was_on_1 = is_laser_on(1) + laser_was_on_2 = is_laser_on(2) + +def restore_laser_state(): + global laser_was_on_1, laser_was_on_2 + if laser_was_on_1: + laser_on(1) + else: + laser_off(1) + if laser_was_on_2: + laser_on(2) + else: + laser_off(2) + +def get_beam_ok_channel(bunch): + if bunch==2: + return "SIN-CVME-TIFGUN-EVR0:BUNCH-2-OK" + if bunch==1: + return "SIN-CVME-TIFGUN-EVR0:BUNCH-1-OK" + +def is_timing_ok(): + return caget("SIN-TIMAST-TMA:SOS-COUNT-CHECK") == 0 + +def get_repetition_rate(bunch=1, setp=None): + if not setp: + if bunch==2: + ret = caget(c, 'd') + else: + ret = caget("SIN-TIMAST-TMA:Bunch-1-Appl-Freq-RB", 'd') + if setp==False or ret > 0: + return ret + print "Readback is 0: returning Setpoint" + sel = caget("SIN-TIMAST-TMA:Bunch-" + str(bunch) + "-Freq-Sel") + return float(sel.split(" ")[0]) + + + +################################################################################################### +# Maths utilities +################################################################################################### + +def fit(ydata, xdata = None): + """ + Gaussian fit + """ + if xdata is None: + xdata = frange(0, len(ydata), 1) + #ydata = to_list(ydata) + #xdata = to_list(xdata) + max_y= max(ydata) + index_max = ydata.index(max_y) + max_x= xdata[index_max] + print "Max index:" + str(index_max), + print " x:" + str(max_x), + print " y:" + str(max_y) + gaussians = fit_gaussians(ydata, xdata, [index_max,]) + (norm, mean, sigma) = gaussians[0] + p = plot([ydata],["data"],[xdata], title="Fit" )[0] + fitted_gaussian_function = Gaussian(norm, mean, sigma) + scale_x = [float(min(xdata)), float(max(xdata)) ] + points = max((len(xdata)+1), 100) + resolution = (scale_x[1]-scale_x[0]) / points + fit_y = [] + fit_x = frange(scale_x[0],scale_x[1],resolution, True) + for x in fit_x: + fit_y.append(fitted_gaussian_function.value(x)) + p.addSeries(LinePlotSeries("fit")) + p.getSeries(1).setData(fit_x, fit_y) + + if abs(mean - xdata[index_max]) < ((scale_x[0] + scale_x[1])/2): + print "Mean -> " + str(mean) + p.addMarker(mean, None, "Mean="+str(round(norm,2)), Color.MAGENTA.darker()) + return (norm, mean, sigma) + else: + p.addMarker(max_x, None, "Max="+str(round(max_x,2)), Color.GRAY) + print "Invalid gaussian fit: " + str(mean) + return (None, None, None) + + +def hfit(ydata, xdata = None): + """ + Harmonic fit + """ + if xdata is None: + xdata = frange(0, len(ydata), 1) + + max_y= max(ydata) + index_max = ydata.index(max_y) + max_x= xdata[index_max] + + start,end = min(xdata), max(xdata) + (amplitude, angular_frequency, phase) = fit_harmonic(ydata, xdata) + fitted_harmonic_function = HarmonicOscillator(amplitude, angular_frequency, phase) + + print "amplitude = ", amplitude + print "angular frequency = ", angular_frequency + print "phase = ", phase + + f = angular_frequency/ (2* math.pi) + print "frequency = ", f + + resolution = 4.00 # 1.00 + fit_y = [] + for x in frange(start,end,resolution, True): + fit_y.append(fitted_harmonic_function.value(x)) + fit_x = frange(start, end+resolution, resolution) + + p = plot(ydata,"data", xdata, title="HFit")[0] + p.addSeries(LinePlotSeries("fit")) + p.getSeries(1).setData(fit_x, fit_y) + + #m = (phase + math.pi)/ angular_frequency + m = -phase / angular_frequency + if (m timeout/1000: + raise Exception("Timeout waiting for camera server background: " + str(background)) + time.sleep(0.01) + +################################################################################################### +# Camera scans +################################################################################################### + +def setup_camera_scan(): + global camera_name, bpm_name, number_images, use_background, multiple_background, number_backgrounds, dry_run + if not is_laser_on(1) and not is_laser_on(2): + raise Exception("Both bunches are on delay") + save_laser_state() + multiple_background = multiple_background and use_background + cam_server.start(camera_name + "_sp", use_screen_panel_stream) + if use_background: + if not dry_run: + laser_off() + bg=cam_server.captureBackground(1 if multiple_background else number_backgrounds) + cam_server.setBackgroundSubtraction(True) + if not multiple_background: wait_cam_server_background(bg) + else: + cam_server.setBackgroundSubtraction(False) + + if not multiple_background: + if not dry_run: + restore_laser_state() + +def before_sample_camera_scan(): + global camera_name, number_images, use_background, multiple_background, number_backgrounds, dry_run + if multiple_background: + bg = cam_server.captureBackground(number_backgrounds) + wait_cam_server_background(bg) + if not dry_run: + #laser_on() + restore_laser_state() + wait_cam_server_message(number_images) + +def after_sample_camera_scan(): + if multiple_background: + if not dry_run: + laser_off() + +def get_camera_scan_sensors(): + global camera_name, number_images, use_background, multiple_background, number_backgrounds, dry_run + sensors = get_cam_server_stats(number_images, good_region=use_good_region) + if plot_image: + sensors.append(cam_server.getDataMatrix()) + return sensors + +def end_camera_scan(): + global camera_name, number_images, use_background, multiple_background, number_backgrounds, dry_run + if not dry_run: + restore_laser_state() + + + + + diff --git a/script/templates/lscan_scalar_camera.py b/script/templates/lscan_scalar_camera.py new file mode 100755 index 0000000..242619d --- /dev/null +++ b/script/templates/lscan_scalar_camera.py @@ -0,0 +1,25 @@ + +CAMERA_NAME = "SAROP31-PPRM113" +cam_server.start(CAMERA_NAME+"_sp1", True) # Connect to pipeline of running instance +#Wait first stream message +cam_server.stream.waitCacheChange(3000) + +#Getting child devices +intensity = cam_server.stream.getChild("gr_intensity") + +#image = cam_server.stream.getChild("image") +image=cam_server.getDataMatrix() +sensors = [image,intensity, pulse_energy] + +intensity = create_averager(intensity, 3, interval = -1, monitored = True) +sensors = [image,intensity, intensity.samples, pulse_energy] +lscan(slit_oh_h, sensors, -2.0, 2.0, 0.1, relative=True, latency=0.2, line_plots=[intensity.samples]) + +#s=DummyPositioner("Sample") +#ascan((slit_oh_h, s) , sensors, (-2.0, -1.0) , (2.0, 1.0) , (0.1, 1.0), relative=True, latency=0.2, line_plots=[intensity, pulse_energy]) + + +#Fitting example +#y=[x.doubleValue() for x in r[intensity]] +#fit(y, r[slit_oh_h]) + diff --git a/script/test.scan b/script/test.scan new file mode 100755 index 0000000..3f2da74 --- /dev/null +++ b/script/test.scan @@ -0,0 +1 @@ +[ "Linear", [ [ "Channel", "SAROP31-OAPU107:MOTOR_W.VAL", 2.0, 2.1, 0.01 ] ], [ [ "Channel", "SAROP31-PBPS149:INTENSITY", 10, 0.1, "Enabled" ] ], false, [ ], "Test", 1, 1.0, 0.0, false, false, true, true, "test_label", "", "Table", "csv", 0, null, null, "Positioner", false, true ] \ No newline at end of file diff --git a/script/test/test_bsread_camera.py b/script/test/test_bsread_camera.py new file mode 100755 index 0000000..c15f240 --- /dev/null +++ b/script/test/test_bsread_camera.py @@ -0,0 +1,19 @@ +#CAMERA = "SAROP31-PPRM113" +#CAMERA = "SAROP31-PPRM150" +CAMERA = "SARES30-CAMS156-XE" + + +CAMERA_URL = caget(CAMERA + ":BSREADCONFIG").replace("tcp://daq", "tcp://") +#CAMERA_URL= "tcp://sf-sioc-cs-83:9020" +#CAMERA_URL= "tcp://sf-sioc-cs-64:9000" + +print CAMERA_URL +st1 = Stream("st1", CAMERA_URL, SocketType.PULL) +st1.initialize() +st1.start() +st1.waitCacheChange(3000) +try: + r=bscan (st1, records=5, timeout=10.0, save=False, enabled_plots=[st1,]) + v= st1.getValues() +finally: + st1.close() diff --git a/script/test/test_camserver.py b/script/test/test_camserver.py new file mode 100755 index 0000000..1bc69ae --- /dev/null +++ b/script/test/test_camserver.py @@ -0,0 +1,42 @@ +CAMERA_NAME = "SARES30-CAMS156-XE" +USE_SCREEN_PANEL = True +SAVE = True + +#Camera setup +if USE_SCREEN_PANEL: + cam_server.start(CAMERA_NAME+"_sp1", True) # Connect to pipeline of running instance +else: + cam_server.start(CAMERA_NAME+"_sp") # Create new pipeline given the config namoe + + +#Changing pipeline parameters +cam_server.setThreshold(500) +cam_server.setBackgroundSubtraction(False) + +#Wait first stream message +cam_server.stream.waitCacheChange(3000) + +#Inspecting stream values +names=[] +data=[] +for k,v in cam_server.value.items(): + names.append(k) + data.append(v) + #print k,v +#plot(data, names, title="Data") + + +#Scanning all bsread stream elements +#bscan (cam_server.stream, 10, save=SAVE) + + +#Getting child devices +com = cam_server.stream.getChild("x_center_of_mass") +rms = cam_server.stream.getChild("x_rms") + +#com=create_averager(com, 3, interval = -1, monitored = True) +#rms=create_averager(rms, 3, interval = -1, monitored = True) + +mscan(com, [com,rms], points = -1, timeout = 5.0, save=SAVE) + +