Frame conversion module for VEX using SPICE.

High level fuctions for VEX frame conversion. It uses SPICE in its low-level functions, so that you may need to furnsh irfpy.vexpvat.vexspice before using.

>>> from irfpy.vexpvat import vexspice
>>> vexspice.init()
irfpy.vexpvat.frame.irfpy_framenames = {'ASPERA': 'VEX_ASPERA4', 'ELS': 'VEX_ASPERA4_ELS', 'IMA': 'VEX_ASPERA4_IMAS', 'NPD1': 'VEX_ASPERA4_NPD1', 'NPD2': 'VEX_ASPERA4_NPD2', 'NPI': 'VEX_ASPERA4_NPI', 'SC': 'VEX_SPACECRAFT'}

Conversion table of frame names


Please define the names coherently as MEX.

irfpy users can use the customized frame name above. The defined name overwrite the spice name in the functions of this module.


The use of the name convection is limited inside this module. These names does not register to SPICE.


Return the SPICE name

Convert the origname to spicename. Name conversion using irfpy_framenames table, and if no entry originame is returned as is.

irfpy.vexpvat.frame.convert_matrix(t, fromframe='VEX_SC', toframe='VSO')[source]

Return conversion matrix as a numpy array.


tdatatime.datetime object specifying time.


Numpy array of the conversion matrix. numpy.pxform is used.

Conversion between IMA frame and SC frame is

>>> from irfpy.vexpvat import vexspice
>>> vexspice.init()
>>> import datetime
>>> t =   # This is just a placeholder, as they are fixed each other.
>>> matx = convert_matrix(t, fromframe='IMA', toframe='VEX_SPACECRAFT')
>>> from irfpy.util.with_context import printoptions
>>> with printoptions(suppress=True, precision=3):  # Note: -0. should be the same as 0., but...
...     print(matx)
[[ 1. -0. -0.]
 [ 0.  0.  1.]
 [-0. -1.  0.]]