{ "cells": [ { "cell_type": "markdown", "id": "4a4267fb-3544-47fe-8df5-d69d1a170fc1", "metadata": {}, "source": [ "# Finding spacecraft earth and moon distances\n", "\n", "As well as spacecraft velocity and position with respect to the solar system barycenter, you can also calculate the position and velocity with respect to the earth and moon." ] }, { "cell_type": "code", "execution_count": 43, "id": "3a2e4ea2-44f9-4c3e-ab61-4fa149511f03", "metadata": {}, "outputs": [], "source": [ "from lkspacecraft import KeplerSpacecraft, TESSSpacecraft\n", "import matplotlib.pyplot as plt\n", "from astropy.time import Time\n", "import numpy as np" ] }, { "cell_type": "markdown", "id": "7d3c2b55-def3-4242-86cc-e44a73252a3a", "metadata": {}, "source": [ "First we load the spacecraft object" ] }, { "cell_type": "code", "execution_count": 44, "id": "20f577f1-9c89-42d0-b61c-17d6605250cd", "metadata": {}, "outputs": [], "source": [ "ks = KeplerSpacecraft()" ] }, { "cell_type": "markdown", "id": "58b2ed64-a3f8-4b41-9a32-16e963ac85be", "metadata": {}, "source": [ "Now we must pick a time that we want to get the position or velocity. I will create a vector which spans the duration of the SPICE kernels" ] }, { "cell_type": "code", "execution_count": 45, "id": "4dde4b41-99a8-4e69-962b-1d4e27a640fd", "metadata": {}, "outputs": [], "source": [ "start, end = ks.start_time, ks.end_time" ] }, { "cell_type": "code", "execution_count": 46, "id": "7f857cab-cbea-4f71-910c-8d721bdb3c17", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(