diff --git a/PythonServer/pos-python-server.py b/PythonServer/pos-python-server.py index fcdba3b3c77723e5ac41888c8da5f679b62500bf..fdd0ed66dd5e28ded8f597cd3033e84cfb1c65c6 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: