======================================== How to load the JUICE orbit and attitude ======================================== .. toctree:: spice_kernel_locations Loading orbit ============= 1. Setup the SpiceyPy. .. code-block:: sh pip install "git+https://github.com/AndrewAnnex/SpiceyPy.git" 2. Prepare kernels. Needed kernels are - 'de421.bsp' - 'jse_111130.tf' - 'jup230l.bsp' - 'mantra_juice_jup_a5d_141a_lau_c5e_016.bsp' - 'naif0009.tls' - 'pck00010.tpc' 3. Newly create a file by text editor as follows, and save it as "juice.mk". :: KPL/MK \begindata PATH_VALUES = ( '.' ) PATH_SYMBOLS = ( 'KERNELS' ) KERNELS_TO_LOAD = ( '$KERNELS/de421.bsp' '$KERNELS/jse_111130.tf' '$KERNELS/jup230l.bsp' '$KERNELS/mantra_juice_jup_a5d_141a_lau_c5e_016.bsp' '$KERNELS/naif0009.tls' '$KERNELS/pck00010.tpc' ) 4. Start python! .. code-block:: sh ipython 5. Initialize the JUICE spice kernels. .. code-block:: python >>> from irfpy.juice import jspice as js >>> js.init(mkkernel='./juice.mk') 6. To get the spacecraft position seen from some body in a specific frame can be retrieved by :func:`irfpy.juice.jspice.get_position` function. .. code-block:: python >>> import datetime >>> t = datetime.datetime(2031, 5, 10, 1, 20, 0) # 2031-05-10T01:20:00 >>> js.get_position(t, target='JUICE', origin='JUPITER', frame='JSE') array([ 753430.83362161, -790039.59240909, 17587.96798178]) 7. To get the spacecraft velocity vector seen from some body, use :func:`irfpy.juice.jspice.get_velocity` function. .. code-block:: python >>> js.get_velocity(t, target='JUICE', origin='JUPITER', frame='JSE') array([ 4.98295226, 11.23419393, 3.6634433 ]) 8. To get the conversion matrix, use :func:`irfpy.juice.jspice.get_conversion_matrix` function. .. code-block:: python >>> js.get_conversion_matrix(t, from_frame='JSE', to_frame='IAU_JUPITER') array([[ 0.26772223, 0.96334943, -0.01681298], [-0.96242748, 0.26656293, -0.05174498], [-0.04536678, 0.03003456, 0.99851879]])