Thursday, July 21, 2011

Array Splicing

I'm currently refining my code that finds point sources. However, I've been stuck on this same problem the whole day:

I have here a list of point sources from one of the FITS images:

[(42, 64), (43, 64), (91, 72), (92, 72), (93, 72), (94, 73), (95, 73), (94, 76), (95, 76), (91, 77), (92, 77), (93, 77), (37, 79), (52, 95), (98, 100)]
Each tuple is a coordinate (x,y). If you look carefully, you'll note that there seems to be many rows of "point sources". This is because at these points, the FITS array recorded the same amounts of photons. But a point source should be a single point that is brighter than all its surrounding points. It should be the point of the star (or whatever object you are looking at). So I need to somehow sum up all the x coordinates for each row and then return the average of the x coordinates to find the midpoint of each "row". For example, instead of returning (91, 77), (92, 77), (93, 77), the program should return only (92, 77) since it's the midpoint of the row at y coordinate 77. But to do this, I need to figure out a way to splice my array based solely on the row number (the y coordinate). This proves to be rather difficult - especially if I want to avoid as many for loops as I can. 


I'll think about this tomorrow. 


Learned:
-A bunch of array manipulation functions
To-Do:
-Finish this task
-Create a point source simulator

No comments:

Post a Comment