Commits

Matthew Turk committed fac3eec

More scripts & slides

Comments (0)

Files changed (7)

     },
    "*.sh|fn|bash|pyg|l" : {},
    "*.sh|fn|bash" : {},
-   "*.sh|fn|pyg|l" : {}
+   "*.sh|fn|pyg|l" : {},
+   "*.py|fn|py|pyg|l" : {},
+   "*.py|fn|pyg|l" : {}
 }
     \PY@it{\PY@bf{\PY@ff{#1}}}}}}}
 \def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
 
-\def\PY@tok@gd{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.87,0.87}{##1}}}
-\def\PY@tok@gu{\def\PY@tc##1{\textcolor[rgb]{0.38,0.38,0.38}{##1}}}
-\def\PY@tok@gt{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}}
+\def\PY@tok@{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@vc{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
 \def\PY@tok@gs{\let\PY@bf=\textbf}
-\def\PY@tok@gr{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}}
-\def\PY@tok@cm{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
-\def\PY@tok@vg{\def\PY@tc##1{\textcolor[rgb]{0.87,0.47,0.00}{##1}}}
-\def\PY@tok@m{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@mh{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@cs{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.80,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@cm{\def\PY@tc##1{\textcolor[rgb]{0.46,0.44,0.37}{##1}}}
+\def\PY@tok@vg{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@m{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@l{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
 \def\PY@tok@ge{\let\PY@it=\textit}
-\def\PY@tok@vc{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
-\def\PY@tok@il{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@go{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
-\def\PY@tok@cp{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.80,0.00,0.00}{##1}}}
-\def\PY@tok@gi{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.87,1.00,0.87}{##1}}}
-\def\PY@tok@gh{\def\PY@tc##1{\textcolor[rgb]{0.19,0.19,0.19}{##1}}}
-\def\PY@tok@s2{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@nl{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
-\def\PY@tok@nn{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
-\def\PY@tok@no{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.40}{##1}}}
-\def\PY@tok@na{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
-\def\PY@tok@nb{\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.53}{##1}}}
-\def\PY@tok@nc{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
-\def\PY@tok@nd{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
-\def\PY@tok@ne{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
-\def\PY@tok@nf{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.40,0.73}{##1}}}
-\def\PY@tok@si{\def\PY@tc##1{\textcolor[rgb]{0.20,0.20,0.73}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@sh{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@vi{\def\PY@tc##1{\textcolor[rgb]{0.20,0.20,0.73}{##1}}}
-\def\PY@tok@py{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
-\def\PY@tok@nt{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
-\def\PY@tok@nv{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
-\def\PY@tok@s1{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@gp{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
-\def\PY@tok@ow{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@sx{\def\PY@tc##1{\textcolor[rgb]{0.13,0.73,0.13}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.94,1.00,0.94}{##1}}}
-\def\PY@tok@bp{\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.53}{##1}}}
-\def\PY@tok@c1{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
-\def\PY@tok@kc{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@c{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
-\def\PY@tok@mf{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@err{\def\PY@tc##1{\textcolor[rgb]{0.65,0.09,0.09}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.89,0.82,0.82}{##1}}}
-\def\PY@tok@kd{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@ss{\def\PY@tc##1{\textcolor[rgb]{0.67,0.40,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@sr{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,1.00}{##1}}}
-\def\PY@tok@mo{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@mi{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
-\def\PY@tok@kn{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@kr{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@s{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@kp{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@w{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
-\def\PY@tok@kt{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
-\def\PY@tok@sc{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@sb{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@k{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
-\def\PY@tok@se{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
-\def\PY@tok@sd{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@il{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@cs{\def\PY@tc##1{\textcolor[rgb]{0.46,0.44,0.37}{##1}}}
+\def\PY@tok@cp{\def\PY@tc##1{\textcolor[rgb]{0.46,0.44,0.37}{##1}}}
+\def\PY@tok@ni{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@ld{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@nl{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@nn{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@no{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@na{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@nb{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@nc{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@nd{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@ne{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@nf{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@nx{\def\PY@tc##1{\textcolor[rgb]{0.65,0.89,0.18}{##1}}}
+\def\PY@tok@si{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@s2{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@vi{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@py{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@nt{\def\PY@tc##1{\textcolor[rgb]{0.98,0.15,0.45}{##1}}}
+\def\PY@tok@nv{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@s1{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@sh{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@ow{\def\PY@tc##1{\textcolor[rgb]{0.98,0.15,0.45}{##1}}}
+\def\PY@tok@mf{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@bp{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@mh{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@c1{\def\PY@tc##1{\textcolor[rgb]{0.46,0.44,0.37}{##1}}}
+\def\PY@tok@o{\def\PY@tc##1{\textcolor[rgb]{0.98,0.15,0.45}{##1}}}
+\def\PY@tok@kc{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@c{\def\PY@tc##1{\textcolor[rgb]{0.46,0.44,0.37}{##1}}}
+\def\PY@tok@kr{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@err{\def\PY@tc##1{\textcolor[rgb]{0.59,0.00,0.31}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.12,0.00,0.06}{##1}}}
+\def\PY@tok@kd{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@ss{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@sr{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@mo{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@mi{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@kn{\def\PY@tc##1{\textcolor[rgb]{0.98,0.15,0.45}{##1}}}
+\def\PY@tok@sx{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@n{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@p{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@s{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@kp{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@w{\def\PY@tc##1{\textcolor[rgb]{0.97,0.97,0.95}{##1}}}
+\def\PY@tok@kt{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@sc{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@sb{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
+\def\PY@tok@k{\def\PY@tc##1{\textcolor[rgb]{0.40,0.85,0.94}{##1}}}
+\def\PY@tok@se{\def\PY@tc##1{\textcolor[rgb]{0.68,0.51,1.00}{##1}}}
+\def\PY@tok@sd{\def\PY@tc##1{\textcolor[rgb]{0.90,0.86,0.45}{##1}}}
 
 \def\PYZbs{\char`\\}
 \def\PYZus{\char`\_}

scripts/create_sphere.py

+from yt.mods import *
+
+pf = load("DD0023/DD0023")
+
+sp = pf.h.sphere('max', 1.0/pf["mpc"])
+
+print sp["Density"]

scripts/load_data.py

 from yt.mods import *
 
-pf = load("DD0095/DD0095")
+pf = load("DD0023/DD0023")
+pf.h.print_stats()

scripts/sphere_mass.py

+from yt.mods import *
+
+pf = load("DD0023/DD0023")
+
+sp = pf.h.sphere('max', 1.0/pf["mpc"])
+
+baryon_mass, particle_mass = sp.quantities["TotalQuantity"](
+        ["CellMassMsun", "ParticleMassMsun"])
+
+print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % \
+            (baryon_mass + particle_mass, baryon_mass, particle_mass)

scripts/yt_plot_collection.py

+from yt.mods import *
+
+pf = load("DD0023/DD0023")
+
+pc = PlotCollection(pf, [0.5, 0.5, 0.5])
+p = pc.add_slice("Density", 2)
+p.modify["velocity"]()
+pc.save()
 \end{frame}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_stats.sh|fn|pyg|l']>>
 \tiny
 <<d['scripts/yt_stats.sh|fn|bash|pyg|l']>>
 \end{frame}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_plot.sh|fn|pyg|l']>>
 \tiny
-<<d['scripts/yt_plot.sh|fn|bash']>>
+<<d['scripts/yt_plot.sh|fn|bash|pyg|l']>>
 \end{frame}
 
 \fullimage{frames/DD0023_Projection_x_Density_Density.png}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_slice.sh|fn|pyg|l']>>
 \tiny
-<<d['scripts/yt_slice.sh|fn|bash']>>
+<<d['scripts/yt_slice.sh|fn|bash|pyg|l']>>
 \end{frame}
 
 \fullimage{frames/DD0023_Slice_x_Density.png}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_plot_help.sh|fn|pyg|l']>>
 \tiny
 <<d['scripts/yt_plot_help.sh|fn|bash|pyg|l']>>
 \end{frame}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_render.sh|fn|pyg|l']>>
 \tiny
 <<d['scripts/yt_render.sh|fn|bash|pyg|l']>>
 \fullimage{DD0023_Density_rendering.png}
 
 \begin{frame}[fragile,t]{}
+\small
 <<d['scripts/yt_render_help.sh|fn|pyg|l']>>
 \tiny
 <<d['scripts/yt_render_help.sh|fn|bash|pyg|l']>>
 \end{frame}
 
+\begin{frame}[fragile,t]{}
+\small
+<<d['scripts/load_data.py|fn|pyg|l']>>
+\tiny
+<<d['scripts/load_data.py|fn|py|pyg|l']>>
+\end{frame}
+
+\begin{frame}[fragile,t]{}
+\small
+<<d['scripts/yt_plot_collection.py|fn|pyg|l']>>
+\tiny
+<<d['scripts/yt_plot_collection.py|fn|py|pyg|l']>>
+\end{frame}
+
+\fullimage{DD0023_Slice_z_Density.png}
+
+\begin{frame}[fragile,t]{}
+\tiny
+<<d['scripts/create_sphere.py|fn|pyg|l']>>
+\hline
+<<d['scripts/create_sphere.py|fn|py|pyg|l']>>
+\end{frame}
+
+\begin{frame}[fragile,t]{}
+\tiny
+<<d['scripts/sphere_mass.py|fn|pyg|l']>>
+\hline
+<<d['scripts/sphere_mass.py|fn|py|pyg|l']>>
+\end{frame}
+
 \end{document}