Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…iftest into debug
  • Loading branch information
daminton committed Aug 20, 2021
2 parents 45c61b4 + b1f15a5 commit 739fc8b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
16 changes: 8 additions & 8 deletions examples/symba_chambers_2013/aescattermovie.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
from matplotlib import animation
import matplotlib.colors as mcolors

radscale = 50
titletext = "Chambers (2013)"
radscale = 2000
AU = 1.0
xmin = 0.0
xmax = 2.00
ymin = 1e-4
ymax = 1.0
framejump = 10

class AnimatedScatter(object):
"""An animated scatter plot using matplotlib.animations.FuncAnimation."""
def __init__(self, ds, param):

frame = 0
nframes = ds['time'].size
nframes = int(ds['time'].size / framejump)
self.ds = ds
self.param = param
self.ds['radmarker'] = self.ds['Radius'].fillna(0)
Expand All @@ -28,7 +30,6 @@ def __init__(self, ds, param):
'Supercatastrophic' : 'xkcd:shocking pink',
'Hit and run fragment' : 'xkcd:baby poop green'}

self.stream = self.data_stream(frame)
# Setup the figure and axes...
fig = plt.figure(figsize=(8,4.5), dpi=300)
plt.tight_layout(pad=0)
Expand Down Expand Up @@ -63,7 +64,7 @@ def setup_plot(self):
self.title = self.ax.text(0.50, 1.05, "", bbox={'facecolor': 'w', 'alpha': 0.5, 'pad': 5}, transform=self.ax.transAxes,
ha="center")

self.title.set_text(f"Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
self.title.set_text(f"{titletext} - Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
slist = self.scatters(pl, radmarker, origin)
self.s0 = slist[0]
self.s1 = slist[1]
Expand All @@ -74,7 +75,7 @@ def setup_plot(self):

def data_stream(self, frame=0):
while True:
d = self.ds.isel(time=frame)
d = self.ds.isel(time = frame)
d = d.where(np.invert(np.isnan(d['a'])), drop=True)
Radius = d['radmarker'].values
GMass = d['GMass'].values
Expand All @@ -87,14 +88,13 @@ def data_stream(self, frame=0):

t = self.ds.coords['time'].values[frame]

frame += 1
yield t, name, GMass, Radius, npl, np.c_[a, e], radmarker, origin

def update(self,frame):
"""Update the scatter plot."""
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(frame))
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(framejump * frame))

self.title.set_text(f"Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
self.title.set_text(f"{titletext} - Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")

# We need to return the updated artist for FuncAnimation to draw..
# Note that it expects a sequence of artists, thus the trailing comma.
Expand Down
4 changes: 2 additions & 2 deletions examples/symba_chambers_2013/param.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CB_IN sun_MsunAUYR.in
PL_IN pl_chambers_2013.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 625 ! output cadence
ISTEP_DUMP 625 ! system dump cadence
ISTEP_OUT 6250 ! output cadence
ISTEP_DUMP 6250 ! system dump cadence
BIN_OUT bin.dat
PARTICLE_OUT particle.dat
OUT_TYPE REAL8 ! double precision real output
Expand Down
16 changes: 8 additions & 8 deletions examples/symba_clement_2018/aescattermovie.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
from matplotlib import animation
import matplotlib.colors as mcolors

radscale = 50
titletext = "Clement et al. (2018)"
radscale = 2000
AU = 1.0
xmin = 0.0
xmax = 2.00
ymin = 1e-4
ymax = 1.0
framejump = 1

class AnimatedScatter(object):
"""An animated scatter plot using matplotlib.animations.FuncAnimation."""
def __init__(self, ds, param):

frame = 0
nframes = ds['time'].size
nframes = int(ds['time'].size / framejump)
self.ds = ds
self.param = param
self.ds['radmarker'] = self.ds['Radius'].fillna(0)
Expand All @@ -28,7 +30,6 @@ def __init__(self, ds, param):
'Supercatastrophic' : 'xkcd:shocking pink',
'Hit and run fragment' : 'xkcd:baby poop green'}

self.stream = self.data_stream(frame)
# Setup the figure and axes...
fig = plt.figure(figsize=(8,4.5), dpi=300)
plt.tight_layout(pad=0)
Expand Down Expand Up @@ -63,7 +64,7 @@ def setup_plot(self):
self.title = self.ax.text(0.50, 1.05, "", bbox={'facecolor': 'w', 'alpha': 0.5, 'pad': 5}, transform=self.ax.transAxes,
ha="center")

