Source code for irfpy.jupsci.moontrace

""" Moon's trace.

:func:`io_trace_simple` gives you a very simple model of trace of Io in the System III frame (n km).
In this simple model, the Io is confiened in the equatorial plane, with a perfect orbit with radius
of 421700 km.
In reality, the tilt of 0.05 degrees and the exhccentricity of 0.0041 should be considered, but for more sphisticated
purposes, you should use the SPICE.
Same for all the Galelian moons have been implemented.

"""
import numpy as np

def __moon_trace_simple(radius, resolution=31):
    r = radius

    angle = np.linspace(0, 2 * np.pi, resolution)
    x = np.cos(angle) * r
    y = np.sin(angle) * r
    z = np.zeros_like(angle)

    coords = np.array([x, y, z]).T

    return coords


[docs]def io_trace_simple(resolution=31): """ The simplest model of Io's trace. Confined in equator, with a constant radius of 421700 km. :param resolution: The resolution. :returns: The (``resolution``, 3) shaped array. >>> traj = io_trace_simple(resolution=17) # resolution 17 means angle separation of 360/(17-1) = 22.5 deg. >>> print(traj.shape) (17, 3) >>> print((traj[:, 2] == 0).all()) # All data point has z-component as 0 True >>> print(traj[0, :]) [ 421700. 0. 0.] >>> print(np.array_str(traj[4, :], suppress_small=True)) [ 0. 421700. 0.] """ r = 421700 return __moon_trace_simple(r, resolution=resolution)
[docs]def europa_trace_simple(resolution=31): """ The simplest model of Europa's trace. Confined in equator, with a constant radius of 670900 km. :param resolution: The resolution. :returns: The (``resolution``, 3) shaped array. >>> traj = europa_trace_simple(resolution=17) # resolution 17 means angle separation of 360/(17-1) = 22.5 deg. >>> print(traj.shape) (17, 3) >>> print((traj[:, 2] == 0).all()) # All data point has z-component as 0 True >>> print(traj[0, :]) [ 670900. 0. 0.] >>> print(np.array_str(traj[4, :], suppress_small=True)) [ 0. 670900. 0.] """ r = 670900 return __moon_trace_simple(r, resolution=resolution)
[docs]def ganymede_trace_simple(resolution=31): """ The simplest model of Ganymede's trace. Confined in equator, with a constant radius of 1070400 km. :param resolution: The resolution. :returns: The (``resolution``, 3) shaped array. >>> traj = ganymede_trace_simple(resolution=17) # resolution 17 means angle separation of 360/(17-1) = 22.5 deg. >>> print(traj.shape) (17, 3) >>> print((traj[:, 2] == 0).all()) # All data point has z-component as 0 True >>> print(traj[0, :]) [ 1070400. 0. 0.] >>> print(np.array_str(traj[4, :], suppress_small=True)) [ 0. 1070400. 0.] """ r = 1070400 return __moon_trace_simple(r, resolution=resolution)
[docs]def callisto_trace_simple(resolution=31): """ The simplest model of Callisto's trace. Confined in equator, with a constant radius of 1882700 km. :param resolution: The resolution. :returns: The (``resolution``, 3) shaped array. >>> traj = callisto_trace_simple(resolution=17) # resolution 17 means angle separation of 360/(17-1) = 22.5 deg. >>> print(traj.shape) (17, 3) >>> print((traj[:, 2] == 0).all()) # All data point has z-component as 0 True >>> print(traj[0, :]) [ 1882700. 0. 0.] >>> print(np.array_str(traj[4, :], suppress_small=True)) [ 0. 1882700. 0.] """ r = 1882700 return __moon_trace_simple(r, resolution=resolution)