Script execution
This commit is contained in:
@@ -1,24 +1,60 @@
|
||||
class statistics_numbers (object):
|
||||
# struct definition to hold all relevant statistics data
|
||||
class statistics_data (object):
|
||||
min = 0.0
|
||||
mean = 0.0
|
||||
max = 0.0
|
||||
sigma = 0.0
|
||||
|
||||
# struct definition for statistics dat aof all three amplitude levels
|
||||
class all_statistics_data (object):
|
||||
sat = statistics_data()
|
||||
m5 = statistics_data()
|
||||
m10 = statistics_data()
|
||||
|
||||
|
||||
def statistics_calc(data_in):
|
||||
"calculates the min/max/mean/stdev of an array"
|
||||
print data_in
|
||||
temp = statistics_numbers();
|
||||
"function calculates the min/max/mean/stdev of an array"
|
||||
temp = statistics_data();
|
||||
temp.mean = mean (data_in)
|
||||
temp.min = min (data_in)
|
||||
temp.max = max (data_in)
|
||||
temp.stdev = stdev(data_in)
|
||||
return temp
|
||||
|
||||
|
||||
ref_jit_amplt_mean = mean(scan_result.getReadable(0))
|
||||
|
||||
ref_jit_amplt2 = statistics_numbers();
|
||||
ref_jit_amplt2 = statistics_calc(scan_result.getReadable(0)[0:29])
|
||||
def all_statistics_calc(data_in):
|
||||
"function calculates for all three amplitudes the statistics data."
|
||||
temp = all_statistics_data();
|
||||
temp.m10 = statistics_calc (data_in[0:35])
|
||||
temp.m5 = statistics_calc (data_in[36:71])
|
||||
temp.sat = statistics_calc (data_in[72:107])
|
||||
return temp
|
||||
|
||||
|
||||
|
||||
# create emtpy structs
|
||||
ref_jit_amplt = all_statistics_data()
|
||||
ref_jit_phase = all_statistics_data()
|
||||
|
||||
iqm_jit_amplt = all_statistics_data()
|
||||
iqm_jit_phase = all_statistics_data()
|
||||
|
||||
pre_jit_amplt = all_statistics_data()
|
||||
pre_jit_phase = all_statistics_data()
|
||||
|
||||
kly_jit_amplt = all_statistics_data()
|
||||
kly_jit_phase = all_statistics_data()
|
||||
|
||||
|
||||
# calculate statistics
|
||||
ref_jit_amplt = all_statistics_calc(scan_result.getReadable(0))
|
||||
ref_jit_phase = all_statistics_calc(scan_result.getReadable(1))
|
||||
|
||||
iqm_jit_amplt = all_statistics_calc(scan_result.getReadable(2))
|
||||
iqm_jit_phase = all_statistics_calc(scan_result.getReadable(3))
|
||||
|
||||
pre_jit_amplt = all_statistics_calc(scan_result.getReadable(4))
|
||||
pre_jit_phase = all_statistics_calc(scan_result.getReadable(5))
|
||||
|
||||
kly_jit_amplt = all_statistics_calc(scan_result.getReadable(6))
|
||||
kly_jit_phase = all_statistics_calc(scan_result.getReadable(7))
|
||||
Reference in New Issue
Block a user