Documentation for LightDelay.To
What is LightDelay.To?
LightDelay.To is a service that uses orbital elements and ephemerides from a variety of sources to provide accurate distance calculations between a wide range of solar bodies.
Who is LightDelay.To?
I'm just a hacker who knows how to use Python and who decided to read a lot of documentation on astrometrics libraries. This service is independent and non-profit. The code is available on GitHub (link at the top of every page) and pull requests are welcomed and greatly appreciated!
Why is LightDelay.To?
During the InSight Mars mission landing, I was watching the stream and wondering how significant the communications delay was, how long ago the events we were watching had actually occurred. While it's easy to find average speed-of-light delays, I couldn't find anywhere that listed the current communications delay to Mars without pulling out an astrometrics package and calculating it myself. So I decided to put this together.
The LightDelay.To API is very simple. Issue a GET request to a URL of the form "https://lightdelay.to/location1/location2/time/". You can leave off any parameters you don't need, and you can list the parameters in any order. We will do our best to return the result you're looking for.
If you give a single location, we will return the distance from Earth to that solar system object. If you give two locations, we will return the distance between those two objects. If you give a time, we will calculate the distance as of that time. If you don't, we'll use the current time. See? Pretty straightforward.
You can input a time in any format that Python's
dateutil.parser understands. Advertised as supporting "most known formats", you should find this parser to be pretty flexible and very DWIMmy. Here are a few examples:
- https://lightdelay.to/2000/: A year alone is fine. You'll get the current month and day, in that year.
- https://lightdelay.to/2000-07/: As is a year and a month. Again, the current day of the month will be used to fill the missing data.
- https://lightdelay.to/2000-07-04/: Or a year, month, and day.
- https://lightdelay.to/01-02-2000/: This is interpreted as Month - Day - Year if possible, sorry non-Americans.
- https://lightdelay.to/28-02-2000/: No such month as "28", so this one is Day - Month - Year.
- https://lightdelay.to/2000-01-01 10:00/: If you don't give a time zone, we will assume UTC.
- https://lightdelay.to/2000-01-01 10:00 UTC-4/: If you want to give a time zone, do so in UTC offset format.
You can select a location by name. Currently support is limited to only a few categories of object, but I'm working on adding more.
Planets, the Sun, and Earth's Moon are calculated using the solar system ephemerides built in to the AstroPy library. Data should be accurate for the range from 1950 to 2050, and may still be relatively accurate outside that window. Examples:
Anything classified as an asteroid by the Minor Planet Center is available as well. This includes dwarf planets as well as asteroids of all sizes, including:
Comets are also available from the Minor Planet Center database, however, they aren't yet fully supported here. One issue is that comets are named using names like "9P/Tempel", but the
/ character is also the HTML
path separator. "
Tempel" doesn't work because that's also an asteroid, and "
Tempel 1" doesn't work because the MPC API doesn't support it. "
9P" alone does work
in a pinch, though!
- https://lightdelay.to/1995_O1/: Using part of the official designation of
C/1995 O1, better known as Comet Hale-Bopp.
- https://lightdelay.to/1P_Halley/: If you replace the
1P/Halleywith an underscore, you'll get the correct page. For example try typing
1P/Halleyin the search box.
Locations on Earth
There are some important caveats. I'm a coder, not an astrometrist, so I'm not an expert on the accuracy of these data sources or the validity of this data either into the past or into the future. I have it on good authority that orbital dynamics are actually rather complicated. Here's what should work:
- Planets: Positions should be accurate between the years 1950 and 2050.
- Minor Planets: Positions should be accurate from when they were first observed until the present day, however, predictions into the future may not be accurate. Accuracy will generally be best at the present time, and uncertainty will gradually increase over time.