Closedown
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
|
||||
import datetime
|
||||
|
||||
use_bpm = True
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
I1 = 95.0
|
||||
I2 = 100.0
|
||||
@@ -35,12 +37,15 @@ print "Parameters: ", I1, I2, dI, settling_time, plot_image, number_images, use_
|
||||
plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S')
|
||||
|
||||
|
||||
latch = True
|
||||
if get_device("image_stats") is None:
|
||||
print "Instantiating camtool"
|
||||
add_device(CamTool("image_stats", prefix = "cam:", latch = latch, camera = "SINEG01-DSCR350"), True)
|
||||
if (latch):
|
||||
image_stats.start()
|
||||
if (use_bpm):
|
||||
add_device(BpmStats("image_stats", "SINEG01-DBPM340"), True)
|
||||
else:
|
||||
latch = True
|
||||
if get_device("image_stats") is None:
|
||||
print "Instantiating camtool"
|
||||
add_device(CamTool("image_stats", prefix = "cam:", latch = latch, camera = "SINEG01-DSCR350"), True)
|
||||
if (latch):
|
||||
image_stats.start()
|
||||
#add_device(ImageStats("image_stats", get_simulated_source(image)), True)
|
||||
|
||||
image_stats.setNumberOfImages(max(number_images,1))
|
||||
|
||||
@@ -102,7 +102,7 @@ else:
|
||||
(hx,hy)= convex_hull(x=r.getReadable(0), y=r.getReadable(1))
|
||||
hx.append(hx[0]); hy.append(hy[0])
|
||||
|
||||
print "OK"
|
||||
|
||||
# save the entry in the logbook
|
||||
gsa_log_msg = "Data file: " + get_context().path
|
||||
gsa_log_msg = gsa_log_msg + "\nImages: " + str(number_images)
|
||||
@@ -111,6 +111,7 @@ gsa_log_msg = gsa_log_msg + "\n\n" + r.print()
|
||||
if do_elog:
|
||||
elog("Gun solenoid current scan", gsa_log_msg , get_plot_snapshots())
|
||||
|
||||
_=[r, hx, hy]
|
||||
set_return([r, hx, hy])
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ class BpmStats(DeviceBase):
|
||||
|
||||
|
||||
if __name__ == "__builtin__":
|
||||
add_device(BpmStats("bpm_com", "SINEG01-DBPM340"))
|
||||
add_device(BpmStats("bpm_com", "SINEG01-DBPM340"), True)
|
||||
bpm_com.setNumberOfImages(5)
|
||||
for i in range (10):
|
||||
bpm_com.update()
|
||||
|
||||
@@ -5,28 +5,24 @@
|
||||
from ijutils import *
|
||||
import java.awt.Color as Color
|
||||
|
||||
ip2 = load_image(image.getImage(), title="Image2")
|
||||
|
||||
|
||||
|
||||
show_panel(ip2.getBufferedImage(), "Original")
|
||||
|
||||
ip2 = load_image("images/img2.png", title="Image2")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
show_panel(ip2.getBufferedImage(), "Original")
|
||||
|
||||
#Particle Analysis
|
||||
ip = grayscale(ip2, in_place = False)
|
||||
auto_threshold(ip)
|
||||
binary_op(ip, "fill_holes")
|
||||
|
||||
|
||||
|
||||
|
||||
pn=show_panel(ip.getBufferedImage(), "Binarization")
|
||||
#pn.setZoom(0.25)
|
||||
#binary_fill_holes(ip)
|
||||
#ip.show()
|
||||
(results,output_img)=analyse_particles(ip, 100,1000, print_table=True)
|
||||
#output_img.show()
|
||||
|
||||
show_panel(ip.getBufferedImage(), "Binarization")
|
||||
#binary_fill_holes(ip)
|
||||
#ip.show()
|
||||
(results,output_img)=analyse_particles(ip, 100,1000, print_table=True)
|
||||
#output_img.show()
|
||||
|
||||
show_panel(output_img.getBufferedImage(), "Particle Analysis")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user