using EphemerisSources
using AstroTime, Dates
= AstroTime.TTEpoch(now())
start = start + 1years
stop = "1 day"
step = "SEMB-L2"
wrt = "KM-S"
units
= ephemeris("earth", start, stop, step; wrt = wrt, units = units)
earth = ephemeris("jwst", start, stop, step; wrt = wrt, units = units)
JWST = ephemeris("gaia", start, stop, step; wrt = wrt, units = units); GAIA
This page is a pre-print! The published paper is available at the Journal of Open Source Software.
NASA’s James Webb Space Telescope (JWST) and ESA’s Gaia star surveyor both orbit the Earth-Sun Lagrange Point #2. How close do the two spacecraft get to one another? How do their orbits compare? Simple ephemeris queries to the Horizons ephemeris platform can answer these questions!
First, let’s fetch Cartesian state vector data for Earth, JWST, and Gaia with respect to the Sun. We can do so using HorizonsEphemeris.ephemeris
, which is re-exported by EphemerisSources.jl
.
In [4]:
By plotting all three bodies’ orbits about the Sun, we can see that Gaia has a much larger orbit than JWST.
In [5]:
using Plots
= (;
artsy = false,
grid = "",
title = 8,
markersize = :julia,
palette = 200,
dpi = (600, 600),
size = "X (KM)",
xlabel = "Y (KM)",
ylabel
)
= plot(; artsy...)
fig plot!(fig, earth.x, earth.y, label = "Earth")
plot!(fig, JWST.x, JWST.y, label = "JWST")
plot!(fig, GAIA.x, GAIA.y, label = "GAIA")
But what is the closest approach distance between the two spacecraft? We can all breathe easy: they aren’t close to colliding in the next year!
In [7]:
using Dates
distance(x, y, z) = sqrt(x^2 + y^2 + z^2)
plot(
collect(1:length(earth.cal)),
distance(JWST.x - GAIA.x, JWST.y - GAIA.y, JWST.z - GAIA.z);
@. ...,
artsy= :none,
label = "Days",
xlabel = "Distance (KM)",
ylabel )