xpdAcq / xpdAn

Analysis Pipelines and Tools for XPD
http://xpdacq.github.io/xpdAn/
Other
2 stars 10 forks source link

ad hoc polarization correction #31

Open sbillinge opened 7 years ago

sbillinge commented 7 years ago

if we have a full Scherrer ring, the polarization effects cause a four-fold modulation of intensity around the ring with a well defined phase. it is a multiplicative correction. So it is screaming out for an ad hoc correction where, during the calibration sequence, we find a scherrer ring (e.g., from Ni or whatever is the calibrant), fit the intensity around the ring to a sine-wave and refine the amplitude (we may need a small correction for the phase so that could be refinable too), then multiply the intensities by the amplitude of the refined sine-wave.

This will do the correction without any inputs (fully automated). We can also extract from this what the actual beam polarization was (e.g., 99%), and return that to the header info.

This could be a nice mini project for an undergrad or someone, or we could do it quickly ourselves.

CJ-Wright commented 7 years ago

The only potential hiccup in this scheme is the masking. Usually we need the polarization correction to be performed before masking, however for this scheme to work the image will need to be masked (otherwise we will get artifacts from the non-uniformity of the data). We might have to do the whole process in a loop.

sbillinge commented 7 years ago

We don't need to mask to get a good calibration. Typically. Unlikely to need a loop, so only go there if the no-loop option is giving problems. Simpler is always better. On Mon, Oct 3, 2016 at 12:55 PM Christopher J. Wright < notifications@github.com> wrote:

The only potential hiccup in this scheme is the masking. Usually we need the polarization correction to be performed before masking, however for this scheme to work the image will need to be masked (otherwise we will get artifacts from the non-uniformity of the data). We might have to do the whole process in a loop.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xpdAcq/xpdAn/issues/31#issuecomment-251161277, or mute the thread https://github.com/notifications/unsubscribe-auth/AEDrUeFxRvlQA_W3VBH7QvdTuUs79DJ8ks5qwTOTgaJpZM4KMCVa .

sbillinge commented 7 years ago

Wait, I misread this. But the main comment remains...I am guessing it will work even without a mask. On Tue, Oct 4, 2016 at 9:22 AM Simon Billinge simon.billinge@gmail.com wrote:

We don't need to mask to get a good calibration. Typically. Unlikely to need a loop, so only go there if the no-loop option is giving problems. Simpler is always better. On Mon, Oct 3, 2016 at 12:55 PM Christopher J. Wright < notifications@github.com> wrote:

The only potential hiccup in this scheme is the masking. Usually we need the polarization correction to be performed before masking, however for this scheme to work the image will need to be masked (otherwise we will get artifacts from the non-uniformity of the data). We might have to do the whole process in a loop.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xpdAcq/xpdAn/issues/31#issuecomment-251161277, or mute the thread https://github.com/notifications/unsubscribe-auth/AEDrUeFxRvlQA_W3VBH7QvdTuUs79DJ8ks5qwTOTgaJpZM4KMCVa .

CJ-Wright commented 7 years ago

Here's a gist which I think does the trick. While masking did shift the polarization from .638 to .678 looped masking caused no changes in the fitted polarization. Thoughts?

CJ-Wright commented 6 years ago

This will require the rest of the pixel response function to be sorted out first so the detector has a shot at being azimuthally uniform.

sbillinge commented 6 years ago

👍