aglie / meerkat

A python program for performing reciprocal space reconstruction from single crystal x-ray measurements.
MIT License
9 stars 6 forks source link

Uneven Background Intensity #12

Open bizartor opened 9 years ago

bizartor commented 9 years ago

In the process of comparing reconstructed planes between those produced by meerkat and those done in APEX2 from the same data I noticed some differences in background intensity. Whereas in APEX2 the background is fairly consistent across the entire reconstructed plane, those from meerkat seem to show an increase in background (and possibly peak) intensity towards the edges of the plane. Raw frames themselves have an even background distribution across the detector, so I'm wondering what the cause of the difference in reconstruction is? Would it be possible to get meerkat to produce an even background such such that weak reflections are not lost due to the colour scaling needed to accommodate the range in background intensity?

APEX2 images. The background is always consistent across the plane, irrespective of the plane and colour axis limits. q-0kl_res1 3_thick_0 01 q-hk0_res1 3_thick_0 05

Meerkat images. Reconstructing on a finer grid shows the same behaviour. isf_b_136_15_01_test_orthonormal_plane_ h_0 000to0 000_l isf_b_136_15_01_test_orthonormal_plane_ h_k_0 000to0 000

aglie commented 9 years ago

It is quite frequent that background increases towards the edges of the reciprocal space. It usually happens when the detector contains uniform internal noise like in the case of CCD or image plate detectors.

There is a good reason for such non-uniform background in the reconstruction. Notice, that the useful signal on each detector pixel is proportional to the solid angle which this detector pixel covers. The pixels which have smaller θ occupy bigger solid angle:

solid angle

Since internal noise is constant on detector, the pixels with smaller θ contain better signal over noise ratio. In the reconstruction that means that the closer pixel is to the center, the less noise it contains, exactly as you see in meerkat reconstruction.

I can assume, that in the APEX2 reconstruction, the correction to the solid angle was not performed, that is why in that image the background in the reconstruction is uniform. Such images are ok for visual inspection, but should not be used in modelling. The solid angle correction for reconstruction is the equivalent of Lorentz factor correction for Bragg peaks and should be applied before any numerical modelling is performed.

In order to make your images better visually, I suggest the following: I will add an option to add a frame with background estimate to meerkat. And during reconstruction, the background will be subtracted from each reconstructed image. Is it possible for you to measure say some 100 frames with closed shutter to estimate the background of your detector?

bizartor commented 9 years ago

Thank you for the detailed explanation @aglie. When I have a moment I shall check whether we have background images of that particular detector, but I doubt it. I suppose the beamline staff will likely have some though. Would it also be feasible to subtract a constant or add an option to not apply the solid-angle correction for users that can't get background frames?

aglie commented 8 years ago

Probably it is already too late to answer this question, but just for record: I think it is a bad idea not to apply those corrections. In case where detector has intrinsic noise, it is probably a good idea to separately reconstruct and subtract background.

bizartor commented 8 years ago

Thanks for letting me know @aglie. I can appreciate why you would want to keep the reconstruction as correct as possible. If I recall, at the time we already had the information we needed from the reconstructions, and I haven't needed to use meerkat since then. I think this software has a lot more flexibility compared to the reconstructions in APEX2, so I will use it again when the need calls.

aglie commented 8 years ago

Thank you very much for this nice review. I will try to improve the program so that it would be easier to use.

bizartor commented 8 years ago

I imagine having some documentation for how to do this background subtraction (and the microsteps command) would be useful.