File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
operators/quantem-direct-ptycho Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -259,19 +259,12 @@ def quantem_direct_ptycho(
259259 'rotation_angle' : direct_ptycho .rotation_angle ,
260260 },
261261 }
262+ header = MessageHeader (subject = MessageSubject .BYTES , meta = output_meta )
263+ return BytesMessage (header = header , data = output_bytes )
262264 except Exception as e :
263- zeros_out = np .zeros (accumulator .scan_shape , dtype = np .uint8 )
264265 logger .exception (
265266 f"Direct ptychography reconstruction failed for scan { scan_number } : { e } "
266267 )
267- output_bytes = zeros_out .tobytes ()
268- output_meta = {
269- "scan_number" : scan_number ,
270- "accumulated_messages" : accumulator .num_batches_added ,
271- "shape" : zeros_out .shape ,
272- "dtype" : str (zeros_out .dtype ),
273- "source_operator" : "quantem-direct-ptycho-failed" ,
274- }
275268 finally :
276269 if QUANTEM_DEVICE == "gpu" :
277270 try :
@@ -281,5 +274,3 @@ def quantem_direct_ptycho(
281274 gc .collect ()
282275 except Exception :
283276 logger .exception ("Failed to clean up DirectPtychography resources." )
284- header = MessageHeader (subject = MessageSubject .BYTES , meta = output_meta )
285- return BytesMessage (header = header , data = output_bytes )
You can’t perform that action at this time.
0 commit comments