carnisj / bcdi

BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data
Other
23 stars 17 forks source link

Calculation of the offset of the phase #304

Closed mirichard-S closed 2 years ago

mirichard-S commented 2 years ago

Hi Jérôme,

Can you remind me how the offset of the phase is calculated? Is the phase equal to zero at the voxel corresponding to the center of mass of the reconstructed modulus? Or is the phase offset equal to the mean of the phase inside the support?

Best,

carnisj commented 2 years ago

In postprocessing.process_scan:

image

The parameters are already described in the example config file and docstrings:

offset_method: 'mean' or 'com' (center of mass). This phase value is subtracted to the phase phase_offset_origin: pixel coordinates or None. If None, the phase origin is determined by phase_offset phase_offset: use this to offset manually the origin of the phase to the desired value

carnisj commented 2 years ago

I will clean up a bit the function remove_offset and its docstring, but in principle one should be able to get the desired behavior with the existing parameters, correct?