tjlane / pypad

Intuitive, high-level interface to the CSPAD
Other
2 stars 1 forks source link

change angular sum to angular average #5

Closed sellberg closed 11 years ago

sellberg commented 11 years ago

Might not be so important when things are thresholded to zeros and ones, but it might skew the peak shape since higher-raidii are favored. Should be an easy fix.

change_angular_sum_to_angular_avg

sellberg commented 11 years ago

This turned out to be trickier than I thought, I change the non-binary part of intensity_profile so it was supposed to compute angular averages instead of angular sums (I just added a line that calculated the histogram without weighting with intensities and normalizes the bin_values by that), and the result seems to be fine when I print individual values, but for some reason it changes the Q-scale in score:

ANGULAR SUM screen shot 2013-05-23 at 18 42 51

ANGULAR AVERAGE screen shot 2013-05-23 at 18 47 42

Any idea why it does this?!?!? I can't seem to find anything depending on cspad.intensity_profile() that determines the Q-scale of pixels....

sellberg commented 11 years ago

the circle radii in the left 2D image actually changes from:

ring radius: 509.502360 ring radius: 616.707226

to:

ring radius: 662.063486 ring radius: 801.368881

when I change the angular sum to angular average in cspad.intensity_profile() and I've double checked that I do not change bin_centers by accident.

tjlane commented 11 years ago

@sellberg and I discovered that the real issue is the peak-finding algorithm in score. That needs to be optimized.

sellberg commented 11 years ago

peak-finding algorithm in score has been improved and the script works once again as intended on the gold example, may need further testing..

screen shot 2013-05-30 at 23 01 38

sellberg commented 11 years ago

the binary part of intensity_profile cspad.py seems to already be an angular average, confirmed by genfilter

screen shot 2013-05-30 at 22 38 46