Skip to content

Commit b2826e5

Browse files
committed
Allow multiple reconstruction recipes for sxt
1 parent 8f00dbf commit b2826e5

2 files changed

Lines changed: 31 additions & 25 deletions

File tree

src/murfey/client/contexts/sxt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def register_sxt_data_collection(
127127

128128
recipes_to_assign_pjids = [
129129
"sxt-aretomo",
130+
"sxt-imod-patch",
130131
]
131132
for recipe in recipes_to_assign_pjids:
132133
capture_post(

src/murfey/workflows/sxt/process_sxt_tilt_series.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def process_sxt_tilt_series_workflow(
5959
murfey_db.add(tilt_series)
6060
murfey_db.commit()
6161

62+
# Find all processing jobs registered for this tilt series
6263
collected_ids = murfey_db.exec(
6364
select(DataCollectionGroup, DataCollection, ProcessingJob, AutoProcProgram)
6465
.where(DataCollectionGroup.session_id == session_id)
@@ -67,8 +68,7 @@ def process_sxt_tilt_series_workflow(
6768
.where(DataCollection.dcg_id == DataCollectionGroup.id)
6869
.where(ProcessingJob.dc_id == DataCollection.id)
6970
.where(AutoProcProgram.pj_id == ProcessingJob.id)
70-
.where(ProcessingJob.recipe == "sxt-aretomo")
71-
).one()
71+
).all()
7272
instrument_name = (
7373
murfey_db.exec(select(Session).where(Session.id == session_id))
7474
.one()
@@ -95,29 +95,34 @@ def process_sxt_tilt_series_workflow(
9595
/ f"{tilt_series.tag}_stack.mrc"
9696
)
9797
stack_file.parent.mkdir(parents=True, exist_ok=True)
98-
zocalo_message = {
99-
"recipes": ["sxt-aretomo"],
100-
"parameters": {
101-
"txrm_file": tilt_series_info.txrm,
102-
"xrm_reference": tilt_series_info.xrm_reference or "",
103-
"dcid": collected_ids[1].id,
104-
"appid": collected_ids[3].id,
105-
"stack_file": str(stack_file),
106-
"tilt_axis": 0,
107-
"pixel_size": tilt_series_info.pixel_size,
108-
"manual_tilt_offset": -tilt_series_info.tilt_offset,
109-
"node_creator_queue": machine_config.node_creator_queue,
110-
},
111-
}
112-
if _transport_object:
113-
logger.info(
114-
f"Sending Zocalo message for processing: {sanitise(str(zocalo_message))}"
115-
)
116-
_transport_object.send("processing_recipe", zocalo_message, new_connection=True)
117-
else:
118-
logger.info(
119-
f"No transport object found. Zocalo message would be {sanitise(str(zocalo_message))}"
120-
)
98+
99+
for recipe_ids in collected_ids:
100+
# Loop over all processing jobs, and send the alignment recipe for it
101+
zocalo_message = {
102+
"recipes": recipe_ids[2].recipe,
103+
"parameters": {
104+
"txrm_file": tilt_series_info.txrm,
105+
"xrm_reference": tilt_series_info.xrm_reference or "",
106+
"dcid": recipe_ids[1].id,
107+
"appid": recipe_ids[3].id,
108+
"stack_file": str(stack_file),
109+
"tilt_axis": 0,
110+
"pixel_size": tilt_series_info.pixel_size,
111+
"manual_tilt_offset": -tilt_series_info.tilt_offset,
112+
"node_creator_queue": machine_config.node_creator_queue,
113+
},
114+
}
115+
if _transport_object:
116+
logger.info(
117+
f"Sending Zocalo message for processing: {sanitise(str(zocalo_message))}"
118+
)
119+
_transport_object.send(
120+
"processing_recipe", zocalo_message, new_connection=True
121+
)
122+
else:
123+
logger.info(
124+
f"No transport object found. Zocalo message would be {sanitise(str(zocalo_message))}"
125+
)
121126
tilt_series.processing_requested = True
122127
murfey_db.add(tilt_series)
123128
murfey_db.commit()

0 commit comments

Comments
 (0)