Wednesday, August 9, 2017

Day 25

I spent today writing code to analyze our data from the past week or so. Originally we tried mapping Gaussians to our data, but because we were on a logarithmic scale, most of our data points were negative, because our spot is very small and dim. Unfortunately, the Gaussian fit function in MATLAB does not deal well with negative numbers, so it mapped a Gaussian function to only the very few pixels around the center of our PSF and ignored the rest of it. Fortunately, there are many ways to acquire the data that we need, so we were able to calculate the encircled energy of each of our datasets. Encircled energy is, essentially, how much of the total energy (as a percentage) is contained within any given radius from the center of the function. We can calculate the approximate radius of the spot by finding the radius within which 90-95% of the data is contained.
Without a window in front of the sensor, the function looks like this, with the radius being about 15 counts wide, about 1.5 pixels. The function looked quite similar with a coverslip and a microscope slide, but looked a fair amount wider when it came to the thickest window.
Originally we saw a dip in the plot, which was odd, because we should not have the energy decreasing as more of the function is included; that could only happen if we had negative pixels.
Upon closer investigation, it appeared we did have negative values in an oddly uniform pattern around the spot. These negative values occurred because we magnified our data, multiplying our x and y axes by 10 each, leaving the algorithm to interpolate data for the new points. It turns out the default setting takes values from the nearest 4x4 group of pixels, which can lead the graph to believe there is a larger downward trend than actually exists in the data, and can give us values outside our original data range (in this case, meaning negative values). I was able to fix this by altering the settings to take only data from a 2x2 pixel neighbourhood for interpolation purposes.

No comments:

Post a Comment