Closedown

This commit is contained in:
gobbo_a
2017-05-05 09:18:04 +02:00
parent c93df81549
commit 39fdca7e24
5 changed files with 16 additions and 12 deletions

View File

@@ -160,9 +160,8 @@ class WireScanner(WireScanInfo):
self.wait_in_selection()
def wait_in_selection(self):
#time.sleep(3.0)
time.sleep(0.5) #Some time for the status change
scanner.waitValue("At start", 60000)
time.sleep(3.0)
def scan(self):
self.cycles = self.nb_cycles.get()

View File

@@ -162,11 +162,12 @@ finally:
for i in range (cycles):
for j in range(len(blms)):
bg = get_attributes("background/" + str(j+1))["Mean"]
path = wire+"_" + ("%04d" % (i+1)) + "/blm" + str(j+1)
d = load_data(path)
d = blm_remove_spikes(d)
if bkg_mean is not None:
d = [v-bkg_mean for v in d]
d = [v-bg for v in d]
[com, rms] = profile_rms_stats(x, nor,noise_std=0, n_sigma=3.5)
set_attribute(path, "RMS", rms)
set_attribute(path, "RMS centroid", com)

View File

@@ -22,7 +22,7 @@ def blm_remove_spikes(x):
:param x: input array
:return: output array
"""
print "0"
x = copy.copy(x)
if x.size > 5: # Must have enough sample points
d_x = x[1:] - x[:-1]
@@ -37,16 +37,20 @@ def blm_remove_spikes(x):
# 2 point spikes
x[i+2] = (x[i:i+2].sum() + x[i+4])/3
x[i+3] = (x[i+1] + x[i+4:i+6].sum())/3
print "A"
# Handle edge points
if d_x[-1] > 0.5 * maximum:
print "B"
x[-1] = x[-3:-1].sum() / 2
if d_x[-2] > 0.5 * maximum:
print "C"
x[-2] = (x[-1] + x[-4:-2].sum()) / 3
if d_x[0] < -0.5 * maximum:
print "D"
x[0] = x[1:3].sum() / 2
if d_x[1] < -0.5*maximum:
print "E"
x[1] = (x[0] + x[2:4].sum()) / 3
return x