Script execution
This commit is contained in:
89
script/OPD_accurracy_check_scan.py
Normal file
89
script/OPD_accurracy_check_scan.py
Normal file
@@ -0,0 +1,89 @@
|
||||
"""
|
||||
File: OPD_accurracy_check_scan.py
|
||||
Author: KR84
|
||||
Copyright PSI LLRF, 2016
|
||||
|
||||
Purpose Record klystron OPD accurracy by setting the station to different operation points
|
||||
Preconditions - RF station is running
|
||||
- you know the settling time of the feedback + 100 P2P-count + 100 Hz, if required, change it below
|
||||
-
|
||||
|
||||
"""
|
||||
|
||||
#################################################################
|
||||
# Parameter SECTION, change it to your RF station before run
|
||||
SECTION = "SINEG01"
|
||||
|
||||
# for 100 Hz and P2P-count = 100 this can be at least 1.1 seconds
|
||||
latency = 10
|
||||
#################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# some other parameters
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# re-define filename, such that the SECTION is also in the filename
|
||||
set_context(path = "{data}/{year}_{month}/{date}/{date}_{time}_" + str(SECTION) + "_{name}")
|
||||
|
||||
|
||||
#################################################################################
|
||||
# define all PVs
|
||||
#import ch.psi.pshell.epics.ProcessVariable as PV
|
||||
import ch.psi.pshell.epics.ChannelDouble as PV
|
||||
|
||||
# controlled variabales
|
||||
cv_kly_pow = PV("phase_ref", SECTION + "-RSYS:SET-KLY-POWER")
|
||||
cv_kly_headroom = PV("headroom" , SECTION + "-RHLA-JOBRMP:SET-KLY-POWER-HR")
|
||||
|
||||
# measured variables
|
||||
mv_kly_pow_avg = PV("REF_amplt_jit" ,SECTION + "-RKLY-DCP10:FOR-POWER-AVG")
|
||||
mv_kly_pow_avg_gated = PV("REF_amplt_jit" ,SECTION + "-RKLY-DCP10:FOR-POWER-AVG-GATED")
|
||||
|
||||
|
||||
# auxiliary measured variables, but not scanned
|
||||
|
||||
|
||||
# initialize all PVs
|
||||
cv_kly_pow.initialize()
|
||||
cv_kly_headroom.initialize()
|
||||
mv_kly_pow_avg.initialize()
|
||||
mv_kly_pow_avg_gated.initialize()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#################################################################################
|
||||
# scan
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
scan_result = ascan((cv_kly_pow, cv_kly_headroom), (mv_kly_pow_avg,mv_kly_pow_avg_gated), ( 1.0, 0), (17.0, 0.1), (1.0, 0.05) , latency=latency, title="OPD Power Scan", zigzag=False)
|
||||
%scan_result = ascan((cv_rf_amplt, cv_rf_phase), (mv_ref_jit_amplt,mv_ref_jit_phase,mv_iqm_jit_amplt,mv_iqm_jit_phase,mv_pre_jit_amplt,mv_pre_jit_phase,mv_kly_jit_amplt,mv_kly_jit_phase,mv_vsum_jit_amplt,mv_vsum_jit_phase), ( 0.2, -170.0), (0.3, 180.0), (0.05, 10.0) , latency=latency, title="OPD Power Scan", zigzag=False)
|
||||
|
||||
|
||||
|
||||
#################################################################################
|
||||
# close all PVs
|
||||
cv_kly_pow.close()
|
||||
cv_kly_headroom.close()
|
||||
mv_kly_pow_avg.close()
|
||||
mv_kly_pow_avg_gated.close()
|
||||
|
||||
|
||||
|
||||
|
||||
#################################################################################
|
||||
# analyze
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user