Closedown

This commit is contained in:
gac-x04sa
2019-07-04 16:15:48 +02:00
parent 246790ff4c
commit 16d3f6ccf1
9 changed files with 151 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "test1",
"crystal": "['cubic', 'Triclinic', 7.723, 7.707, 7.723, 90.0, 89.265, 90.0]",
"crystal": "['cubic', 'Triclinic', 7.723071056222668, 7.702898811460209, 7.720064193668625, 89.99965543112849, 89.21875367198528, 89.99500143686504]",
"reflist": {
"1": {
"tag": "None",
@@ -8,6 +8,34 @@
"pos": "[5.0, 9.3822, 19.7785, 104.4223, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T08:48:00.667000"
},
"2": {
"tag": "None",
"hkl": "[2.0, 0.0, 2.0]",
"pos": "[5.0, 19.054, 20.167, 13.8111, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T09:47:45.672000"
},
"3": {
"tag": "None",
"hkl": "[2.0, 2.0, 2.0]",
"pos": "[5.0, 27.1074, 21.198, 61.8741, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T10:13:37.671000"
},
"4": {
"tag": "None",
"hkl": "[0.0, -1.0, 2.0]",
"pos": "[5.0, 9.5098, 19.7025, -76.397, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T10:46:10.117000"
},
"5": {
"tag": "None",
"hkl": "[0.0, 3.0, 2.0]",
"pos": "[5.0, 28.827, 21.7498, 107.7429, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T10:56:41.220000"
}
},
"orientlist": {},
@@ -18,9 +46,9 @@
"n_phi_configured": "[0.0, 0.0, 1.0]"
},
"u": [
"1.0, 0.0, 0.0",
"0.0, 1.0, 0.0",
"0.0, 0.0, 1.0"
"0.9999129122215213, 0.007489577628036139, 0.010866195269269147",
"-0.007454780892516531, 0.999966966138507, -0.0032392705343809503",
"-0.01089009708500512, 0.0031579833286385197, 0.9999357143970682"
],
"ub": null,
"or0": null,

View File

@@ -3,11 +3,25 @@
"crystal": "['cubic', 'Triclinic', 7.723, 7.707, 7.723, 90.0, 89.265, 90.0]",
"reflist": {
"1": {
"tag": null,
"tag": "None",
"hkl": "[0.0, 1.0, 2.0]",
"pos": "[5.0, 9.3822, 19.7785, 104.4223, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T08:48:00.667000"
},
"2": {
"tag": "None",
"hkl": "[2.0, 0.0, 2.0]",
"pos": "[5.0, 19.054, 20.167, 13.8111, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T09:47:45.672000"
},
"3": {
"tag": null,
"hkl": "[2.0, 2.0, 2.0]",
"pos": "[5.0, 27.1074, 21.198, 61.8741, 0, 0]",
"energy": 9.5007,
"time": "2019-07-04T10:13:37.671000"
}
},
"orientlist": {},

View File

@@ -1,4 +1,4 @@
#Thu Jul 04 09:12:28 CEST 2019
#Thu Jul 04 16:08:25 CEST 2019
count_time=1.0
geometry=fourcv
roi=219 102 239 122
roi=173 88 285 136

View File

@@ -1,8 +1,8 @@
#Mon Feb 11 13:57:36 CET 2019
colormap=Temperature
#Thu Jul 04 14:34:38 CEST 2019
colormap=Flame
colormapAutomatic=false
colormapLogarithmic=false
colormapMax=10.0
colormapMax=1000.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false

View File

@@ -1,6 +1,6 @@
import numpy
def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 ):
def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 , filter_median = False, filter_nsigma = 0):
# read actual image file
img = numpy.fromfile(fname, dtype=numpy.uint32)
img.shape = height, width

View File

