Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Python software to analyse star images

Software Imaging Astrophotography Astrometry
  • Please log in to reply
5 replies to this topic

#1 Domus

Domus

    Lift Off

  • -----
  • topic starter
  • Posts: 2
  • Joined: 12 Mar 2023

Posted 10 January 2025 - 10:41 AM

I have been writing software in Python to automatically analyse star profiles of FITS files. Even though this exists in commercial packages, I wanted to have the flexibility in choosing how to analyse it and also gain a better understanding and insight on how these calculations/evaluations are done ( roundness, eccentricity).

I have tested my program on FITS files from ASI2600MM Pro mono camera, but I would like to see if it also works fine on files generated by other camera's ( mono).   
I provide a choice on which part of the image frame to analyse ( to stay way from extreme edges where abberations might occur), as well as which type of star to analyse ( brightest, closest to center , etc...).

An image is generated of the original FITS file with an indication of selection frames and an indication of the chosen star for analysis based on input parameters.
Valid stars are encircled in green, invalid in white ( hot pixels, too small or too large ), chosen star encircled in red. 

Filters used are recognised when listed in the FITS file header data.

the output consists of : PNG image file (50x50pixels) for the selected star (for every FITS image) as well as .NPY (Python array) data file and a dump of the star data for every image in XLS (50x50 x nr FITS file ).

The individual image star patches are used to generate contour maps to give better insight in the profile.

Calculated roundness/eccentricity results and all  calculations are logged in a TXT log file.

Automatic ranking is done based on eccentricity and final result is listed in XLS with all details.

I am looking for volunteers to share raw FITS files ( mono camera) with me that I can use to test my software.

Preferably normalised and registered files ( but I can do that myself via Astro Pixel Processor ).

 

In exchange I will provide the results of the analysis and will welcome all feedback.

I attached some files as preview.

 

FYI , I am an amateur and doing this only out of personal interest.

 

Kind regards

Attached Thumbnails

  • 001_star_patch_M101_Red_ellipse.png
  • F01.png
  • L01.png
  • Selected_star_x3262_y2075.png

  • dghent, Bob Denny and scanner97 like this

#2 TheStarsabove

TheStarsabove

    Viking 1

  • -----
  • Posts: 876
  • Joined: 24 Jan 2024

Posted 10 January 2025 - 11:19 AM

This sounds great! This must have taken a whole lot of work O_O!!! I only have a DSLR, so could I split my RGB channels and stack them together to give it to you?



#3 han.k

han.k

    ASTAP Software

  • *****
  • Freeware Developers
  • Posts: 1,276
  • Joined: 09 Mar 2015
  • Loc: the Netherlands

Posted 10 January 2025 - 12:01 PM

I have compared the FWHM and HFD reporting of several programs and noted that they all more or less disagree. To test my own program it I have created an image simulater which creates Gaussian stars at several intensities and noise as background. What does your routine report for the two images below? Note there is star info in the header.

 

I could share real images later.

 

Han

 

Two simulated images.  One with HFD 2.5 and one with HFD 5:

 

https://drive.google...iew?usp=sharing

 


  • Domus likes this

#4 StargazerLuigi

StargazerLuigi

    Vanguard

  • -----
  • Posts: 2,134
  • Joined: 19 Apr 2014
  • Loc: New London Twp, Pennsylvania, USA

Posted 10 January 2025 - 06:38 PM

Have you looked into astropy?

https://www.astropy.org



#5 Domus

Domus

    Lift Off

  • -----
  • topic starter
  • Posts: 2
  • Joined: 12 Mar 2023

Posted 19 January 2025 - 04:37 PM

Han,

 

I used your file to do some tests. I had to adjust my program. I usually have larger stars that I use in my images .
In Python I now use DAOStarfinder ( photutils). I also use Astropy, Numpy and SciPy.  I use ellipse fitting based on contours found for the star and based on some image tresholds. I do not pay so much attention to FWHM values. As you said it differs a lot. My focus is on the aspect ratio and the overal roundness/eccentricity. The contour diagram has helped me a lot to quickly (automatically) identify issues with images. 
Depending on parameters DAOStarfinder finds most of your stars, but not all.
I also noticed artificial hot pixels at the bottom. These are not identified as stars.

I share some initial results 

I do not think it will work for very small stars ( for contours a minimum number of pixels is needed to get some results).

 

https://drive.google...?usp=drive_link

BR/Eric

By the way, I am from Belgium.



#6 han.k

han.k

    ASTAP Software

  • *****
  • Freeware Developers
  • Posts: 1,276
  • Joined: 09 Mar 2015
  • Loc: the Netherlands

Posted 20 January 2025 - 10:50 AM

Han,

 

I used your file to do some tests. I had to adjust my program. I usually have larger stars that I use in my images .
In Python I now use DAOStarfinder ( photutils). I also use Astropy, Numpy and SciPy.  I use ellipse fitting based on contours found for the star and based on some image tresholds. I do not pay so much attention to FWHM values. As you said it differs a lot. My focus is on the aspect ratio and the overal roundness/eccentricity. The contour diagram has helped me a lot to quickly (automatically) identify issues with images. 
Depending on parameters DAOStarfinder finds most of your stars, but not all.
I also noticed artificial hot pixels at the bottom. These are not identified as stars.

 

I have send you a personal message with a link to 4 images files taken with my 100 mm APO telescope and a IMX571 sensor camera.

 

The main purpose of the test images was to test star detection at low SNR values. So at some point the star detection will fail. The noise will also introduce some noise in the measurement. Secondly testing the X, Y measured position in sub pixel accuracy. The generated positions are reported in the header to compare.

 

The goal of almost all imaging is to keep the stars as small as possible and therefore as much possible small details visible. Star diameter ideally should be something between 2 and 4 pixels and ideally maybe 3 pixels wide (FWHM / HFD). This diameter is important for auto-focussing and one of quality values of an image.

 

Han




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics





Also tagged with one or more of these keywords: Software, Imaging, Astrophotography, Astrometry



Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics