Script execution
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
# change the current of the gun soleoid
|
||||
# look at the centroid position (BPM or screen) downstream of the gun.
|
||||
|
||||
|
||||
|
||||
import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix
|
||||
import ch.psi.utils.Convert.toBidimensional as mono_to_bidi
|
||||
|
||||
|
||||
I_set = Channel("SINEG01-MSOL130:I-SET", alias = "I_set");
|
||||
I_get = Channel("SINEG01-MSOL130:I-READ", alias = "I_get")
|
||||
# cam_x, cam_y = ... # some camtool command / channel?
|
||||
@@ -22,6 +28,8 @@ cam_raw_data = Channel("SINEG01-DSCR190:data")
|
||||
class CameraImage(ReadableMatrix):
|
||||
def read(self):
|
||||
raw = cam_raw_data.read()
|
||||
#m = Matrix(mono_to_bidi(raw, getHeight(), getWidth()))
|
||||
#return m.transpose.getData()
|
||||
ret = []
|
||||
for i in range (self.getHeight()):
|
||||
ret.append(raw[i*self.getWidth() : (i+1)*self.getWidth()])
|
||||
@@ -96,4 +104,4 @@ p = plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")
|
||||
msg = str(r)
|
||||
msg = msg + "\nFile: " + get_context().path
|
||||
#msg = msg + "\n\n" + r.print()
|
||||
#elog("Gun solenoid current scan", msg , get_plot_snapshots())
|
||||
elog("Gun solenoid current scan", msg , get_plot_snapshots())
|
||||
|
||||
Reference in New Issue
Block a user