Today we wrote a lot of code using MATLAB. A couple weeks ago I started learning Python through an online course. Python is the first language I've programmed in, so I'm still pretty new to the concept, but luckily I've been able to pick up principle ideas fairly quickly. Using the photos I took yesterday, we used the code to crop each of the 100 pictures to a 50x50 pixel region where the spot of light was (the original pictures were about 3000x4000 pixels of mostly black space). We then ordered the pictures into groups of 10 for each of the 10 distances (spotStacks) and took the median of each group (medianSpot), putting each of these medians into their own variable group (medianStack). Taking these medianSpots, we utilized a function called fmgaussfit, which we use to fit a Gaussian curve to each of the data sets (we tried several other methods, but this function was the most efficient).
This is an example of a Gaussian curve, where, in our case, the height would correspond to the intensity of light incident on each pixel. Our raw data is asymmetrical and rather jagged, so by mapping a close mathematical function to it, we can more easily interpret our data, taking information such as the FWHM, or Full-Width at Half Maximum, the width of the Gaussian at half the amplitude, in the x and y-directions. This allows us to compare the size of our spot of light as we focus and unfocus the camera.
No comments:
Post a Comment