@@ -1,7 +1,7 @@
from jeputils import *
def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 ):
ret = call_jep("cpython/image_functions", "img_get_int", [fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2])
def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 , filter_median = False, filter_nsigma = 0)):
ret = call_jep("cpython/image_functions", "img_get_int", [fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2, filter_median, filter_nsigma)])
#return ret
#TODO: Why I_sum ans I_sum_bgr are strings?
(I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) = ret

View File

@@ -272,8 +272,8 @@ def get_diag_channels():
return diag_channels
def get_diag_name(diag):
return ch.psi.utils.Str.toTitleCase(diag.getName()).replace(" ", "")
return ch.psi.utils.Str.toTitleCase(diag if is_string(diag) else diag.getName()).replace(" ", "")
def print_diag():
for f in get_diag_channels():
print "%-25s %s" % (get_diag_name(f) , str(f.read()))
@@ -378,6 +378,100 @@ def wait_for_file_size(filepath, size, timeout = None):
time.sleep(wait_time)
###################################################################################################
# Scan commands
###################################################################################################
def relscan(motor, start, end, number_of_steps, count_time):
"""
Relative scan
"""
set_count_time(count_time)
detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix]
#TODO: Set based on experiment context
pixel.set_path("../../expdata/bml_20190703/pixel/", "images")
#TODO: should be set automatically
set_roi(173,88,285,136)
show_panel(detector_image)
pixel.show()
pixel.assert_ready()
return lscan (motor, detectors, start, end, int(number_of_steps), relative=True, before_read=before_sample, after_read=after_sample)
def absscan(motor, start, end, number_of_steps, count_time):
"""
Absolute scan
"""
set_count_time(count_time)
detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix]
#TODO: Set based on experiment context
pixel.set_path("../../expdata/bml_20190703/pixel/", "images")
#TODO: should be set automatically
set_roi(173,88,285,136)
show_panel(detector_image)
pixel.show()
pixel.assert_ready()
return lscan (motor, detectors, start, end, int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample)
def abs2scan(motor1, start1, end1, motor2, start2, end2, number_of_steps, count_time):
"""
Absolute scan of 2 motors
"""
set_count_time(count_time)
detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix]
#TODO: Set based on experiment context
pixel.set_path("../../expdata/bml_20190703/pixel/", "images")
#TODO: should be set automatically
set_roi(173,88,285,136)
show_panel(detector_image)
pixel.show()
pixel.assert_ready()
return lscan ([motor1, motor2], detectors, [start1, start2], [end1, end2], int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample)
def hrodscan(start, end, number_of_steps, count_time):
"""
Scan on l
"""
return absscan (h, start, end, number_of_steps, count_time)
def krodscan(start, end, number_of_steps, count_time):
"""
Scan on k
"""
return absscan (k, start, end, number_of_steps, count_time)
def lrodscan(start, end, number_of_steps, count_time):
"""
Scan on l
"""
return absscan (l, start, end, number_of_steps, count_time)
def hkllinscan(hstart, hfinish, kstart, kfinish, lstart, lfinish, number_of_steps, count_time):
"""
Linear scan on hkl
"""
vector = []
hs = float(hfinish - hstart)/number_of_steps
ks = float(kfinish - kstart)/number_of_steps
ls = float(lfinish - lstart)/number_of_steps
for i in range(number_of_steps+1):
hp = hstart + i * hs
kp = kstart + i * ks
lp = lstart + i * ls
vector.append([hp, kp, lp] )
set_count_time(count_time)
detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix]
#TODO: Set based on experiment context
pixel.set_path("../../expdata/bml_20190703/pixel/", "images")
#TODO: should be set automatically
set_roi(173,88,285,136)
show_panel(detector_image)
pixel.show()
pixel.assert_ready()
return hklscan(vector, detectors,latency = 0.0, before_read=before_sample, after_read=after_sample)
###################################################################################################
# Configuration

View File

@@ -297,4 +297,3 @@ def auto_after_sample(rec, scan):
else:
RETRY_COUNT = 0
return True