diff --git a/config/settings.properties b/config/settings.properties index 6074c92..d7dcd54 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,4 +1,4 @@ -#Sun Feb 09 15:51:55 CET 2020 +#Tue Feb 11 17:02:23 CET 2020 HARMONIC_ID_1=1 ALPHA_ID_2=0.0 ENERGY=708.5 diff --git a/config/variables.properties b/config/variables.properties index c5390a3..fb6539f 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,2 +1,2 @@ -#Tue Feb 11 15:43:01 CET 2020 -FileSequentialNumber=568 +#Tue Feb 11 17:26:16 CET 2020 +FileSequentialNumber=577 diff --git a/script/devices/eiger.py b/script/devices/eiger.py index 741f9f3..8fea2a1 100644 --- a/script/devices/eiger.py +++ b/script/devices/eiger.py @@ -161,7 +161,7 @@ def _save_as_tiff(data, filename, check=False, show = False): def save_as_tiff(data, filename, check=False, show = False, parallel=True): if parallel: - fork((_save_as_tiff,(filename, check, show)),) + return fork((_save_as_tiff,(data, filename, check, show)),) else: _save_as_tiff(data, filename, check, show) diff --git a/script/templates/Eiger2Img.py b/script/templates/Eiger2Img.py index e2942ea..64ff1e5 100644 --- a/script/templates/Eiger2Img.py +++ b/script/templates/Eiger2Img.py @@ -31,6 +31,7 @@ if METHOD == "Two_Energies": raise Exception("Bad energy argument") start = time.time() +threads = [] path = "{data}/{year}_{month}/{date}" + "/" + METHOD + "_{seq}%03d" set_exec_pars(path= path, format="txt", layout="table", open=True) @@ -156,7 +157,8 @@ def save_image_file(frame, cycle=-1, frame_index=0): plot(frame.matrix if (type(frame) == Data) else get_ip_array(frame), name = get_image_file_name(cycle, frame_index, True)) if AUTO_SAVE and (frame is not None): filename = get_image_file_name(cycle, frame_index) - save_as_tiff(frame, filename, check=False) + threads.append(save_as_tiff(frame, filename, check=False, parallel=True)) + log(filename) print filename # log("SV:"+Format(startvoltage,"0.000")+" OB:"+Format(objective,"0.00")+" ST:"+Format(LEEMtemp,"0.0")) @@ -213,7 +215,10 @@ try: # temp = getLEEMtemp() # log(0 , "Temp : " + Format(temp,"0.00") + " OB : " + Format(objective,"0.00") + " StigmaA : " + " StigmaB : " ) # Auto average and save - + + print "Waiting file writing threads to finish..." + for t in threads: + join(t) if (METHOD != "Take_Image") and (MEASUREMENTS > 1) and (AUTO_SAVE == 1): print "--- Averaging..." for i in range(len(frames)): diff --git a/script/templates/EigerAbsSpec.py b/script/templates/EigerAbsSpec.py index 9e56bbb..24e01ad 100644 --- a/script/templates/EigerAbsSpec.py +++ b/script/templates/EigerAbsSpec.py @@ -10,7 +10,7 @@ if get_exec_pars().source == CommandSource.ui: NUMBER_SCANS =1 RANGES = [[500.0, 1000.0, 100.0]] -DRY_RUN=True +DRY_RUN=False if len(RANGES) == 0: raise Exception("No scan range defined")