jfjoch: added new wait_till_running method and updated wait_tilldone logging
This commit is contained in:
@@ -130,42 +130,17 @@ class JFJochWrapper:
|
||||
trigger = r.n_y
|
||||
images = r.n_x
|
||||
|
||||
grid_settings = jfjoch_client.GridScan(
|
||||
n_fast= r.n_x,
|
||||
snake=True,
|
||||
step_x_um=r.grid_size_mm.x * 1000.0,
|
||||
step_y_um=r.grid_size_mm.y * 1000.0,
|
||||
vertical=False
|
||||
)
|
||||
|
||||
dataset_settings = jfjoch_client.DatasetSettings(
|
||||
beam_x_pxl=s.diffraction.beam_center_pxl[0],
|
||||
beam_y_pxl=s.diffraction.beam_center_pxl[1],
|
||||
ntrigger= trigger,
|
||||
images_per_trigger=images,
|
||||
detector_distance_mm=s.diffraction.dtz_mm,
|
||||
file_prefix=f"{pgroup}/raw/raster/{r.file_prefix}",
|
||||
incident_energy_keV=s.diffraction.energy_keV,
|
||||
grid_scan=grid_settings,
|
||||
sample_name=sample,
|
||||
image_time_us=round(r.exp_time_s * 1e6),
|
||||
experiment_group=pgroup,
|
||||
transmission=s.bl.transmission,
|
||||
ring_current_mA=s.bl.ring_current_mA,
|
||||
sample_temperature_K=s.bl.cryojet_K,
|
||||
total_flux=s.bl.flux_ph_s,
|
||||
poni_rot1_rad = s.diffraction.poni_rot1_rad,
|
||||
poni_rot2_rad = s.diffraction.poni_rot2_rad,
|
||||
max_spot_count = 1000,
|
||||
detect_ice_rings = True
|
||||
)
|
||||
def wait_till_running(self, timeout: int | float = 60):
|
||||
if self.__simulated:
|
||||
return None
|
||||
try:
|
||||
self.__api.start_post(dataset_settings=dataset_settings)
|
||||
self.__api.wait_until_running_post_with_http_info(timeout=math.ceil(timeout))
|
||||
return True
|
||||
except Exception as e:
|
||||
raise JFJochCommunicationError(
|
||||
"JFJoch data collection failed to initialize for raster scan",
|
||||
operation="POST",
|
||||
endpoint="start_post",
|
||||
f"JFJoch wait until running returned an exception: {e}",
|
||||
operation="GET",
|
||||
endpoint="wait_until_running_post",
|
||||
base_url=self.__url,
|
||||
) from e
|
||||
|
||||
@@ -177,7 +152,7 @@ class JFJochWrapper:
|
||||
return self.__api.result_scan_get()
|
||||
except Exception as e:
|
||||
raise JFJochCommunicationError(
|
||||
"JFJoch wait/result retrieval failed",
|
||||
f"JFJoch wait till done retrieval returned an exception: {e}",
|
||||
operation="GET",
|
||||
endpoint="wait_till_done_post / result_scan_get",
|
||||
base_url=self.__url,
|
||||
|
||||
Reference in New Issue
Block a user