From 39fdca7e24209f4ccaa1ecece5050e2c1c86c7e8 Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Fri, 5 May 2017 09:18:04 +0200 Subject: [PATCH] Closedown --- devices/CurrentCamera.properties | 10 +++++----- devices/WireScanner motor.properties | 4 ++-- script/Devices/WireScanner.py | 3 +-- script/Diagnostics/WireScan.py | 3 ++- script/Diagnostics/sig_process.py | 8 ++++++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 9ed620c..8529ac1 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,4 +1,4 @@ -#Thu May 04 17:08:24 CEST 2017 +#Fri May 05 08:12:42 CEST 2017 colormap=Flame colormapAutomatic=false colormapMax=500.0 @@ -21,9 +21,9 @@ rotation=0.0 rotationCrop=false scale=1.0 serverURL=localhost\:10000 -spatialCalOffsetX=-1292.504909252311 -spatialCalOffsetY=-1062.4919313975568 -spatialCalScaleX=-8.699279809007425 -spatialCalScaleY=-8.85445509712251 +spatialCalOffsetX=-1057.4895329398094 +spatialCalOffsetY=-1420.5549062527236 +spatialCalScaleX=-8.510638153514359 +spatialCalScaleY=-8.235817137431614 spatialCalUnits=mm transpose=false diff --git a/devices/WireScanner motor.properties b/devices/WireScanner motor.properties index 5a65929..ff19fac 100644 --- a/devices/WireScanner motor.properties +++ b/devices/WireScanner motor.properties @@ -1,5 +1,5 @@ -#Thu May 04 17:08:13 CEST 2017 -defaultSpeed=6000.0 +#Thu May 04 18:12:02 CEST 2017 +defaultSpeed=282.842712474619 estbilizationDelay=0 hasEnable=false homingType=None diff --git a/script/Devices/WireScanner.py b/script/Devices/WireScanner.py index f653967..7610e26 100644 --- a/script/Devices/WireScanner.py +++ b/script/Devices/WireScanner.py @@ -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() diff --git a/script/Diagnostics/WireScan.py b/script/Diagnostics/WireScan.py index 670c073..7fa2cc9 100644 --- a/script/Diagnostics/WireScan.py +++ b/script/Diagnostics/WireScan.py @@ -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) diff --git a/script/Diagnostics/sig_process.py b/script/Diagnostics/sig_process.py index 2234d88..d7c525d 100644 --- a/script/Diagnostics/sig_process.py +++ b/script/Diagnostics/sig_process.py @@ -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