Skip to main content

Automatically identifying satellite trails

2 posts / 0 new
Last post
Bikeman's picture
Automatically identifying satellite trails


I'm participating in a project that calls for uploading entire field images to a project server where the photometry is done. My images are usually stacks of very short exposures and occasionally I catch satellites that have so bright trails that they show up in the stacked image and potentially confuse the photometry.

So I would like to identify the frames with satellite tracks in them and exclude them from stacking, and since we are talking 100s of frames, an automatic procedure would be nice. 

So I wonder if anyone is using an off-the-shelf solution that is superior to a very simplistic procedure I've come up with:

I'm experimenting with running my raw frames thru ImageMagick's [1] "-hough-lines" [2] filter to identify straight white lines against a black background, after increasing the contrast. So under Linux or in cygwin [3] on Windows, it comes down to a very simple command line like

ls -1 directory/*.fits | xargs -Ixxx -P4 convert xxx -white-threshold 0.25% -hough-lines 4x4+300 xxx.mvg


which will run (with 4 jobs in parallel to use multicore CPUs) over all *.fits files in a given directory and will create for each frame a text-file with a vector-graphics representation of any identified bright track (you might need to adjust the parameters for the white-threshold and minimum line length for your images)

For frames without an identified track, the output will look like this

$ cat V1491Cyg_00242_19_23_50Z_V.fits.mvg
# Hough line transform: 4x4+300
viewbox 0 0 3096 2080


However for a frame with a detected sat trail, it will have one or more lines beginning with "line" like this:

# Hough line transform: 4x4+300
viewbox 0 0 3096 2080
line 3182.26,0 2425.2,2080 # 369
line 3190.77,0 2433.71,2080 # 442
line 3195.03,0 2437.97,2080 # 443
line 3181.59,0 2465.39,2080 # 1486
line 3162.39,0 2486.56,2080 # 1212
line 3149.02,0 2513.1,2080 # 381
line 3156.34,0 2520.42,2080 # 419
line 3157.39,0 2521.47,2080 # 419


So after executing the command line above, you can identify frames with satellite tracks like this :

egrep "^line" directory/*.mvg | cut -f1 -d\: | sort | uniq | xargs -I xxx basename xxx .mvg



OK, so let's check whether  that frame indeed was the culprit:

Ok, that worked. Now this was a fairly obvious trail and this method needs more testing and tweeking (e.g. maybe use a sigmoid-contrast filter up front?). And it didn't even involve artificial intelligence and training a neural network ;-)

But I guess there are alternatives that people out there use.

The command line above took about 0.24sec per frame (3000x2000 pixel frame, so 12MB each), run on an SSD and a CPU with 4 cores. But runtime will be slower for very crowded fields. 

Any feedback is welcome...this might get more relevant in the future with those mega-constellations like SpaceX's Starlink etc quickly populating the night sky with more moving light pollution.

Clear Skies





Bikeman's picture
quick addendum:

quick addendum:

The obvious enemy of this method is the diffraction spike. Now, the good thing here is that all the diffraction spikes will be relatively short compared to the common sat trail and they all have the exact same orientation (and will appear in pairs at right angle). So since the Hough-Transform output contains the coordinates of each detected line's start and end points, a script can identify the orientation angle of the identified lines and if it's close to that of the diffration spikes for your setup and if it has a buddy at right angles, you might not want to consider the identified line a sat trail. But this is an area where neural networks might shine to differentiate diffraction spikes and sat trails.

Also I don't want to appear to claim this is a new idea, e.g. see :  for how the pros are doing this. I just want something that is useful with minimum effort in setting up and executing.



P.S.: FWIW, the sat captured here seems to be NROL-47 / "Topaz-5" , a US spy sat, so not blaming SpaceX here :-)

Log in to post comments
AAVSO 49 Bay State Rd. Cambridge, MA 02138 617-354-0484