diff --git a/script/jitter_scan.py b/script/jitter_scan.py index 6f25eed..f2a907c 100644 --- a/script/jitter_scan.py +++ b/script/jitter_scan.py @@ -1,14 +1,25 @@ +""" +File: jitter_scan.py +Author: KR84 +Copyright PSI LLRF, 2016 +Purpose Record RF system jitters and store / archive data +Preconditions RF station is running +""" -import ch.psi.pshell.epics.ProcessVariable as PV - - - -latency = 0.3 - - +################################################################# +# Parameter SECTION, change it to your RF station before run SECTION = "SINSB02" +################################################################# + + + + + +# some other parameters +# for 100 Hz and P2P-count = 100 this can be 1.1 seconds +latency = 0.3 start = -170.0 stop = 180.0 step = 10.0 @@ -19,10 +30,12 @@ print "Stop = ", stop print "Step = ", step +# 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 # controlled variabales cv_rf_phase = PV("phase_ref", SECTION + "-RLLE-DSP:PHASE-REFERENCE") cv_rf_amplt = PV("amplt_ref", SECTION + "-RLLE-DSP:AMPLT-REFERENCE") @@ -104,7 +117,7 @@ set_attribute(path, "kly_jit_phase_mean", kly_jit_phase_mean) # ELOG msg = scan_result.print("\t") -msg = msg + "\nMean:\nREF amplt\t" + str(ref_jit_amplt_mean) + "\nREF phase\t" + str(ref_jit_phase_mean) + "\n\nIQM amplt\t" + str(iqm_jit_amplt_mean) + "\nIQM phase\t" + str(iqm_jit_phase_mean) + "\n\nPRE amplt\t" + str(pre_jit_amplt_mean) + "\npre phase\t" + str(pre_jit_phase_mean) + "\n\nKLY amplt\t" + str(kly_jit_amplt_mean) + "\nkly phase\t" + str(kly_jit_phase_mean) +msg = msg + "\nMean:\nREF amplt\t" + str(ref_jit_amplt_mean)[:5] + "\nREF phase\t" + str(ref_jit_phase_mean)[:5] + "\n\nIQM amplt\t" + str(iqm_jit_amplt_mean)[:5] + "\nIQM phase\t" + str(iqm_jit_phase_mean)[:5] + "\n\nPRE amplt\t" + str(pre_jit_amplt_mean)[:5] + "\npre phase\t" + str(pre_jit_phase_mean)[:5] + "\n\nKLY amplt\t" + str(kly_jit_amplt_mean)[:5] + "\nkly phase\t" + str(kly_jit_phase_mean)[:5] msg = msg + "\n\nFile: " + get_context().path print msg