irfpy.mexpvat.frame
¶
Frame conversion for MEX.
High level fuctions for MEX frame conversion.
It uses SPICE in its low-level functions, so that you may need to
furnsh irfpy.mexpvat.mexspice
before using.
>>> from irfpy.mexpvat import mexspice
>>> mexspice.init()
- irfpy.mexpvat.frame.irfpy_framenames = {'ASPERA': 'MEX_ASPERA', 'ELS': 'MEX_ASPERA_ELS', 'IMA': 'MEX_ASPERA_IMAS', 'NPD1': 'MEX_ASPERA_NPD1', 'NPD2': 'MEX_ASPERA_NPD2', 'NPI': 'MEX_ASPERA_NPI', 'SAF': 'MEX_ASPERA_SAF', 'SC': 'MEX_SC', 'URF': 'MEX_ASPERA_URF'}¶
Conversion table of frame names
irfpy
users can use the customized frame name above. The defined name overwrite the spice name in the functions of this module.Note
The use of the name convection is limited inside this module. These names does not register to SPICE.
- irfpy.mexpvat.frame.spicename(origname)[source]¶
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.mexpvat.frame.convert_matrix(t, fromframe='MEX_SC', toframe='MSO')[source]¶
Return conversion matrix as a numpy array.
- Parameters
t –
datatime.datetime
object specifying time.- Returns
Numpy array of the conversion matrix.
numpy.pxform
is used.
Conversion between IMA frame and SC frame is
>>> from irfpy.mexpvat import mexspice >>> mexspice.init(level='noatt') >>> import datetime >>> t = datetime.datetime.now() # This is just a placeholder, as they are fixed each other. >>> matx = convert_matrix(t, fromframe='IMA', toframe='MEX_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.]]