Tuesday, March 26, 2013

Python Practice Results

Well, the Python training course last week was a bit tiring (three eight-hour days in a row at a fast-and-furious pace), but also quite interesting. I definitely learned a lot of new stuff from it.

Some of the exercises we did had us creating graphs or plots, and while they don't mean much in and of themselves, I thought I'd show one or two of them off.

This picture is hard to see at the size it shows up, but it represents a noisy data set to which various lines have been fitted. This was quite inspiring for me because I've actually tried a few times in the past to fit lines using NumPy and hadn't been able to do so on my own.

(If you can't read the legend, the gray dots are points from the original curve with some random noise added, the blue, green, and red lines are various order polynomial fits [linear, quadratic, and cubic, respectively], the dashed line is a least-squares fit, and the gray line at the bottom is the residuals between the least-squares fit and the original line.)

This second picture below is interesting because it represents some real-world data. The spiky black line is readings from the water vapor meter (WVM) on the James Clerk Maxwell Telescope for a period of one night a few weeks ago, taken every 1.2 seconds. It measures the amount of precipitable water vapor in the atmosphere in the direction it (and the telescope) is pointing. (Lower is better, as water is extremely efficient at intercepting the sub-millimeter wavelength light that the JCMT collects.) The extremely thin red, blue, and green lines are again polynomial fits of various orders (and possibly a least-squares fit, I didn't get time to add a legend before we had to move on since this was actual data and not an exercise).

Anyway, just thought I'd share some of what we did. I'm really looking forward to being able to put some of this new knowledge to work in the future, and I'm especially excited to be able to do my own fits to data.

No comments:

Post a Comment

Think I said something interesting or insightful? Let me know what you thought! Or even just drop in and say "hi" once in a while - I always enjoy reading comments.