
p = "2018_03/20180312/20180312_231754_WireScan.h5|/x_000"
p = "2018_03/20180312/20180312_233008_WireScan.h5|/x_000"
p = "2018_03/20180312/20180312_234230_WireScan.h5|/x_000"

def gd(i):
    global p
    return load_data(p+str(i)+"/blm1")

def gt(i):
    global p
    return load_data(p+str(i)+"/Time")
def gp(i):
    global p
    return load_data(p+str(i)+"/w_pos")

plot([gd(1), gd(2), gd(3), gd(4), gd(5), gd(6)], ["1", "2", "3", "4", "5", "6"], xdata = [gp(1), gp(2), gp(3), gp(4), gp(5), gp(6)])

x,y = to_array(gd(1),'d'), to_array(gp(1),'d')
print call_jep(MODULE, "profile_rms_stats", [to_npa(x), to_npa(y), 0, 3.5])

run("Diagnostics/sig_process_wrapper")
[rms_com, rms_sigma] = profile_rms_stats(x,y,noise_std=0, n_sigma=3.5)
print [rms_com, rms_sigma]
for i in [1,2,3,4,5,6]:
    print profile_rms_stats(gd(i), gp(i),noise_std=0, n_sigma=3.5)

    

