From fa45b06291a6748deffd17812f8380eb57429d43 Mon Sep 17 00:00:00 2001 From: Emanuele Laface <emanuele.laface@esss.se> Date: Fri, 14 Jun 2019 14:55:08 +0200 Subject: [PATCH] Fix region of interest Doppler --- PythonServer/pos-python-server.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/PythonServer/pos-python-server.py b/PythonServer/pos-python-server.py index fcdba3b..fdd0ed6 100755 --- a/PythonServer/pos-python-server.py +++ b/PythonServer/pos-python-server.py @@ -153,8 +153,9 @@ class epicsQuery(Thread): instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData']=epics.PV('LEBT-010:PBI-Dpl-001:IMG1-ArrayData', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:FIT1-Y_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-Y_RBV', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:SPECT-MinWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MinWavelength', auto_monitor=True) - instruments['LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:ROI1-MinX']=epics.PV('LEBT-010:PBI-Dpl-001:ROI1-MinX', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:ROI1-SizeX']=epics.PV('LEBT-010:PBI-Dpl-001:ROI1-SizeX', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:FIT1-FracProton']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracProton', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH2']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH2', auto_monitor=True) instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH3']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH3', auto_monitor=True) @@ -361,11 +362,13 @@ class epicsQuery(Thread): try: if instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].connected: - imarray = tile(instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].value, (256,1)) + start_image = instruments['LEBT-010:PBI-Dpl-001:ROI1-MinX'].value + end_image = start_image + instruments['LEBT-010:PBI-Dpl-001:ROI1-SizeX'].value + imarray = tile(instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].value[start_image:end_image], (256,1)) else: - imarray = zeros((256,1024)) + imarray = zeros((256,512)) except: - imarray = zeros((256,1024)) + imarray = zeros((256,512)) plt.imsave('/var/www/data/tmp-dpl.png', imarray, cmap='hot') os.rename('/var/www/data/tmp-dpl.png', '/var/www/data/dpl.png') @@ -375,10 +378,6 @@ class epicsQuery(Thread): instruments_return_dict[pv]['value']=list(zip(x_data,y_data)) continue -# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracProton']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracProton', auto_monitor=True) -# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH2']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH2', auto_monitor=True) -# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH3']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH3', auto_monitor=True) - if instruments[pv].count>1 or instruments[pv].count==0: continue try: -- GitLab