Ejemplo n.º 1
0
def change_figure(n_intervals):
    r = l[n_intervals % 500]
    # r = [r.x, r.y, r.z] * u.km
    radius = (norm(r) - Earth.R) * 0.5

    d2 = dict()
    xx, yy, zz = generate_sphere(radius, r)
    d2['x'], d2['y'], d2['z'] = xx.value, yy.value, zz.value
    return [d2], [2], 20
Ejemplo n.º 2
0
    def _draw_sphere(self, radius, color, name, center=[0, 0, 0] * u.km):
        xx, yy, zz = generate_sphere(radius, center)
        sphere = Surface(
            x=xx.to(u.km).value,
            y=yy.to(u.km).value,
            z=zz.to(u.km).value,
            name=name,
            colorscale=[[0, color], [1, color]],
            cauto=False,
            cmin=1,
            cmax=1,
            showscale=False,
        )
        self._figure.add_trace(sphere)

        return sphere
Ejemplo n.º 3
0
    def _plot_sphere(self, radius, color, name, center=[0, 0, 0] * u.km):
        xx, yy, zz = generate_sphere(radius, center)
        sphere = Surface(
            x=xx.to(u.km).value,
            y=yy.to(u.km).value,
            z=zz.to(u.km).value,
            name=name,
            colorscale=[[0, color], [1, color]],
            cauto=False,
            cmin=1,
            cmax=1,
            showscale=False,
        )
        self._figure.add_trace(sphere)

        return sphere