Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/cdtools/tools/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,16 +1330,22 @@ def standardize_reconstruction_pair(
results : dict
A dictionary containing the synthesized results
"""
# We get the two half-data reconstructions
# We get the two half-data reconstructions
obj_1, probe_1, weights_1 = half_1['obj'],half_1['probe'],half_1['weights']
obj_2, probe_2, weights_2 = half_2['obj'],half_2['probe'],half_2['weights']


# The two object arrays can differ in size by a few pixels if the scanned
# fields of view differ slightly. We crop both to their common shape
n_rows = min(obj_1.shape[-2], obj_2.shape[-2])
n_cols = min(obj_1.shape[-1], obj_2.shape[-1])
obj_1 = obj_1[..., :n_rows, :n_cols]
obj_2 = obj_2[..., :n_rows, :n_cols]

if correct_phase_ramp:
obj_1, probe_1 = remove_phase_ramp(
half_1['obj'], window, probe=half_1['probe'])
obj_1, window, probe=probe_1)
obj_2, probe_2 = remove_phase_ramp(
half_2['obj'], window, probe=half_2['probe'])
obj_2, window, probe=probe_2)

# TODO weights are not included
if correct_amplitude_exponent:
Expand Down