DEV Community

Cover image for Satellite maths meets reality
Justin
Justin

Posted on

Satellite maths meets reality

This is an image a friend took of a Comet (C/2025 R3 PANSTARRS) that is visiting the night skies currently. It is a 30 second exposure and the Nikon camera had a bad internal clock so it was timestamped at an uncertain time. The exact spot was known.

The challenge: can we reconstruct the same image, with the stars in the same place, identify the exact time it was taken and will everything match up?

This sounds straight forward but when you consider the chain of maths and coordinate systems that has to work correctly, it still boggles my mind that it works.

First, the camera location, from GPS, has to be correct. The GPS location is a lat long, and altitude. But not on a perfect sphere, it is on an oblate spheroid. It is no good putting the camera at 6371000 meters from earth center!

Next, the satellites in the picture have been pinpointed at a random moment in time up to 24 hours before the picture was taken and during the intervening time they have orbited the earth dozens of times. They have to arrive on-time, moving in exactly the correct direction. The propagation is a chain of maths that takes into account orbital mechanics, drag, gravity influences and so on.

All the stars in the picture are in charts, but the universe view precesses (from our viewpoint) slightly over decades so the (fixed) catalog one uses has to be rotated from its start point. This is because the earth has a spin-tilt that changes slightly over time. (There are 1 and 2 orders of magnitude effects on star positions as well that are only taken into account in very high precision astronomy).

The camera has that takes the picture needs very finely engineered optics that introduce no significant distortion. In addition, it needs to be level, and for a long exposure, it needs to be mounted on an electronic device (equatorial mount) that slowly moves it over the shutter duration to track the rotation of the sky, otherwise there would be star-trails.

The simulation has to reproduce the patch of sky (since I care about satellites, not star density or nebulae, only a few key stars are showing) at the exact time, at the exact instant the shutter was pressed, and it has to also mimic the equatorial mount motion, the focal length of the camera and fov h and v. It has to position the satellites correctly and move them over the same period and accumulate the frames in a similar way to a digital camera. If the observer is at the wrong spot, any of the coordinate frame conversions are slightly wrong, if the sky data has not been precessed the right way or in the right magnitude, or if the satellite propagation is off, things will not look right. The trails won't match, or they will, but the stars won't match, or the time will be wrong.

It is a good way to discover small numerical problems not obvious in casual use. In essence, nature has provided us one image and the giant pile of maths has to arrive at the same image, by an entirely synthetic process. Natures pixels on one side, a sim on the other, they have to match.

Just for fun, the simulation also plate-matches any picture you are working to match. Plate matching a process of identifying the brightest stars, measuring their relationship in angles, then searching the star catalog to find the exact piece of the sky pictured, and reverse calculating out (given location and time) what angle the camera must have been at to get that shot. (Elevation and azimuth and also the roll of the camera).

The result:

  • The sim stars (skybox) matches
  • The trails match in location length and so on
  • The plate-solve calculates the correct camera position
  • The Nikon camera was 6 minutes(!) wrong with its internal clock
  • The Roll of the camera was 0.5 degrees

If you have a picture with satellite trails, you can play with matching it to actual satellites. You will need to know the location and approximate time it was taken. The rest you can figure out.

Satellite photo simulator page

Top comments (0)