self.title.set_text(f"Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
self.title.set_text(f"{titletext} - Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
slist = self.scatters(pl, radmarker, origin)
self.s0 = slist[0]
self.s1 = slist[1]
Expand All @@ -74,7 +75,7 @@ def setup_plot(self):

def data_stream(self, frame=0):
while True:
d = self.ds.isel(time=frame)
d = self.ds.isel(time = frame)
d = d.where(np.invert(np.isnan(d['a'])), drop=True)
Radius = d['radmarker'].values
GMass = d['GMass'].values
Expand All @@ -87,14 +88,13 @@ def data_stream(self, frame=0):

t = self.ds.coords['time'].values[frame]

frame += 1
yield t, name, GMass, Radius, npl, np.c_[a, e], radmarker, origin

def update(self,frame):
"""Update the scatter plot."""
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(frame))
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(framejump * frame))

self.title.set_text(f"Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")
self.title.set_text(f"{titletext} - Time = ${t*1e-6:6.3f}$ My with ${npl:4.0f}$ particles")

# We need to return the updated artist for FuncAnimation to draw..
# Note that it expects a sequence of artists, thus the trailing comma.
Expand Down
5 changes: 2 additions & 3 deletions examples/symba_clement_2018/param.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ CHK_CLOSE yes ! check for planetary close encounters
CHK_RMAX 100000.0 ! discard outside of
EXTRA_FORCE no ! no extra user-defined forces
BIG_DISCARD no ! output all planets if anything discarded
DISCARD_OUT discard.out
RHILL_PRESENT yes ! Hill's sphere radii in input file
MU2KG 1.98847e30 ! (M_sun-> kg)
DU2M 1.495979e11 ! distance unit to meters (AU --> m)
TU2S 3.15569259747e7 ! time unit to seconds (years --> seconds)
GMTINY 1e-10
ENERGY yes
ENERGY_OUT energy.dat
ENERGY_OUT energy.dat
ROTATION yes
FRAGMENTATION yes
DISCARD_OUT discard.out
SEED 8 12261555 871132 92734722 21132443 36344777 4334443 219291656 3848566
ENERGY_OUT energy.out
11 changes: 6 additions & 5 deletions examples/symba_mars_disk/aescattermovie.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
from matplotlib import animation
import matplotlib.colors as mcolors

radscale = 50
titletext = "High M - High e"
radscale = 1000
RMars = 3389500.0
xmin = 1.0
xmax = 10.0
ymin = 1e-6
ymax = 1.0
framejump = 1

class AnimatedScatter(object):
"""An animated scatter plot using matplotlib.animations.FuncAnimation."""
Expand All @@ -28,7 +30,6 @@ def __init__(self, ds, param):
'Supercatastrophic' : 'xkcd:shocking pink',
'Hit and run fragment' : 'xkcd:baby poop green'}

self.stream = self.data_stream(frame)
# Setup the figure and axes...
fig = plt.figure(figsize=(8,4.5), dpi=300)
plt.tight_layout(pad=0)
Expand Down Expand Up @@ -63,7 +64,7 @@ def setup_plot(self):
self.title = self.ax.text(0.50, 1.05, "", bbox={'facecolor': 'w', 'alpha': 0.5, 'pad': 5}, transform=self.ax.transAxes,
ha="center")

self.title.set_text(f'Time = ${t / 24 / 3600:4.1f}$ days with ${npl:f}$ particles')
self.title.set_text(f"{titletext} - Time = ${t / 24 / 3600:4.1f}$ days with ${npl:f}$ particles")
slist = self.scatters(pl, radmarker, origin)
self.s0 = slist[0]
self.s1 = slist[1]
Expand Down Expand Up @@ -92,9 +93,9 @@ def data_stream(self, frame=0):

def update(self,frame):
"""Update the scatter plot."""
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(frame))
t, name, GMass, Radius, npl, pl, radmarker, origin = next(self.data_stream(framejump * frame))

self.title.set_text(f'Time = ${t / 24 / 3600:4.1f}$ days with ${npl:4.0f}$ particles')
self.title.set_text(f"{titletext} - Time = ${t / 24 / 3600:4.1f}$ days with ${npl:4.0f}$ particles")

# We need to return the updated artist for FuncAnimation to draw..
# Note that it expects a sequence of artists, thus the trailing comma.
Expand Down
7 changes: 4 additions & 3 deletions examples/symba_mars_disk/param.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
!Parameter file for the SyMBA-RINGMOONS test
T0 0.0
TSTOP 6000000.0
TSTOP 100000000.0
DT 600.0
CB_IN cb.in
PL_IN mars.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 1
ISTEP_DUMP 1
ISTEP_OUT 100
ISTEP_DUMP 100
BIN_OUT bin.dat
PARTICLE_OUT particle.dat
OUT_TYPE REAL8
Expand All @@ -32,3 +32,4 @@ DU2M 1.0
TU2S 1.0
SEED 2 3080983 2220830
DISCARD_OUT discard.out
ENERGY_OUT energy.out

0 comments on commit 739fc8b

Please sign in to comment.