This commit is contained in:
gac-x11ma
2024-03-19 16:16:03 +01:00
parent 1d75bc4535
commit 8aefd82ba7
72 changed files with 5064 additions and 75 deletions

50
script/test/TestVscan.py Normal file
View File

@@ -0,0 +1,50 @@
#Pseudo motor for my motor functions, e.g. move_sim_x
#Detector = PEEMCAM
SHOW_COMPOSITE_IMG=True
TRANSPOSE=False
class MotorX(Writable):
def write(self, pos):
print "X=",pos
class MotorY(Writable):
def write(self, pos):
print "Y=",pos
motor_x=MotorX()
motor_y=MotorY()
vector = [ [1,1] , [1,2] , [1,3] , [1,4] ,
[2,1] , [2,2] , [2,3] , [2,4] ,
[3,1] , [3,2] , [3,3] , [3,4] ]
bins_x,bins_y = 4,3
composite =create_composite_image(peemcam.dataMatrix.take(), bins_x,bins_y)
if SHOW_COMPOSITE_IMG:
display_composite_image(composite, "Composite", reset=True, force_renderer=True, transpose=TRANSPOSE)
def before_read(pos, scan):
trigger_peemcam()
ProviderTIFF.setMetadata(get_diags())
def after_read(rec, scan):
x,y = rec.index%bins_x, rec.index/bins_x
append_composite_image(composite, rec[peemcam.dataMatrix], x, y)
if SHOW_COMPOSITE_IMG:
display_composite_image(composite, "Composite", force_renderer=True, transpose=TRANSPOSE)
r = vscan( (motor_x,motor_y), (peemcam.dataMatrix, CADC2), vector, latency=0.1,
before_read= before_read,
after_read=after_read,)
save_dataset("/composite", get_ip_array(composite))
#Plot all sampled images
#plot(r[peemcam.dataMatrix], title="Images")
#Plot a scalar
#plot(r[CADC2], title="Scalar")

View File

@@ -1,5 +1 @@
#otf2(start=778, end=785, time=1, delay=10, mode='LINEAR', alpha = 0.0, offset=-3.8, name='test_Co')
#otf2(start=772, end=805, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=-3.8, name='test')
#otf2(start=845, end=885, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset=-3.8, name='test_Ni')
#otf2(start=520, end=570, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset= 0, name='oXAS-VS01-OCP_O_test')
otf2(start=520, end=595, time=2, delay=10, mode='LINEAR', alpha = 0.0, offset= 0, name='oXAS-VS01-OCP_O_test')
otf2(start=525, end=560, time=1, delay=1, mode='LINEAR', alpha = 0.0, offset=-3.1, name='test')

View File

@@ -0,0 +1,12 @@
from datetime import datetime
#filename = get_exec_pars().path + "/test.tiff"
filename = expand_path("{data}/{year}_{month}/{date}/{date}/test_{dseq}.tiff")
trigger_peemcam()
time_str = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
matadata = {"time": time_str}
save_as_tiff(img_peemcam.data, FILENAME, show = True, metadata=matadata)