Script execution
This commit is contained in:
@@ -19,16 +19,23 @@ class SimulatedInput(Readable):
|
||||
sout = SimulatedOutput()
|
||||
sinp = SimulatedInput()
|
||||
|
||||
def integrate_image():
|
||||
def integrate_image(vertical = True):
|
||||
data = Scienta.data.read()
|
||||
#Integrate and plot
|
||||
(width,height) = Scienta.getImageSize().tolist()
|
||||
integration = []
|
||||
for i in range(width):
|
||||
p=0.0
|
||||
if vertical:
|
||||
for i in range(width):
|
||||
p=0.0
|
||||
for j in range(height):
|
||||
p=p+data[j*width+i]
|
||||
integration.append(p)
|
||||
else:
|
||||
for j in range(height):
|
||||
p=p+data[j*width+i]
|
||||
integration.append(p)
|
||||
p=0.0
|
||||
for i in range(width):
|
||||
p=p+data[j*width+i]
|
||||
integration.append(p)
|
||||
return integration
|
||||
|
||||
|
||||
@@ -43,6 +50,17 @@ class ImageIntegrator(ReadableArray):
|
||||
Integration = ImageIntegrator()
|
||||
|
||||
|
||||
class ImageAngleDistribution(ReadableArray):
|
||||
def getSize(self):
|
||||
(width,height) = Scienta.getImageSize().tolist()
|
||||
return height
|
||||
|
||||
def read(self):
|
||||
return to_array(integrate_image(Flase),'d')
|
||||
|
||||
AngleDistribution = ImageAngleDistribution()
|
||||
|
||||
|
||||
def trig_scienta():
|
||||
image_id = Scienta.currentImageCount
|
||||
Scienta.start()
|
||||
|
||||
Reference in New Issue
Block a user