Tuesday, July 26, 2011

I feel like a happy frog...

...because I caught a major bug in my code today.
Well, I suppose that means I did something horribly wrong in the past weeks, but it definitely feels good to at least know that I've fixed it. Anyways, I again edited my code for findptsources(...). You may have noticed that in my previous posts dealing with point sources, the aperture rings were off-center. They're fine now. See the picture below:
The aperture ring is very nicely centered on the brightest parts of the object. This is because the array of point sources changed. If I open up the Python interpreter and type:

>>> from startup import*
>>> im=phot2.Image(arr)
>>> im.findptsources(darkpix=0.95)

I get this:
[(116, 22), (83, 40), (25, 53), (94, 72), (94, 76), (22, 100), (52, 128)]

All the point sources are isolated, and there are very few of them, which is nice to start with. Also notice that (94,72) instead of (92,72) is the point source, which makes sense, since if we type in:

>>> im.maxx
94
>>> im.maxy
72

we get the x and y coordinates of the pixel in the graphic with the maximum flux, and thus the point source (assuming of course it's not a cosmic ray).

So, hopefully this will be the last time I edit the point source finder code. And hopefully tomorrow I can just focus on making my point source simulator.

-----
I also worked a little bit on the Point Source Simulator today and cleaned up some coding for my Point Source Detector. But then I got distracted by the bug mentioned above...
-----
Learned (the hard way):
-Array elements are organized differently than pixel coordinates! >.<
To-Do:
-Finish the Point Source Simulator
-Edit some more code for my Point Source Detector and make it more precise in detecting point sources (as in, not make it accidentally detect cosmic rays)

No comments:

Post a Comment