In [18]:
from __future__ import division, print_function

import sys

# Third-party
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline

morphology_path = "/Users/adrian/projects/morphology/"
try:
    sys.path.index(morphology_path)
except ValueError:
    sys.path.append(morphology_path)

# Custom
import gary.dynamics as gd
import gary.integrate as gi
import gary.io as io
import gary.potential as gp
from gary.units import galactic

# project
from streammorphology.potential import potential_registry
potential = potential_registry['triaxial-NFW']

In [45]:
kwargs = dict(marker=None,color='#1b75bb')

In [46]:
# pretzel
t,w = potential.integrate_orbit([31.712141115952516, 0.0, 15.551957526800706, 0.0, 0.15403197509440325, 0.0], 
                                dt=3., nsteps=10000, Integrator=gi.DOPRI853Integrator)

fig,ax = plt.subplots(1,1,figsize=(8,8))
ax.set_xlim(-40,40)
ax.set_ylim(-40,40)
ax.plot(w[:,0,0],w[:,0,2],**kwargs)
ax.set_frame_on(False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.patch.set_facecolor('None')
fig.patch.set_facecolor('None')
fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/orbit1.pdf", transparent=True)

fig,ax = plt.subplots(1,1,figsize=(8,8))
ax.set_xlim(-40,40)
ax.set_ylim(-40,40)
ax.plot(w[:,0,1],w[:,0,2],**kwargs)
ax.set_frame_on(False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.patch.set_facecolor('None')
fig.patch.set_facecolor('None')
fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/orbit2.pdf", transparent=True)



In [47]:
# closed trefoil
t,w = potential.integrate_orbit([24.417031627655781, 0.0, 0.1, 0.0, 0.23727061350345613, 0.0], 
                                dt=3., nsteps=10000, Integrator=gi.DOPRI853Integrator)
fig = gd.plot_orbits(w, marker=None)

fig,ax = plt.subplots(1,1,figsize=(8,8))
ax.set_xlim(-40,40)
ax.set_ylim(-40,40)
ax.plot(w[:,0,0],w[:,0,1],**kwargs)
ax.set_frame_on(False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.patch.set_facecolor('None')
fig.patch.set_facecolor('None')
fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/orbit3.pdf", transparent=True)



In [431]:
# higher order
t,w = potential.integrate_orbit([20.039965934677742, 0.0, 16.7718489104955, 0.0, 0.21218860087477895, 0.0], 
                                dt=3., nsteps=10000, Integrator=gi.DOPRI853Integrator)
fig = gd.plot_orbits(w, marker=None)

fig,ax = plt.subplots(1,1,figsize=(8,8))
ax.set_xlim(-40,40)
ax.set_ylim(-40,40)
ax.plot(w[:,0,0],w[:,0,1],**kwargs)
ax.set_frame_on(False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.patch.set_facecolor('None')
fig.patch.set_facecolor('None')
fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/orbit4.pdf", transparent=True)

fig,ax = plt.subplots(1,1,figsize=(8,8))
ax.set_xlim(-40,40)
ax.set_ylim(-40,40)
ax.plot(w[:,0,1],w[:,0,2],**kwargs)
ax.set_frame_on(False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.patch.set_facecolor('None')
fig.patch.set_facecolor('None')
fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/orbit5.pdf", transparent=True)



Figure 2


In [441]:
# fast, slow
w0s = np.array([[20.526306567230858, 0.0, 30.597284592369814, 0.0, 0.11200968228030868, 0.0],
                [20.526306567230858, 0.0, 32.223806437296204, 0.0, 0.09553080349445207, 0.0]])

In [442]:
t,ws = potential.integrate_orbit(w0s, dt=2., nsteps=28000, Integrator=gi.DOPRI853Integrator)

In [451]:
loop = gd.classify_orbit(ws)
ws2 = gd.align_circulation_with_z(ws, loop)

In [469]:
fig,axes = plt.subplots(2,2,figsize=(10,10),sharex=True,sharey=True)

axes[0,0].plot(ws2[:,1,0], ws2[:,1,1], marker=None)
axes[1,0].plot(ws2[:,1,0], ws2[:,1,2], marker=None)

axes[0,1].plot(ws2[:,0,0], ws2[:,0,1], marker=None)
axes[1,1].plot(ws2[:,0,0], ws2[:,0,2], marker=None)

axes[0,0].set_xticks(range(-30,31,15))
axes[0,0].set_yticks(range(-30,31,15))

axes[0,0].set_xlim(-40,40)
axes[0,0].set_ylim(-40,40)

fig.tight_layout()
fig.savefig("/Users/adrian/papers/posters/AAS225/figures/figure2.pdf", transparent=True)