Creation
This commit is contained in:
60
config/config.properties
Executable file
60
config/config.properties
Executable file
@@ -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
|
||||||
11
config/devices.properties
Executable file
11
config/devices.properties
Executable file
@@ -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
|
||||||
12
config/jcae.properties
Executable file
12
config/jcae.properties
Executable file
@@ -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
|
||||||
9
config/mail.properties
Executable file
9
config/mail.properties
Executable file
@@ -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=
|
||||||
119
config/preferences.json
Executable file
119
config/preferences.json
Executable file
@@ -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"
|
||||||
|
}
|
||||||
25
config/setup.properties
Executable file
25
config/setup.properties
Executable file
@@ -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
|
||||||
4
config/variables.properties
Executable file
4
config/variables.properties
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#Thu Oct 30 14:09:10 CET 2025
|
||||||
|
LastRunDate=251030
|
||||||
|
DaySequentialNumber=4
|
||||||
|
FileSequentialNumber=400
|
||||||
25
devices/CamServer.properties
Executable file
25
devices/CamServer.properties
Executable file
@@ -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
|
||||||
25
devices/Camera Server.properties
Executable file
25
devices/Camera Server.properties
Executable file
@@ -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
|
||||||
25
devices/CameraServer.properties
Executable file
25
devices/CameraServer.properties
Executable file
@@ -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
|
||||||
29
devices/CurrentCamera.properties
Executable file
29
devices/CurrentCamera.properties
Executable file
@@ -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
|
||||||
10
devices/Sample.properties
Executable file
10
devices/Sample.properties
Executable file
@@ -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
|
||||||
11
devices/Time.properties
Executable file
11
devices/Time.properties
Executable file
@@ -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
|
||||||
25
devices/cam_server.properties
Executable file
25
devices/cam_server.properties
Executable file
@@ -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
|
||||||
10
devices/charge.properties
Executable file
10
devices/charge.properties
Executable file
@@ -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
|
||||||
14
devices/dispatcher.properties
Executable file
14
devices/dispatcher.properties
Executable file
@@ -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
|
||||||
10
devices/energy_AR.properties
Executable file
10
devices/energy_AR.properties
Executable file
@@ -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
|
||||||
9
devices/rep_rate.properties
Executable file
9
devices/rep_rate.properties
Executable file
@@ -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
|
||||||
10
devices/rep_rate_bunch_1.properties
Executable file
10
devices/rep_rate_bunch_1.properties
Executable file
@@ -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
|
||||||
10
devices/rep_rate_bunch_2.properties
Executable file
10
devices/rep_rate_bunch_2.properties
Executable file
@@ -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
|
||||||
11
devices/sim_positioner.properties
Executable file
11
devices/sim_positioner.properties
Executable file
@@ -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
|
||||||
19
devices/slit_oh_h.properties
Executable file
19
devices/slit_oh_h.properties
Executable file
@@ -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
|
||||||
1
script/Bernina_DCM.scan
Executable file
1
script/Bernina_DCM.scan
Executable file
@@ -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 ]
|
||||||
1
script/Bernina_DCM.scan_a
Executable file
1
script/Bernina_DCM.scan_a
Executable file
@@ -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 ]
|
||||||
1
script/Bernina_DCM_PPRM102.scan
Executable file
1
script/Bernina_DCM_PPRM102.scan
Executable file
@@ -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 ]
|
||||||
1
script/Bernina_DCM_PPRM113.scan
Executable file
1
script/Bernina_DCM_PPRM113.scan
Executable file
@@ -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 ]
|
||||||
1
script/Bernina_DCM_a.scan
Executable file
1
script/Bernina_DCM_a.scan
Executable file
@@ -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 ]
|
||||||
1
script/Bernina_DCM_b.scan
Executable file
1
script/Bernina_DCM_b.scan
Executable file
@@ -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 ]
|
||||||
1
script/IFC_trigger_scan.scan
Executable file
1
script/IFC_trigger_scan.scan
Executable file
@@ -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 ]
|
||||||
1
script/OAPU107_X.scan
Executable file
1
script/OAPU107_X.scan
Executable file
@@ -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 ]
|
||||||
1
script/OAPU107_Y.scan
Executable file
1
script/OAPU107_Y.scan
Executable file
@@ -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 ]
|
||||||
1
script/OAPU149_X-scan_PPRM150.scan
Executable file
1
script/OAPU149_X-scan_PPRM150.scan
Executable file
@@ -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 ]
|
||||||
1
script/OAPU149_Y-scan_PPRM150.scan
Executable file
1
script/OAPU149_Y-scan_PPRM150.scan
Executable file
@@ -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 ]
|
||||||
1
script/ODCC110_E.scan
Executable file
1
script/ODCC110_E.scan
Executable file
@@ -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 ]
|
||||||
1
script/ODCC110_Eoffset.scan
Executable file
1
script/ODCC110_Eoffset.scan
Executable file
@@ -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 ]
|
||||||
1
script/ODCC110_RX2.scan
Executable file
1
script/ODCC110_RX2.scan
Executable file
@@ -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 ]
|
||||||
1
script/PBPS113_X_calibration.scan
Executable file
1
script/PBPS113_X_calibration.scan
Executable file
@@ -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 ]
|
||||||
1
script/PBPS149_X_calibration.scan
Executable file
1
script/PBPS149_X_calibration.scan
Executable file
@@ -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 ]
|
||||||
1
script/Sample_F-Trans_Y.scan
Executable file
1
script/Sample_F-Trans_Y.scan
Executable file
@@ -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 ]
|
||||||
1
script/SwissMX_EdgeScan.scan
Executable file
1
script/SwissMX_EdgeScan.scan
Executable file
@@ -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 ]
|
||||||
1
script/example.scan
Executable file
1
script/example.scan
Executable file
@@ -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 ]
|
||||||
3
script/local.groovy
Executable file
3
script/local.groovy
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Deployment specific global definitions - executed after startup.groovy
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
4
script/local.js
Executable file
4
script/local.js
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Deployment specific global definitions - executed after startup.js
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
369
script/local.py
Executable file
369
script/local.py
Executable file
@@ -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<start):
|
||||||
|
m+=(1.0/f)
|
||||||
|
|
||||||
|
if start <=m <=end:
|
||||||
|
print "fit = ", m
|
||||||
|
p.addMarker(m, None, "Fit="+str(round(m ,2)), Color.MAGENTA.darker())
|
||||||
|
return (amplitude, angular_frequency, phase, True, m, fit_x, fit_y)
|
||||||
|
else:
|
||||||
|
print "max = ",max_x
|
||||||
|
p.addMarker(max_x, None, "Max="+str(round(max_x ,2)), Color.MAGENTA.darker())
|
||||||
|
return (amplitude, angular_frequency, phase, False, max_x, fit_x, fit_y)
|
||||||
|
|
||||||
|
|
||||||
|
def clear_convex_hull_plot(title):
|
||||||
|
plots = get_plots(title = title)
|
||||||
|
if len(plots)>0:
|
||||||
|
plots[0].clear()
|
||||||
|
|
||||||
|
def add_convex_hull_plot(title, x,y, name=None, clear = False, x_range = None, y_range = None):
|
||||||
|
plots = get_plots(title = title)
|
||||||
|
p = None
|
||||||
|
if len(plots)==0:
|
||||||
|
p = plot(None,name=name, title = title)[0]
|
||||||
|
if x_range is not None:
|
||||||
|
p.getAxis(p.AxisId.X).setRange(x_range[0], x_range[1])
|
||||||
|
if y_range is not None:
|
||||||
|
p.getAxis(p.AxisId.Y).setRange(y_range[0], y_range[1])
|
||||||
|
p.setLegendVisible(True)
|
||||||
|
else:
|
||||||
|
p = plots[0]
|
||||||
|
if clear:
|
||||||
|
p.clear()
|
||||||
|
p.addSeries(LinePlotSeries(name))
|
||||||
|
s = p.getSeries(name)
|
||||||
|
s.setLinesVisible(False)
|
||||||
|
s.setPointSize(3)
|
||||||
|
x, y = to_array(x,'d') , to_array(y,'d')
|
||||||
|
s.setData(x, y)
|
||||||
|
|
||||||
|
#Convex Hull
|
||||||
|
#In the first time the plot shows, it takes some time for the color to be assigned
|
||||||
|
timeout = 0
|
||||||
|
while s.color is None and timeout<1000:
|
||||||
|
time.sleep(0.001)
|
||||||
|
timeout = timeout + 1
|
||||||
|
hull = LinePlotSeries(name + "Hull", s.color)
|
||||||
|
p.addSeries(hull)
|
||||||
|
#Bounding box
|
||||||
|
#x1,x2,y1,y2 = min(x), max(x), min(y), max(y)
|
||||||
|
#(hx,hy) = ([x1,x2, x2, x1, x1], [y1, y1, y2, y2, y1])
|
||||||
|
(hx,hy) = convex_hull(x=x, y=y)
|
||||||
|
hx.append(hx[0]); hy.append(hy[0])
|
||||||
|
hull.setLineWidth(2)
|
||||||
|
hull.setData(to_array(hx,'d') , to_array(hy,'d'))
|
||||||
|
hull.setColor(s.color)
|
||||||
|
return [hx,hy]
|
||||||
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
# Tools
|
||||||
|
###################################################################################################
|
||||||
|
|
||||||
|
def elog(title, message, attachments = [], application = None, author = None, category = "Info", domain = "", logbook = "SwissFEL commissioning data", encoding=1):
|
||||||
|
"""
|
||||||
|
Add entry to ELOG.
|
||||||
|
"""
|
||||||
|
if author is None:
|
||||||
|
author = "pshell" #get_context().user.name
|
||||||
|
|
||||||
|
if application is None:
|
||||||
|
application = get_exec_pars().name
|
||||||
|
|
||||||
|
typ = "pshell"
|
||||||
|
entry = ""
|
||||||
|
|
||||||
|
cmd = 'G_CS_ELOG_add -l "' + logbook + '" '
|
||||||
|
cmd = cmd + '-a "Author=' + author + '" '
|
||||||
|
cmd = cmd + '-a "Type=' + typ + '" '
|
||||||
|
cmd = cmd + '-a "Entry=' + entry + '" '
|
||||||
|
cmd = cmd + '-a "Title=' + title + '" '
|
||||||
|
cmd = cmd + '-a "Category=' + category + '" '
|
||||||
|
cmd = cmd + '-a "Domain=' + domain + '" '
|
||||||
|
cmd = cmd + '-a "Application=' + application + '" '
|
||||||
|
for attachment in attachments:
|
||||||
|
cmd = cmd + '-f "' + attachment + '" '
|
||||||
|
cmd = cmd + '-n ' + str(encoding)
|
||||||
|
cmd = cmd + ' "' + message + '"'
|
||||||
|
#print cmd
|
||||||
|
#os.system (cmd)
|
||||||
|
#print os.popen(cmd).read()
|
||||||
|
import subprocess
|
||||||
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
|
||||||
|
(out, err) = proc.communicate()
|
||||||
|
if (err is not None) and err!="":
|
||||||
|
raise Exception(err)
|
||||||
|
print out
|
||||||
|
import ch.psi.pshell.ui.App as App
|
||||||
|
if not App.isOutputRedirected():
|
||||||
|
import java.lang.System as System
|
||||||
|
System.out.println(out)
|
||||||
|
try:
|
||||||
|
return int(out[out.find("ID=") +3 : ])
|
||||||
|
except:
|
||||||
|
print out
|
||||||
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
# Pseudo-devices
|
||||||
|
###################################################################################################
|
||||||
|
class Sinusoid(ReadonlyRegisterBase):
|
||||||
|
def doRead(self):
|
||||||
|
self.x = self.x + 5.0 if hasattr(self, 'x') else 0.0
|
||||||
|
return math.sin(self.x * math.pi / 180.0)
|
||||||
|
|
||||||
|
add_device(Sinusoid("sim_sensor"), True)
|
||||||
|
sim_sensor.polling=1000
|
||||||
|
add_device(DummyPositioner("sim_positioner"), True)
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
# Camera server
|
||||||
|
###################################################################################################
|
||||||
|
def wait_cam_server_message(number_messages = 1, timeout = 10000):
|
||||||
|
for i in range (number_messages):
|
||||||
|
if not cam_server.stream.waitCacheChange(timeout):
|
||||||
|
raise Exception("Timeout receiving from camera server")
|
||||||
|
|
||||||
|
def get_cam_server_stats(number_images=1, async = True, interval=-1, good_region = False):
|
||||||
|
ret = []
|
||||||
|
wait_cam_server_message()
|
||||||
|
prefix = "gr_" if good_region else ""
|
||||||
|
for ident in [prefix+"x_center_of_mass", prefix+"y_center_of_mass", prefix+"x_rms", prefix+"y_rms"]:
|
||||||
|
child = cam_server.stream.getChild(ident)
|
||||||
|
av = create_averager(child, number_images, interval)
|
||||||
|
av.monitored = async
|
||||||
|
ret.append(av)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def wait_cam_server_background(background, timeout = 10000):
|
||||||
|
start = time.time()
|
||||||
|
while True:
|
||||||
|
processing_parameters = cam_server.getProcessingParameters()
|
||||||
|
if (processing_parameters is not None) and (str(background) == processing_parameters["image_background"]):
|
||||||
|
return
|
||||||
|
if (time.time()-start) > 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()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
25
script/templates/lscan_scalar_camera.py
Executable file
25
script/templates/lscan_scalar_camera.py
Executable file
@@ -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])
|
||||||
|
|
||||||
1
script/test.scan
Executable file
1
script/test.scan
Executable file
@@ -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 ]
|
||||||
19
script/test/test_bsread_camera.py
Executable file
19
script/test/test_bsread_camera.py
Executable file
@@ -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()
|
||||||
42
script/test/test_camserver.py
Executable file
42
script/test/test_camserver.py
Executable file
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user