Star Stacker
A Linux-compatible star stacker in C
Purpose
One of my hobbies is astronomy. In it, one of my favourite things to do is to take star trail images. To do that, images are taken of a part of the sky for a long time, in 30-second intervals. However, to make the star trails visible, a stacking software is needed. Unfortunately, no such software is available for Linux, and the ones that do exist are mainly proprietary. I wanted to change that, so I built this star tracker. This is also meant to help the other astronomers, so they can get quality star trails with full freedom of customisation.
Description
This star stacker takes a set of input images, stacks the stars, all the while removing camera noise. It is designed to be as simple and fast as possible, while getting the job done.
Files
Access the files from here: https://github.com/dakshsriv/Star-Stacker/
Files and their purpose:
- helpers.c contains the necessary helper functions to perform the task
- helpers.h is the header file for helpers.c. It contains useful datatypes
- stack.c is the code that executes the stacking process
- stack is the compiled product
Method
- Import header file
- Prepare variables for file listing
- Retrieve files and error-check
- Open the output file
- Write the output header
- Copy in first file to fill in the background pixels
- Prepare RGB arrays
- Check if input file can be opened
- Validate if input file is a bitmap by analyzing header
- Skip pixel if pixel is too dark
- Skip pixel if camera noise is present
- Write pixel in output array
- Repeat steps 10-12 with each column
- Repeat steps 10-13 with each row
- Clear input array and increase count
- Repeat steps 8-15 with each input file
- Write the output array to the output file