Startup
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#Mon May 22 15:31:27 CEST 2017
|
||||
#Wed May 24 10:37:50 CEST 2017
|
||||
colormap=Flame
|
||||
colormapAutomatic=true
|
||||
colormapMax=0.0
|
||||
colormapMax=20.0
|
||||
colormapMin=0.0
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
flipVertically=true
|
||||
grayscale=false
|
||||
imageHeight=1200
|
||||
imageWidth=1246
|
||||
@@ -21,9 +21,9 @@ rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
serverURL=localhost\:10000
|
||||
spatialCalOffsetX=-630.5060320164276
|
||||
spatialCalOffsetY=-612.5104241897614
|
||||
spatialCalScaleX=-26.761820720381525
|
||||
spatialCalScaleY=-26.595744663521685
|
||||
spatialCalOffsetX=-642.0
|
||||
spatialCalOffsetY=-609.0
|
||||
spatialCalScaleX=-26.85765443151298
|
||||
spatialCalScaleY=-27.124773960217
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu May 11 11:13:46 CEST 2017
|
||||
#Wed May 24 10:23:44 CEST 2017
|
||||
colormap=Flame
|
||||
colormapAutomatic=true
|
||||
colormapMax=578.797
|
||||
@@ -18,9 +18,9 @@ roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=-630.5060320164276
|
||||
spatialCalOffsetY=-612.5104241897614
|
||||
spatialCalScaleX=-26.761820720381525
|
||||
spatialCalScaleY=-26.595744663521685
|
||||
spatialCalOffsetX=-642.5156395013756
|
||||
spatialCalOffsetY=-609.5079128412647
|
||||
spatialCalScaleX=-26.85765405371486
|
||||
spatialCalScaleY=-27.12477275985196
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
|
||||
@@ -86,6 +86,8 @@ try:
|
||||
sensors = [image_stats.com_x_mean, image_stats.com_y_mean, image_stats.com_x_stdev, image_stats.com_y_stdev]
|
||||
else:
|
||||
sensors = get_camtool_stats(number_images, good_region=use_good_region)
|
||||
|
||||
|
||||
if plot_image:
|
||||
sensors.append(camtool.getDataMatrix())
|
||||
r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = before_sample, after_read = after_sample)
|
||||
|
||||
@@ -230,17 +230,58 @@ class CamtoolImage(ReadableMatrix):
|
||||
def wait_camtool_message(number_messages = 1, timeout = 10000):
|
||||
for i in range (number_messages):
|
||||
if not camtool.stream.waitCacheChange(timeout): raise Exception("Timeout receiving from Camtool")
|
||||
|
||||
|
||||
#Temporary wokarounbd
|
||||
|
||||
class CamtoolComX(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
v = camtool.getValue("x_profile")
|
||||
x = camtool.getValue("x_axis")
|
||||
s = 0
|
||||
p = 0
|
||||
for i in range(len(v)):
|
||||
s += x[i]*v[i]
|
||||
p += v[i]
|
||||
return s / p
|
||||
|
||||
class CamtoolComY(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
v = camtool.getValue("y_profile")
|
||||
x = camtool.getValue("y_axis")
|
||||
s = 0
|
||||
p = 0
|
||||
for i in range(len(v)):
|
||||
s += x[i]*v[i]
|
||||
p += v[i]
|
||||
return s / p
|
||||
|
||||
class CamtoolComErrorX(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
return 0.0
|
||||
|
||||
class CamtoolComErrorY(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
return 0.0
|
||||
|
||||
|
||||
def get_camtool_stats(number_images=1, async = True, interval=-1, good_region = False):
|
||||
#return [CamtoolValue("gr_x_fit_mean"), CamtoolValue("gr_y_fit_mean"), CamtoolValue("gr_x_fit_standard_deviation"), CamtoolValue("gr_y_fit_standard_deviation")]
|
||||
ret = []
|
||||
wait_camtool_message()
|
||||
prefix = "gr_" if good_region else ""
|
||||
"""
|
||||
for ident in [prefix+"x_fit_mean", prefix+"y_fit_mean", prefix+"x_fit_standard_deviation", prefix+"y_fit_standard_deviation"]:
|
||||
child = camtool.stream.getChild(ident)
|
||||
av = create_averager(child, number_images, interval)
|
||||
av.monitored = async
|
||||
ret.append(av)
|
||||
"""
|
||||
for dev in [CamtoolComX(), CamtoolComY(), CamtoolComErrorX(), CamtoolComErrorY()]:
|
||||
dev.initialize()
|
||||
av = create_averager (dev, number_images, 1/2.5)#(dev, number_images, interval)
|
||||
#av.monitored = async
|
||||
ret.append(av)
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user