November 11th, 2009 by Brian
The two binning routines made available bin _only_, they do not normalise to the number of pixels in the bins. In order to achieve this, adapt the weighted binning routine by changing line 39 to:
Ibin(bini)=sum(Isort(qi(1):qi(2)).*weightfact)./sum(weightfact);
I have not looked at a similar solution for the equal intensity binning routine yet.
Posted in Uncategorized | No Comments
November 11th, 2009 by Brian
Hello,
Once again, I’d like to present a binning routine. This time it’s a weighted binning routine, which instead of simply summing all intensity in one bin of a certain width, it splits the intensity to neighbouring bins based on their proximity to the bin centres:

As is explained in the graphics, this implies that there is a loss of intensity required in order to keep the first and last bin in line with the other bins. The advantage of this binning function, however, is that it should result in a smooth binned curve with no moire-like effects.
Speedwise, it bins a 2048×2048 image in about 7 seconds on a 2.4 GHz Intel core 2 duo processor (single core), which is just as quick as the equal intensity binning routine discussed in a previous post. As always, if you have any suggestions or improvements, please let me know so I can update the code.
The code itself can be found here: binning_weighted code
It is also given below (behind the “more” button). Leave comments please!
Read the rest of this entry »
Posted in Uncategorized | No Comments