Get spacecraft position

Getting MSO/VSO position of spacecraft

MSO/VSO is commonly used for data analysis.

Definition of the frames is

x-axis

A vector from Mars/Venus to Sun

z-axis

Outer product of the Mars/Venus velocity vector with respective to the Sun and x-axis. In other word, perpendicular to the orbital plane of Mars and Venus, pointing to north.

y-axis

Outer product of z- and x-axes. (Close to anti-parallel to the velocity vector of Mars/Venus with respective to the Sun.)

Question 1

The following provides the spacecraft position in MSO at 2007-10-23T20:00:00 for MEX.

>>> import datetime
>>> from irfpy.mexpvat import mexspice
>>> mexspice.init()
>>> print(mexspice.get_position(datetime.datetime(2007, 10, 23, 20, 0, 0)))
[   657.85025367  -2177.86777831  12580.52647702]

The key here is to call mexspice.init() function. It furnsh all the needed SPICE kernels.

Question 2

In the same manner as MEX, can you get the spacecraft position in VSO at 2007-10-23T20:00:00 for VEX?

>>> import datetime
>>> from irfpy.vexpvat import vexspice
>>> vexspice.init()
>>> print(vexspice.get_position(datetime.datetime(2007, 10, 23, 20, 0, 0)))
[-18480.45501421 -12553.85741085 -53308.79391638]

Getting positions in general

Question 3

The function irfpy.mexpvat.mexspice.get_position() and irfpy.vexpvat.vexspice.get_position() can get the keywords of target, origin, and frame.

target

SPICE name of the body to get its position

origin

SPICE name of the body that is centered at

frame

SPICE name of the frame

For example, if one wants to know the Sun (“SUN”) direction in the Martian geological coordinate (“IAU_MARS”), you may call it as

>>> import datetime
>>> from irfpy.mexpvat import mexspice
>>> mexspice.init()   # Once per session is ok.
>>> print(mexspice.get_position(datetime.datetime(2007, 10, 23, 20, 0, 0),
...       target='SUN', origin='MARS', frame='IAU_MARS'))
[  1.76581081e+08  -1.32088158e+08  -3.92706156e+07]

Exercise

  1. Plot the X-R position of VEX in the VSO frame between 2007-10-01T00:00:00 and 2007-10-02T00:00:00.

  2. Obtain the closest approach time and distance of MEX on 2007-10-15.