From 8aec3a522ad5ab8616e3aae9c1308c9379b5d925 Mon Sep 17 00:00:00 2001 From: Emanuele Laface <emanuele.laface@esss.se> Date: Thu, 13 Jun 2019 17:13:47 +0200 Subject: [PATCH] Working to add the Doppler --- PythonServer/pos-python-server.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/PythonServer/pos-python-server.py b/PythonServer/pos-python-server.py index 865f27c..186c74b 100755 --- a/PythonServer/pos-python-server.py +++ b/PythonServer/pos-python-server.py @@ -7,7 +7,7 @@ import matplotlib.pyplot as plt from git import Repo from shutil import rmtree from glob import glob -from numpy import linspace, array, zeros, flip, rot90 +from numpy import linspace, array, zeros, flip, rot90, tile from http.server import BaseHTTPRequestHandler,HTTPServer from epicsarchiver import ArchiverAppliance from threading import Thread, Event @@ -150,6 +150,15 @@ class epicsQuery(Thread): instruments['LNS-ISRC-010:PBI-EMH:BUFF-CURRENT']=epics.PV('LNS-ISRC-010:PBI-EMH:BUFF-CURRENT', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMH:MTR.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMH:MTR.NPTS', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMH:PS.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMH:PS.NPTS', auto_monitor=True) + 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: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) + print('Done') while(not self.stop_signal.isSet()): publicpvs_return_dict={} @@ -349,6 +358,25 @@ class epicsQuery(Thread): instruments_return_dict[pv]['units']='n.c.' instruments_return_dict[pv]['value']='' continue + + try: + if instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].connected: + imarray = tile(instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].value, (256,1)) + else: + imarray = zeros((256,1024)) + except: + imarray = zeros((256,1024)) + plt.imsave('/var/www/data/tmp-dpl.png', imarray, cmap='hot') + os.rename('/var/www/data/tmp-dpl.png', '/var/www/data/dpl.png') + +# 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: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