use new ESB_MX module and better triggerSync
This commit is contained in:
281
Readme.md
281
Readme.md
@@ -114,245 +114,84 @@ ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a'
|
||||
Deltatau host in config:
|
||||
localhost:10001:10002 (instead SAR-CPPM-EXPMX1)
|
||||
|
||||
```
|
||||
|
||||
----------------------------------- SCRATCH -----------------------------------
|
||||
|
||||
14.9.22 external code:
|
||||
----------------------
|
||||
```
|
||||
|
||||
ssh gac-cristall@saresc-cons-03
|
||||
pw: ValToira_2021
|
||||
cd Documents/swissmx_cristallina/scripts/
|
||||
|
||||
Jungfrau stuff:
|
||||
https://docs.google.com/document/d/1892j2eMsoFmufg-gdXKcSbOLcTDxLHULiNw-iZWAIVc/edit
|
||||
'Beam synchronous DAQ with run_control'
|
||||
|
||||
Check:
|
||||
~/Documents/swissmx_cristallina/scripts/Chip_align.py
|
||||
sys.path.insert(0, os.path.expanduser("/photonics/home/gac-cristall/Documents/swissmx_cristallina/slic/"))
|
||||
from slic.core.acquisition import SFAcquisition
|
||||
|
||||
|
||||
# setup slic parameters
|
||||
detectors = [ { "name" : "JF17T16V01",
|
||||
"adc_to_energy" : True,
|
||||
"compression" : True,
|
||||
"factor" : 11.33,
|
||||
"geometry" : True,
|
||||
"double_pixel_action" : "mask",
|
||||
"remove_raw_files" : False
|
||||
} ] #["JF17T16V01"]
|
||||
bs_channels = [ # have timing signitures
|
||||
"SARES30-LSCP1-CRISTA1:CH0:1",
|
||||
# "SARES30-CAMS156-SMX-OAV:FPICTURE"
|
||||
]
|
||||
epics_channels = [ # no time signitures
|
||||
]
|
||||
|
||||
daq = SFAcquisition(
|
||||
"cristallina", "p20516",
|
||||
default_detectors=detectors, default_channels=bs_channels, default_pvs=epics_channels,
|
||||
rate_multiplicator=1, append_user_tag_to_data_dir=True
|
||||
)
|
||||
|
||||
|
||||
if acquire == "True":
|
||||
daq.acquire( run_name, n_pulses=n_pulses, wait=False)
|
||||
|
||||
|
||||
|
||||
|
||||
Beam synchronous DAQ with with daq_control (command line)
|
||||
Python script:
|
||||
> python /sf/jungfrau/applications/daq_client/daq_client.py -h
|
||||
> python /sf/jungfrau/applications/daq_client/daq_client.py -p p19739 -t no_beam_test -c /sf/cristallina/config/channel_lists/channel_list_bs -e /sf/cristallina/config/channel_lists/channel_list_ca -f /sf/cristallina/config/jungfrau/jf_1d5M.json --start_pulseid 15382163895 --stop_pulseid 15382163905
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
cd /tmp/; git clone https://github.com/malcolmreynolds/transformations.git
|
||||
cd /tmp/transformations.git
|
||||
-> modify __init__.py -> .transformation (add dot)
|
||||
setup.py install --user
|
||||
|
||||
|
||||
cd /tmp/; git clone https://github.com/spyder-ide/qtawesome.git
|
||||
cd /tmp/qtawesome
|
||||
|
||||
#To have epics channels we must be connected to the ESC network
|
||||
EPICS_CA_ADDR_LIST='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
||||
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/oldRepos/app/src
|
||||
python swissmx.py
|
||||
```
|
||||
|
||||
|
||||
|
||||
caQtDM -macro 'P=SAR-EXPMX' /photonics/home/gac-cristall/Documents/swissmx_cristallina/gui/SwissMX_ChipMotion.ui
|
||||
caQtDM -macro 'P=SAR-EXPMX' ESB_MX_exp.ui
|
||||
|
||||
Camera:
|
||||
caget SARES30-CAMS156-SMX-OAV:CAMERASTATUS
|
||||
caget SARES30-CAMS156-SMX-OAV:PICTURE
|
||||
|
||||
Zoom:
|
||||
caget SAR-EXPMX-FETURA:POS_RB
|
||||
|
||||
|
||||
wlp2s0: MAC: 80:38:fb:d6:01:78 wlan-corp 129.129.64.249
|
||||
enx00e04c680519: MAC: 00:e0:4c:68:05:19
|
||||
|
||||
|
||||
Benchmark -> VideoSpeedTest
|
||||
|
||||
rsync -vai /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX/ saresc-cons-02:/tmp/zamofing_t/
|
||||
|
||||
|
||||
/opt/gfa/python-3.5/latest/bin/python camera.py --base-pv SARES30-CAMS156-SMX-OAV
|
||||
|
||||
BASE=~/Documents/prj/SwissFEL/epics_ioc_modules/LakeShore
|
||||
cd $BASE/iocBoot/iocLakeShore1
|
||||
../../bin/UB20-x86_64/LakeShore st.cmd
|
||||
|
||||
|
||||
|
||||
[saresc-cons-02 ~]$ ioc records 'SARES30-CAMS156-SMX-OAV:.*'
|
||||
|
||||
|
||||
SARES30-CAMS156-SMX-OAV:PICTURE waveform CCD Picure Col SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:FPICTURE waveform CCD Picture SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:RF_FPICTURE waveform Reduced frequency FPICTURE SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:WIDTH ai Nr. of Pixel width SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:HEIGHT ai Nr. of Pixel height SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:EXPOSURE ao Exposure SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:CAMROI_X_START ao ROI X Start SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:CAMROI_X_END ao ROI X End SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:CAMROI_Y_START ao ROI Y Start SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:CAMROI_Y_END ao ROI Y End SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:BINX ao Binning X SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
SARES30-CAMS156-SMX-OAV:BINY ao Binning Y SARES30-CPCW-CAMS156-SMX-OAV office
|
||||
|
||||
waveform:
|
||||
Native DBF type: DBF_SHORT
|
||||
Number of elements: 5000
|
||||
|
||||
SARES30-CAMS156-SMX-OAV:WIDTH 2448
|
||||
SARES30-CAMS156-SMX-OAV:HEIGHT 2048
|
||||
|
||||
caqtdm camsf
|
||||
caqtdm -macro 'NAME=SARES30-CAMS156-SMX-OAV,CAMNAME=SARES30-CAMS156-SMX-OAV' /sf/controls/config/qt/Camera/CameraMiniView_RF.ui
|
||||
caqtdm -macro 'NAME=SARES30-CAMS156-SMX-OAV,CAMNAME=SARES30-CAMS156-SMX-OAV' /sf/controls/config/qt/Camera/CameraExpert_RF.ui
|
||||
caqtdm -macro'P=SAR-EXPMX' ESB_MX_exp.ui
|
||||
|
||||
|
||||
|
||||
|
||||
03 last file: /sf/controls/config/qt/Camera/CameraMiniView_RF.ui, macro: NAME=SARES30-CAMS156-SMX-OAV,CAMNAME=SARES30-CAMS156-SMX-OAV
|
||||
|
||||
|
||||
07-07-2022 12:14:03 last file: /sf/controls/config/qt/Camera/CameraMiniView_RF.ui, macro: NAME=SARES30-CAMS156-SMX-OAV,CAMNAME=SARES30-CAMS156-SMX-OAV
|
||||
mkdir EpicsSim
|
||||
cd EpicsSim
|
||||
makeBaseApp.pl -t ioc SwissMxSim
|
||||
makeBaseApp.pl -a UB20-x86_64 -i -t ioc -p SwissMxSim SwissMxSim
|
||||
```
|
||||
----------------------------------- SCRATCH -----------------------------------
|
||||
|
||||
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/EpicsSim/iocBoot/iocSwissMxSim
|
||||
./st.cmd
|
||||
-0.952
|
||||
pp_comm.py_:
|
||||
@property
|
||||
def fast_gather(self):
|
||||
tries to connect to port and to query_types(), if fails starts the fast gather process.
|
||||
|
||||
EPICS_CA_ADDR_LIST=localhost
|
||||
ipython3
|
||||
import epics
|
||||
p = epics.PV('SwissMxSim:PICTURE', auto_monitor=False)
|
||||
print(p.info)
|
||||
import numpy as np
|
||||
a=np.arange(10000,dtype=np.uint16)
|
||||
p.put(a)
|
||||
print(p.get())
|
||||
https://pyepics.github.io/pyepics/arrays.html
|
||||
triggerSync.c:
|
||||
root@:/opt/ppmac# LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/triggerSync
|
||||
|
||||
usage:
|
||||
/tmp/triggerSync pt2ptTime timeOfs mode
|
||||
|
||||
pt2ptTime: time in ms (float value) from point to point == frequency if FEL
|
||||
timeOfs: time offset in ms (float value) for motion relative to the FEL timing
|
||||
|
||||
The program changes the speed of motion
|
||||
pshm->Coord[1].DesTimeBase= (default serverPeriod= 0.2?)
|
||||
|
||||
SIMFLAG0 (pshm->Coord[1].Q[10]) -> start trigger
|
||||
SIMFLAG1 (pshm->Coord[1].Q[11]) -> FEL pulse trigger
|
||||
//Power PMAC Software Reference Manual.pdf Gate3[i].Chan[j].Status -> page 919 UserFlag
|
||||
#define FLAG0 (gate3_1->Chan[0].Status&0x800) -> start trigger
|
||||
#define FLAG1 (gate3_1->Chan[1].Status&0x800) -> FEL pulse trigger
|
||||
|
||||
|
||||
mode:
|
||||
bit0:1: sync mode
|
||||
bit1:2: simulate start trigger
|
||||
bit2:4: simulate frame trigger
|
||||
bit3:8: verbose
|
||||
|
||||
simulate start trigger:
|
||||
set pshm->Coord[1].Q[10]=1 to simulate a Jungfrau aquire start
|
||||
|
||||
simulate frame trigger
|
||||
is output to pshm->Coord[1].Q[11]
|
||||
1: synchronize real frame and start triggers
|
||||
3: synchronize real frame and simulated start triggers
|
||||
6: simulated frame and start triggers (no sync)
|
||||
7: synchronize simulated frame and start triggers
|
||||
|
||||
in simulate mode:
|
||||
set pshm->Coord[1].Q[10]=1 to simulate a Jungfrau aquire start
|
||||
set pshm->Coord[1].Q[10]=2 to stop simulate trigger generation
|
||||
Coord[1].Q[11] is the simulated frame trigger
|
||||
|
||||
in synchronize mode
|
||||
Coord[1].Q[0]=-2 : trigsync_func start, Wait for 'arm' trigger
|
||||
Coord[1].Q[0]=-1 : got 'arm' trigger, wait frame trigger
|
||||
Coord[1].Q[0]= 0 : got frame trigger 0
|
||||
Coord[1].Q[0] is incremented at each trigger
|
||||
sync task ends when Gather.Enable==0
|
||||
|
||||
|
||||
|
||||
|
||||
caput SAR-EXPMX:MOT_FX.RBV -2.700
|
||||
caput SAR-EXPMX:MOT_FY.RBV -7.450
|
||||
caput SAR-EXPMX:MOT_CZ.RBV 1.509
|
||||
#ZAC: orig. code
|
||||
|
||||
git dt 98297263 swissmx.py
|
||||
git dt 7445a5aa CustomROI.py app_config.py app_utils.py epics_widgets/MotorTweak.py epics_widgets/SmaractMotorTweak.py
|
||||
|
||||
|
||||
zamofing_t@ganymede:~$ PPMAC=SAR-CPPM-EXPMX1
|
||||
zamofing_t@ganymede:~$ gpasciiCommander --host $PPMAC -i
|
||||
|
||||
|
||||
> &1p
|
||||
X10194.8 Y-88923
|
||||
|
||||
-8892.32 10193.94 1000.950000000004
|
||||
|
||||
> #1..8->
|
||||
&1#1->y
|
||||
#2->x
|
||||
&1#5->0.08084227555726195x+0.0370261645412808399y+157.349115566995778
|
||||
|
||||
|
||||
plane=0.0808X+0.037Y+0.15
|
||||
|
||||
0.0808*10193.94-8892.32+ 0.037* + 1000.950000000004
|
||||
|
||||
plane=0.0808*-8.8923 +0.037Y+0.15
|
||||
|
||||
|
||||
> cpx X10194 Y-8892
|
||||
|
||||
> &1p
|
||||
X10193.88 Y-8892
|
||||
|
||||
> #1,2,5p
|
||||
-8892.02 10193.9 -996.5999999999985
|
||||
|
||||
|
||||
-> z has wrong sign !
|
||||
|
||||
----------------
|
||||
avoid constand RBV event:
|
||||
caput SAR-ESPMX:MOT_FX 0.001
|
||||
caput SAR-ESPMX:MOT_FY 0.001
|
||||
---------- TODO ----------
|
||||
|
||||
caput SAR-EXPMX:MOT_FX.VELO 0.001
|
||||
caput SAR-EXPMX:MOT_FX.MDEL 0.001
|
||||
caput SAR-EXPMX:MOT_FY.MDEL 0.001
|
||||
caput SAR-EXPMX:MOT_CZ.MDEL 0.001
|
||||
|
||||
|
||||
|
||||
-faster autofocus:
|
||||
- move at constant speed and acquire as fast as possible instead stop and go motion
|
||||
|
||||
- find fiducials:
|
||||
- fix openCV version problems
|
||||
|
||||
- configuration: use the current config as default values
|
||||
|
||||
- automation: towards automatic alignement
|
||||
|
||||
if idx==0:
|
||||
#go=UsrGO.Fiducial(bm_pos+bm_sz/2-(20, 20), (40, 40),(fx,fy,bz))
|
||||
l=.120
|
||||
go=UsrGO.Fiducial((fx-l/2,fy-l/2), (l, l),bz)
|
||||
go.sigRegionChangeFinished.connect(self.cb_fiducial_update_z)
|
||||
grp=self._goTracked
|
||||
grp.addItem(go)
|
||||
mft._tree.setData(grp.childItems())
|
||||
|
||||
|
||||
="geometry/find_fiducial"
|
||||
GEO_FND_FID,GEO_AUTOFOC="geometry/autofocus"
|
||||
// /tmp/triggerSync 40 11 trigger all 40 ms, simulated start, use real frame triggers, verbose
|
||||
// /tmp/triggerSync 40 14 trigger all 40 ms, simulated start and frame triggers, no sync, verbose
|
||||
// /tmp/triggerSync 40 15 trigger all 40 ms, simulated start and frame triggers, with sync, verbose
|
||||
// /tmp/triggerSync 40 7 trigger all 40 ms, simulated start and frame triggers, with sync, minimal verbose
|
||||
|
||||
|
||||
78x78 points =6084pts a 10ms =60 sec. -> 70 sec.
|
||||
-> we are at 100 Hz !!!
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user