Currently I am trying to calculate the fwhm of some watertank scans with pylinac.core.profile.fwxm and I am getting not the expected results. I use the interpolate option.
When I calculate the FWHM with the fwxm I get 998.95, when I do the calculation by hand I get 1002.66.
The relevant measurement data:
index position values
295 -50.5 0.602185
296 -50.4 0.619593
... max 1.222600
1298 49.8 0.614352
1299 49.9 0.597763
I tried to follow the code but it was a bit hard to read. In which way does Pylinac do the interpolation? I just did a linear interpolation between the data values.
Any hints?
With kind regards.
Thomas Bezold
Hi Thomas,
What height value are you using? I.e. the x parameter of the fwhm method. Default interpolation is linear but can be specified as a class attr.
The reason is probably because pylinac takes the minimum of each side as the lower value and finds the 50% level between those values. If the lower values on each side are the same then the result will be what you expect, but if one side has some background then the result will not simply be the FWHM as you expect because pylinac tries to account for noise. This tactic is very useful for images with non-uniform background.