Script execution
This commit is contained in:
@@ -2,10 +2,10 @@ import mathutils
|
||||
import plotutils
|
||||
|
||||
|
||||
X_MIN = scx.minValue
|
||||
X_MAX = scx.maxValue
|
||||
Y_MIN = scy.minValue
|
||||
Y_MAX = scy.maxValue
|
||||
X_MIN = scx.minValue / 2
|
||||
X_MAX = scx.maxValue / 2
|
||||
Y_MIN = scy.minValue / 2
|
||||
Y_MAX = scy.maxValue / 2
|
||||
|
||||
SIMULATION = True
|
||||
Y_STEP = 0.125
|
||||
@@ -19,7 +19,7 @@ X_MIN, X_MAX, Y_MIN, Y_MAX = float(X_MIN), float(X_MAX), float(Y_MIN), float(Y_M
|
||||
step=0
|
||||
for y in frange(Y_MIN, Y_MAX, Y_STEP):
|
||||
scy.move(y)
|
||||
scan_range = [scx.minValue, scx.maxValue] if (step % 0==0) else [scx.maxValue, scx.minValue]
|
||||
scan_range = [X_MIN, X_MAX] if (step % 2==0) else [X_MAX, X_MIN]
|
||||
r = cscan(scx, sensor, scan_range[0], scan_range[1], 0.01, latency = DIODE_SETTLING_TIME)
|
||||
|
||||
try:
|
||||
@@ -42,7 +42,7 @@ for y in frange(Y_MIN, Y_MAX, Y_STEP):
|
||||
print "Invalid x fit for y=", y
|
||||
step += 1
|
||||
|
||||
r = cscan(scy, sensor, scy.minValue, scy.maxValue, 0.01, latency = DIODE_SETTLING_TIME)
|
||||
r = cscan(scy, sensor, Y_MIN, Y_MAX, 0.01, latency = DIODE_SETTLING_TIME)
|
||||
xdata = enforce_monotonic(r.getPositions(0))
|
||||
ydata = r.getReadable(0)
|
||||
(offset, normalization, mean_val, sigma) = mathutils.fit_gaussian_offset(ydata, xdata)
|
||||
|
||||
Reference in New Issue
Block a user