From f8ad14212bd9fc6d2474a5bdee7184c9fdce74fb Mon Sep 17 00:00:00 2001 From: gac-x11ma Date: Mon, 4 Nov 2019 17:05:22 +0100 Subject: [PATCH] --- config/config.properties | 60 ++++++++++++++--------------- config/devices.properties | 28 +++++++------- config/plugins.properties | 7 +++- config/variables.properties | 2 + devices/image.properties | 25 ++++++++++++ devices/m1.properties | 20 +++++----- devices/m2.properties | 20 +++++----- devices/p1.properties | 15 ++++---- devices/src1.properties | 47 ++++++++++++----------- devices/src2.properties | 47 ++++++++++++----------- script/devices/eiger.py | 76 +++++++++++++++++++++++++++++++++++++ 11 files changed, 231 insertions(+), 116 deletions(-) create mode 100644 config/variables.properties create mode 100644 devices/image.properties create mode 100644 script/devices/eiger.py diff --git a/config/config.properties b/config/config.properties index 4d42be3..ad2f378 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,38 +1,38 @@ -#Wed May 15 13:48:57 CEST 2019 -autoSaveScanData=true -commandExecutionEvents=false -createSessionFiles=false -dataLayout=ch.psi.fda.LayoutFDA -dataPath={data}/{year}_{month}/{date} -dataProvider=ch.psi.fda.ProviderFDA -dataScanFlushRecords=true -dataScanPreserveTypes=false -dataScanReleaseRecords=false -dataServerPort=-1 -depthDimension=0 -devicePoolFile={config}/devices.properties -deviceUpdateStrategyFile={config}/update.properties -hideServerMessages=false -hostName=null +#Mon Nov 04 17:04:36 CET 2019 imageSourcesFile={config}/imaging.properties -instanceName= -logDaysToLive=-1 -logLevel=Info +autoSaveScanData=true +simulation=false +commandExecutionEvents=false +logDaysToLive=30 +userAuthenticator= logLevelConsole=Off -logPath={logs}/{date}_{time} -notificationLevel=null -saveCommandStatistics=false scanStreamerPort=-1 scanStreamingPort=-1 -serverEnabled=false -serverPort=8080 -simulation=false -tasksFile={config}/tasks.properties -terminalEnabled=false -terminalPort=3579 -userAuthenticator= +devicePoolFile={config}/devices.properties +versionTrackingManual=true +hostName=null userManagement=true +instanceName=SIM +dataServerPort=-1 +hideServerMessages=false +serverPort=8080 versionTrackingEnabled=true +dataPath={data}/{year}_{month}/{date} +serverEnabled=false +dataScanReleaseRecords=false +depthDimension=0 +dataScanPreserveTypes=false +logLevel=Info +dataScanFlushRecords=true +logPath={logs}/{date}_{time} +dataLayout=ch.psi.fda.LayoutFDA +deviceUpdateStrategyFile={config}/update.properties +terminalEnabled=false +notificationLevel=null +terminalPort=3579 +tasksFile={config}/tasks.properties +createSessionFiles=false versionTrackingLogin={context}/svcusr-hlapp_robot -versionTrackingManual=false versionTrackingRemote=git@git.psi.ch\:pshell_config/x11ma.git +dataProvider=ch.psi.fda.ProviderFDA +saveCommandStatistics=false diff --git a/config/devices.properties b/config/devices.properties index f7038d2..2126a84 100644 --- a/config/devices.properties +++ b/config/devices.properties @@ -7,22 +7,22 @@ pol_done=ch.psi.pshell.epics.ChannelString|X11MA-ID2:DONE|Read||true energy=ch.psi.pshell.epics.ChannelDouble|X11PHS-E:GO.A||| id_error=ch.psi.pshell.epics.ChannelInteger|X11MA-ID2-PLC:ERROR|||true beam_status=ch.psi.pshell.epics.DiscretePositioner|ACOAU-ACCU:OP-MODE|Read||true -edata=ch.psi.pshell.epics.ChannelDoubleArray|EDATA 3|Read|| -count=ch.psi.pshell.epics.ChannelInteger|COUNT|Read||true -data=ch.psi.pshell.epics.ChannelDoubleArray|DATA 3|Read|| -fdata=ch.psi.pshell.epics.ChannelDoubleArray|FDATA 3|Read|| -idata=ch.psi.pshell.epics.ChannelDoubleArray|IDATA 3|Read|| +#edata=ch.psi.pshell.epics.ChannelDoubleArray|EDATA 3|Read|| +#count=ch.psi.pshell.epics.ChannelInteger|COUNT|Read||true +#data=ch.psi.pshell.epics.ChannelDoubleArray|DATA 3|Read|| +#fdata=ch.psi.pshell.epics.ChannelDoubleArray|FDATA 3|Read|| +#idata=ch.psi.pshell.epics.ChannelDoubleArray|IDATA 3|Read|| Keithley_3_raw=ch.psi.pshell.epics.ChannelDouble|X11MA-KEI12:READOUT|Read||true Keithley_2_raw=ch.psi.pshell.epics.ChannelDouble|X11MA-KEI11:READOUT|Read||true Keithley_1_raw=ch.psi.pshell.epics.ChannelDouble|X11MA-KEI10:READOUT|Read||true -TRX_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRX.RBV|Read||true -THT_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:THT.RBV|Read||true -TRY_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRY.RBV|Read||true -TRZ_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRZ.RBV|Read||true -TRX=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRX|||true -TRY=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRY|||true -THT=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:THT.RBV|||true -TRZ=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRZ|||true +#TRX_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRX.RBV|Read||true +#THT_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:THT.RBV|Read||true +#TRY_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRY.RBV|Read||true +#TRZ_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRZ.RBV|Read||true +#TRX=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRX|||true +#TRY=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRY|||true +#THT=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:THT.RBV|||true +#TRZ=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRZ|||true Temp=ch.psi.pshell.epics.ChannelDouble|X11MA-ES3-LSCI:TEMP_RBV|Read||true #FE=ch.psi.pshell.epics.Slit|X11MA-FE:DSAPER|Read||true ES=ch.psi.pshell.epics.ChannelDouble|X11MA-OP2-SL:TRY.RBV|Read||true @@ -44,3 +44,5 @@ 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-ES3-SD1|||true +image=ch.psi.pshell.imaging.CameraSource|eiger|||true diff --git a/config/plugins.properties b/config/plugins.properties index 3387ac6..8886162 100644 --- a/config/plugins.properties +++ b/config/plugins.properties @@ -1,4 +1,7 @@ +OTFScanBase.java=disabled +EnergyScanBase.java=disabled +DelayScanBase.java=disabled EnergyScan_TBT.java=disabled -DelayScan.java=enabled -EnergyScan.java=enabled +DelayScan.java=disabled +EnergyScan.java=disabled Test.java=disabled diff --git a/config/variables.properties b/config/variables.properties new file mode 100644 index 0000000..f64d467 --- /dev/null +++ b/config/variables.properties @@ -0,0 +1,2 @@ +#Thu Oct 31 11:14:59 CET 2019 +FileSequentialNumber=10 diff --git a/devices/image.properties b/devices/image.properties new file mode 100644 index 0000000..01c1cfb --- /dev/null +++ b/devices/image.properties @@ -0,0 +1,25 @@ +#Thu Oct 31 10:40:48 CET 2019 +colormapLogarithmic=false +spatialCalScaleX=NaN +spatialCalScaleY=NaN +rescaleOffset=0.0 +roiWidth=-1 +colormap=Grayscale +invert=false +colormapMin=NaN +rotationCrop=false +roiHeight=-1 +colormapAutomatic=true +roiY=0 +roiX=0 +spatialCalOffsetY=NaN +spatialCalOffsetX=NaN +scale=1.0 +grayscale=false +colormapMax=NaN +rotation=0.0 +rescaleFactor=1.0 +spatialCalUnits=null +flipVertically=false +flipHorizontally=false +transpose=false diff --git a/devices/m1.properties b/devices/m1.properties index 880b2ee..bd86c60 100644 --- a/devices/m1.properties +++ b/devices/m1.properties @@ -1,15 +1,17 @@ -#Fri Dec 15 14:09:52 CET 2017 -accessType=ReadWrite -defaultSpeed=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -maxValue=10.0 -minSpeed=0.1 -minValue=-10.0 +#Tue Oct 29 14:00:16 CET 2019 offset=0.0 +maxValue=10.0 precision=2 -resolution=NaN rotation=false scale=1.0 +estbilizationDelay=0 +maxSpeed=10.0 +resolution=NaN +accessType=ReadWrite startRetries=1 +minValue=-10.0 unit=mm +defaultSpeed=1.0 +sign_bit=0 +monitorByPosition=false +minSpeed=0.1 diff --git a/devices/m2.properties b/devices/m2.properties index 880b2ee..bd86c60 100644 --- a/devices/m2.properties +++ b/devices/m2.properties @@ -1,15 +1,17 @@ -#Fri Dec 15 14:09:52 CET 2017 -accessType=ReadWrite -defaultSpeed=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -maxValue=10.0 -minSpeed=0.1 -minValue=-10.0 +#Tue Oct 29 14:00:16 CET 2019 offset=0.0 +maxValue=10.0 precision=2 -resolution=NaN rotation=false scale=1.0 +estbilizationDelay=0 +maxSpeed=10.0 +resolution=NaN +accessType=ReadWrite startRetries=1 +minValue=-10.0 unit=mm +defaultSpeed=1.0 +sign_bit=0 +monitorByPosition=false +minSpeed=0.1 diff --git a/devices/p1.properties b/devices/p1.properties index 478de52..9da4f16 100644 --- a/devices/p1.properties +++ b/devices/p1.properties @@ -1,9 +1,10 @@ -#Fri Dec 15 14:09:53 CET 2017 -maxValue=1000.0 +#Tue Oct 29 14:00:16 CET 2019 minValue=0.0 -offset=0.0 -precision=-1 -resolution=NaN -rotation=false -scale=1.0 unit=mm +offset=0.0 +maxValue=1000.0 +precision=-1 +rotation=false +sign_bit=0 +scale=1.0 +resolution=NaN diff --git a/devices/src1.properties b/devices/src1.properties index ae16d34..c0f4f3e 100644 --- a/devices/src1.properties +++ b/devices/src1.properties @@ -1,28 +1,29 @@ -#Fri Feb 03 16:28:10 CET 2017 -colormap=Temperature -colormapAutomatic=true -colormapMax=255.0 -colormapMin=0.0 -dataMonitoring=false -dataPolling=100 -flipHorizontally=false -flipVertically=false -grayscale=false -invert=false -pollingBackground=false -pollingInterval=0 -rescaleFactor=1.0 -rescaleOffset=0.0 -roiHeight=-1 -roiWidth=-1 -roiX=0 -roiY=0 -rotation=0.0 -rotationCrop=false -scale=1.0 -spatialCalOffsetX=NaN +#Tue Oct 29 14:00:16 CET 2019 spatialCalOffsetY=NaN +spatialCalOffsetX=NaN +dataPolling=100 +pollingInterval=0 +colormapLogarithmic=false +scale=1.0 +grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN +colormapMax=255.0 +rescaleOffset=0.0 +roiWidth=-1 +colormap=Temperature +pollingBackground=false +invert=false +colormapMin=0.0 +rotation=0.0 +rotationCrop=false +rescaleFactor=1.0 spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=true +dataMonitoring=false +roiY=0 +roiX=0 transpose=false diff --git a/devices/src2.properties b/devices/src2.properties index 6e407e1..c812fa6 100644 --- a/devices/src2.properties +++ b/devices/src2.properties @@ -1,28 +1,29 @@ -#Fri Feb 03 16:28:10 CET 2017 -colormap=Grayscale -colormapAutomatic=true -colormapMax=255.0 -colormapMin=0.0 -dataMonitoring=false -dataPolling=100 -flipHorizontally=false -flipVertically=false -grayscale=false -invert=false -pollingBackground=false -pollingInterval=0 -rescaleFactor=1.0 -rescaleOffset=0.0 -roiHeight=-1 -roiWidth=-1 -roiX=0 -roiY=0 -rotation=0.0 -rotationCrop=false -scale=1.0 -spatialCalOffsetX=NaN +#Tue Oct 29 14:00:16 CET 2019 spatialCalOffsetY=NaN +spatialCalOffsetX=NaN +dataPolling=100 +pollingInterval=0 +colormapLogarithmic=false +scale=1.0 +grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN +colormapMax=255.0 +rescaleOffset=0.0 +roiWidth=-1 +colormap=Grayscale +pollingBackground=false +invert=false +colormapMin=0.0 +rotation=0.0 +rotationCrop=false +rescaleFactor=1.0 spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=true +dataMonitoring=false +roiY=0 +roiX=0 transpose=false diff --git a/script/devices/eiger.py b/script/devices/eiger.py new file mode 100644 index 0000000..80f2166 --- /dev/null +++ b/script/devices/eiger.py @@ -0,0 +1,76 @@ +from ijutils import * +from ch.psi.pshell.imaging.Overlays import * +from ch.psi.pshell.imaging.Utils import * +import ch.psi.pshell.imaging.Pen as Pen +import java.awt.Rectangle as Rectangle +import ch.psi.pshell.imaging.Data as Data + + +############################################################################### +# ROI Integration +############################################################################### + +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) + + + +class RoiIntensity(ReadonlyRegisterBase): + def __init__(self, name, source, x,y, w, h): + ReadonlyRegisterBase.__init__(self, name) + self.source=source + self.roi = x,y, w, h + + def doRead(self): + x,y, w, h = self.roi + return integrate_roi(self.source, x,y, w, h) + +############################################################################### +# Frame integration +############################################################################### + +def get_image(source, roi=None, wait_next=False): + if wait_next: + source.waitNext(-1) + ret = load_image(Utils.grayscale(source.output, Rectangle(roi[0], roi[1], roi[2], roi[3]) if (roi is not None) else None)) + return ret + +def grab_frames(source, samples, roi=None, wait_next=False, sleep=0): + frames = [] + for i in range(samples): + if sleep>0: + time.sleep(sleep) + aux = get_image(source, roi, wait_next) + frames.append(aux) + return frames + +def average_frames(source, samples=1, roi=None, wait_next=False, sleep=0, as_float=True): + return average_ips(grab_frames(source, samples, roi, wait_next, sleep), as_float) + +def integrate_frames(source, samples=1, roi=None, wait_next=False, sleep=0, as_float=True): + return integrate_ips(grab_frames(source, samples, roi, wait_next, sleep), as_float) + + + +print integrate_roi(image, 10, 5, 20, 10) + +add_device(RoiIntensity("Region1", image, 10, 5, 20, 10), True) +add_device(RoiIntensity("Region2", image, 10, 5, 40, 20), True) + + +import ch.psi.pshell.data.ProviderCSV as ProviderCSV +ProviderCSV.setDefaultItemSeparator(" ") +tscan((Region1, Region2), 10, 0.1, layout="table", provider = "csv") + +ret = grab_frames(image, 10, sleep=0.1) +av = average_ips(ret, None, True) +data = get_ip_array(av) +plot(data) +save_image(av, "{images}/float.tif","tiff") + +av = average_ips(ret, None, False) +save_image(av, "{images}/int.tif","tiff") +