Home
Name Modified Size InfoDownloads / Week
README.md 2021-12-21 4.0 kB
main.py 2021-12-21 13.1 kB
Totals: 2 Items   17.1 kB 0

Python starfield splitter

A Python Script I made to split a starfield image into several layers.

To be able to use the script, PixInsight with an installed Gaia data catalogue is required, as it needs the exported astrometry data text file.


(c) Copyright Kevins Astrophotography. All Rights Reserved. The script is published under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. Code or portions of code may not be copied or used without appropriate credit given to author. This script also refers to third party open source software components. Please see individual license information for the used modules.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



Prerequisites

The script is made with Python 3.9 and needs the following modules installed.
- PIL
- os
- pandas
- sqlite3
- pathlib
- math
- glob
- shutil



How to use

The images must be available as png. The data basis for the splitting is the text export of the Gaia astrometry data from PixInsight (AnnotateImage). To create a starless image and an image with stars only, the StarNet process in PixInsight can be used.

More detailed instructions will be linked here in the future.


Example of a final animation made with the splitted star layers:
https://youtu.be/K2ZZHiiZl5o



Settings

project_name - Name of the project. A sub folder containing this name will be created
splitstep - Steps for layer creation based on the magnitude
image_file_star_orig - filename or path for the starfield image
image_file_starless_orig - filename or path for the starless image
objects_file - filename or path for the exported text file from PixInsight

search_box - Size in pixels for the search box of the star center
iterations - Number of iterations to find the star center
max_star_size - Maximum size of the star that is measured
background_threshold_big - Threshold value for rejection of background pixels on big stars
background_threshold_small - Threshold value for rejection of background pixels on small stars
big_small_change - Number of round to switch from small star to big star
round_threshold_big - Maximum number of all pixel values per round to quit a star size search of big stars
round_threshold_small - Maximum number of all pixel values per round to quit a star size search of small stars

The settings depend very much on the characteristics of the image and require some testing. Unfortunately I could only test with my own pictures. However, you are welcome to send me pictures to test and optimise the code to kevins.astrophotography@gmail.com.



Your contributions are welcome

As you surely know how time-consuming and cost-intensive hobby astronomy is, please consider supporting this project via
PayPal: kevins.astrophotography@gmail.com or
Bitcoin: 1LSYjLcet6bkuJASeMm9XNu2U9gvHCgZTc
You are also welcome to support this project with suggestions and ideas for improvement.
All contributions are gratefully accepted and go towards development of this and other projects.

Source: README.md, updated 2021-12-21