Python Forum

Full Version: Find the centroids of all the stars in a fits image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a fits image including multiple stars, for each of which I want to find the centroid.
Here is an example image file.

Image file(fits format): https://www.dropbox.com/s/dm6rnse41a7sum....fits?dl=0

The python code below gives a 2D density map of the image file above:
fits_filename = 'imgData.fits'
self.pixels = astropy.io.fits.getdata(fits_filename)
plt.figure()
plt.imshow(self.pixels)
plt.show()
The result: https://www.dropbox.com/s/ry22u9v91wdxzf...1.png?dl=0

I'm a beginner in Python and a stranger for a vast variety of Python functions. Therefore I want to see many ideas. How do you guys implement this purpose in Python?
Looking at the result picture, can you explain a little bit more detailed what you want to do with it.
I don´t understand "finding the centroid".
(Jul-26-2019, 03:17 PM)ThomasL Wrote: [ -> ]Looking at the result picture, can you explain a little bit more detailed what you want to do with it.
I don´t understand "finding the centroid".

You can see many dots(stars) in the image. I want to get the centroid position of each star in the image.