JC: I have been working on calculating the centroid coordinates for the detected stars in a given frame.
-Process:
- Algorithm takes list of 'Star coordinates' (max pixel value within array of pixels that constitute a star) and constructs a nxn box of same dimensions as that used for the aperture photometry about the coordinate pixel.
- I decided that, in order to keep my algorithm well compartmentalised, I would input the x_jth and y_ith pixel into the centroid calculation using numpy.meshgrid: (eg)
- For my algorithm, I created a meshgrid the same dimensions as the inset of the total frame being used (algorithm deals in square arrays) starting and ending at the coordinates of the inset. Ie:
- This was done in order to return centroid coordinates relative to the original frame.
-Calculation:
- Here, boxlstarraybacksub is a list containing background-subtracted pixel values for all pixels inside the box (background is the median background value specific to each star). This is our (n_(i,j) - b)
- Here, subindexlstx/subindexlsty are lists of the np.meshgrid array as discussed above.
AS:
This is how the background looks like when the background value for each pixel is calculated; it makes sense that there is a higher ADU value where the hottest stars are.
Stars found by my algorithm are 79. Frame taken with an exposure time of 90 seconds.
Selected some stars to investigate the flux as a function of radius for a circular aperture:
(in this image the radius is set to 50 pixels)
Found that an optimal aperture would be with a radius of 12 pixels.
The error on the flux was calculated as error_flux = sqrt(flux).
The magnitude: m_i = -2.5 * np.log10(f)
The error in the magnitude: abs(-2.5/np.log(10)) * (error_flux/flux)