Notes

Building "Astronauts for Dinner"

March 22, 2026

When I first saw XKCD #2883, I thought that surely someone had already built a calculator to check when astronauts had been over your house. After some research, I found no such site. The only tools available could tell you when the ISS had been visible from your location (which covers a very wide area) or where the ISS was at a given point in time. No reverse search existed, so I added the idea to my list of potential projects and left it alone for a while.

At the end of last year I decided to look into the feasibility of such a tool and came up with an approach that I thought would lead to acceptable search times, given that I wanted to run the page on a basic VM.

The solution I came up with was to take historical TLE data for the ISS and pre-generate coarse orbital data at 20-second intervals, storing the ground track coordinates in a database. When a user searches for a location on the globe, I can then query my database for samples that fall within a radius of that location. This radius is chosen as the satellite's velocity multiplied by the coarse interval length. This ensures that any pass that could possibly be the closest pass will have a sample returned by the query. After deduplicating the results, I take this list of potential matches and perform multiple steps of golden-section search on the orbital model for each candidate, pruning along the way, until I find the closest matches. Orbital tracks for these matches are then calculated and returned.

With this approach, I was able to get search speeds to a level I thought was acceptable, especially given the whimsical nature of this tool. Queries take around 10 seconds on my VM, depending on latitude.

After creating this as a proof-of-concept Python program, I created a backend API service that exposes this search function, along with endpoints for live and historical orbital tracks. A second service periodically fetches updated TLE data for the ISS (and the TSS, which I added later) and updates the database. I also created a frontend that visualizes the concepts and search results using SvelteKit.

The final result allows anyone to check when a manned space station passed over their house. Check it out at astronauts-for-dinner.jonas-langlotz.de

Jonas Langlotz

Hey, I'm Jonas 👋

I'm a software engineer from Berlin, Germany. If you want to read more of my notes, you can find them here.