towards cta
This commit is contained in:
32
Readme.md
32
Readme.md
@@ -9,8 +9,13 @@ https://docs.google.com/document/d/1yEmV_DbRBKQKVCoovjXriNgSjNEBaz50WA0l3yA5jtg/
|
||||
* push local stuff to git *
|
||||
***************************
|
||||
zamofing_t@ganymede:
|
||||
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX && git commit-amend && git push psigithub
|
||||
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX && git commit-amend && git push psigithub
|
||||
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX &&\
|
||||
git commit-amend &&\
|
||||
git push psigithub
|
||||
|
||||
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX &&\
|
||||
git commit-amend &&\
|
||||
git push psigithub
|
||||
|
||||
*************************************
|
||||
* switch to latest test environment *
|
||||
@@ -23,20 +28,21 @@ ssh zamofing_t@saresc-cons-03
|
||||
#cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
||||
#git remote add psigithub git@git.psi.ch:zamofing_t/SwissMX.git
|
||||
|
||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
||||
git checkout master
|
||||
git stash push
|
||||
#git pull psigithub --ff-only master
|
||||
git reset psigithub/master --hard
|
||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX &&\
|
||||
git checkout master &&\
|
||||
git stash push &&\
|
||||
git fetch psigithub master &&\
|
||||
git reset psigithub/master --hard &&\
|
||||
git stash pop
|
||||
#git pull psigithub --ff-only master
|
||||
|
||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
||||
git checkout master
|
||||
git stash push
|
||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX &&\
|
||||
git checkout master &&\
|
||||
git stash push &&\
|
||||
git fetch psigithub master &&\
|
||||
git reset psigithub/master --hard &&\
|
||||
git stash pop && chmod -R g+w *
|
||||
#git pull psigithub --ff-only master
|
||||
git reset psigithub/master --hard
|
||||
git stash pop
|
||||
chmod -R g+w *
|
||||
|
||||
*******************
|
||||
* run application *
|
||||
|
||||
@@ -138,7 +138,7 @@ class AppCfg(QSettings):
|
||||
if AppCfg.DAQ_LOC not in keys:
|
||||
dflt.append((AppCfg.DAQ_LOC, {'end_station':"cristallina", 'p_group':"p20516"}))
|
||||
if AppCfg.DAQ_RUN not in keys:
|
||||
dflt.append((AppCfg.DAQ_RUN, {'prefix':'jf', 'padding':10, 'cell_name' : 'na'}))
|
||||
dflt.append((AppCfg.DAQ_RUN, {'prefix':'jf', 'padding':10, 'cell_name' : 'na', 'block_size':1000,}))
|
||||
#if AppCfg.DAQ_BS_CH not in keys:
|
||||
dflt.append((AppCfg.DAQ_BS_CH, ("SARES30-LSCP1-CRISTA1:CH0:1","SAR-CVME-TIFALL6:EvtSet", "SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG", "SARFE10-PBIG050-EVR0:CALCI", "SARFE10-PBPG050:HAMP-INTENSITY-CAL",
|
||||
"SARFE10-PBPS053:INTENSITY", "SARFE10-PBPS053:XPOS", "SARFE10-PBPS053:YPOS", "SARFE10-PSSS059:SPECTRUM_X", "SARFE10-PSSS059:SPECTRUM_Y", "SARFE10-PSSS059:SPECTRUM_Y_SUM",
|
||||
@@ -434,6 +434,7 @@ verbose bits:
|
||||
{'name':'prefix', 'value':daq_run['prefix'], 'type':'str',},
|
||||
{'name':'padding','value':daq_run['padding'], 'type':'int'},
|
||||
{'name':'cell_name', 'value':daq_run['cell_name'], 'type':'str'},
|
||||
{'name':'block_size', 'value':daq_run['block_size'], 'type':'int'},
|
||||
]},
|
||||
{'name':AppCfg.DAQ_BS_CH, 'title':'list of beam-sync channels','value':' '.join(cfg.value(AppCfg.DAQ_BS_CH)), 'type':'str'},
|
||||
{'name':AppCfg.DAQ_PV_CH, 'title':'list of PV channels','value':' '.join(cfg.value(AppCfg.DAQ_PV_CH)), 'type':'str'},
|
||||
|
||||
@@ -26,6 +26,8 @@ import shapepath
|
||||
|
||||
try:
|
||||
from slic.core.acquisition import SFAcquisition
|
||||
from slic.devices.timing.events import CTASequencer
|
||||
from ctadaq import CTAAcquisition
|
||||
except ImportError as e:
|
||||
_log.warning(e)
|
||||
|
||||
@@ -91,7 +93,7 @@ class Jungfrau:
|
||||
#rsync -vai gac-cristall@saresc-cons-03:/sf/jungfrau/applications/daq_client/daq_client.py .
|
||||
# setup slic parameters
|
||||
if sim:
|
||||
self._daq=None
|
||||
self._sim=True
|
||||
return
|
||||
app=QApplication.instance()
|
||||
cfg=app._cfg
|
||||
@@ -100,18 +102,40 @@ class Jungfrau:
|
||||
pv_channels = cfg.value(AppCfg.DAQ_PV_CH)
|
||||
loc=cfg.value(AppCfg.DAQ_LOC)
|
||||
try:
|
||||
self._daq=SFAcquisition(
|
||||
loc['end_station'], loc['p_group'],
|
||||
default_detectors=detectors, default_channels=bs_channels, default_pvs=pv_channels,
|
||||
rate_multiplicator=1, append_user_tag_to_data_dir=True
|
||||
)
|
||||
self._pv_pulse_id=epics.PV('SAR-EXPMX-EVR0:RX-PULSEID')
|
||||
self._pv_pulse_id.connect()
|
||||
except NameError as e:
|
||||
_log.critical(f'Jungfrau not connected: {e}')
|
||||
|
||||
def config(self,**kwargs):
|
||||
if getattr(self,'_sim',False):
|
||||
_log.info(f'simulated')
|
||||
code_gen=kwargs['code_gen']
|
||||
if code_gen==3:
|
||||
grid_cnt=kwargs['grid']['count']
|
||||
kwargs['grid']['count']
|
||||
self._cta=cta=CTASequencer("SAR-CCTA-ESC")
|
||||
repetitions=grid_cnt[0]
|
||||
cta_multiplier=grid_cnt[1]-1
|
||||
#kwargs['tmove'] kwargs['twait']
|
||||
xray_seq=[0]*kwargs['twait']/kwargs['tmove']+[1] # multiplier is proportional to wait_time i.e. 10 ms = 1, 20 ms =2, 30 ms =3.
|
||||
cta.seq[200]=xray_seq*cta_multiplier # x-ray_shutter
|
||||
cta.seq[215]=[1]*cta_multiplier*2 # laser_shutter
|
||||
cta.cfg.repetitions=repetitions # self._cta.cfg.repetitions = n_pulses_run/cta_multiplier
|
||||
cta.seq.upload()
|
||||
self._daq=CTAAcquisition(cta, loc['end_station'], loc['p_group'], default_detectors=detectors,
|
||||
default_channels=bs_channels,
|
||||
default_pvs=pv_channels, rate_multiplicator=1, append_user_tag_to_data_dir=True)
|
||||
else:
|
||||
self._daq=SFAcquisition(
|
||||
loc['end_station'], loc['p_group'],
|
||||
default_detectors=detectors, default_channels=bs_channels, default_pvs=pv_channels,
|
||||
rate_multiplicator=1, append_user_tag_to_data_dir=True)
|
||||
|
||||
def acquire(self, n_pulses, wait=False):
|
||||
if self._daq is None:
|
||||
try:
|
||||
daq=self._daq
|
||||
except AttributeError:
|
||||
_log.info(f'simulated')
|
||||
return
|
||||
app=QApplication.instance()
|
||||
@@ -121,16 +145,15 @@ class Jungfrau:
|
||||
self._pulse_id_start=int(self._pv_pulse_id.value)
|
||||
except TypeError as e:
|
||||
_log.warning(f'failed to get _pulse_id_start: {e}')
|
||||
if self._daq is not None:
|
||||
n_pulses_run = n_pulses + run['padding']
|
||||
self._daq.acquire(run['prefix'], n_pulses=min(n_pulses_run, 800), n_repeat=ceil(n_pulses_run/800), wait=False, cell_name=run['cell_name'])
|
||||
#self._daq.acquire(run['prefix'], n_pulses=n_pulses, wait=False, cell_name=run['cell_name'])
|
||||
pass
|
||||
#run['id']+=1
|
||||
n_pulses_run = n_pulses + run['padding']
|
||||
block_size = run['block_size']
|
||||
self._daq.acquire(run['prefix'], n_pulses=min(n_pulses_run, block_size), n_repeat=ceil(n_pulses_run/block_size), wait=False, cell_name=run['cell_name'])
|
||||
cfg.setValue(AppCfg.DAQ_RUN,run)
|
||||
|
||||
def gather_upload(self):
|
||||
if self._daq is None:
|
||||
try:
|
||||
daq=self._daq
|
||||
except AttributeError:
|
||||
_log.info(f'simulated')
|
||||
return
|
||||
try:
|
||||
|
||||
@@ -2318,6 +2318,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
jf=app._jungfrau
|
||||
except AttributeError:
|
||||
app._jungfrau=jf=psi_device.Jungfrau(app._args.sim&0x80!=0)
|
||||
jf.config(**kwargs)
|
||||
sp=dt._shapepath
|
||||
sp.verbose=dt_misc['verbose']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user