Commits

Matthew Turk committed 17c923c

Initial import.

  • Participants
  • Parent commits 3b80f61

Comments (0)

Files changed (5)

File example.tex_

-\documentclass[14pt]{beamer}
-\newcommand{\bigsimple}[1]{
-  \begin{frame}[c]{}
-  \begin{center}
-    {\huge \textbf{#1} }
-  \end{center}
-  \end{frame}
-}
-\newcommand{\mediumsimple}[1]{
-  \begin{frame}[c]{}
-  \begin{center}
-    \textbf{#1}
-  \end{center}
-  \end{frame}
-}
-\newcommand{\fullimage}[1]{
-  {
-    \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{#1}}
-    \begin{frame}[plain]{}
-    \end{frame}
-  }
-}
-\newcommand{\defslide}[2]{
-  \begin{frame}[t]{}
-  \begin{center}
-  ``#1''
-  \end{center}
-  \\
-  \hspace{1in}
-  \\
-  #2
-  \end{frame}
-}
-
-\setbeamercolor{normal text}{bg=black,fg=white}
-\setbeamertemplate{navigation symbols}{}
-\usecolortheme[named=white]{structure}
-\usetheme{default}
-\usepackage{relsize}
-\newcommand{\yt}{{\larger\texttt{yt}}}
-
-\usepackage[english]{babel}
-% or whatever
-
-\usepackage[latin1]{inputenc}
-% or whatever
-
-%\usepackage{times}
-\usepackage[T1]{fontenc}
-\usepackage{tgadventor}
-
-\usepackage{graphicx}
-\usepackage{color}
-\usepackage{fancyvrb}
-\usepackage{../pastie}
-
-\title{\yt{}: A Deep Dive}
-
-\begin{document}
-
-\begin{frame}
- \titlepage
-\end{frame}
-
-\bigsimple{\texttt{yt-project.org}}
-
-\begin{frame}[t]{Quick outline}
-\begin{itemize}
-\item Codes \yt{} can handle
-\item Command-line tools
-\item Basic data-handling
-\item Basic plots
-\item Data objects
-\item Advanced plots
-\item Fun
-\end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]{Supported Codes!}
-\begin{itemize}
-\item Enzo
-\item Nyx / Castro / Orion / Boxlib
-\item FLASH
-\item Athena (sort of!)
-\item RAMSES (partial)
-\item ART (sort of!)
-\end{itemize}
-\end{frame}
-
-\bigsimple{What \textit{can} \yt{} support?}
-
-\begin{frame}[fragile]{Starting Up \yt{}}
-\begin{itemize}
-\item Command-line
-\item Interactive
-\item Scripting
-\end{itemize}
-\end{frame}
-
-\bigsimple{Simple, command-line toos}
-
-\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]{}
-\tiny
-<<d['scripts/yt.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|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|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']>>
-\end{frame}
-
-\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}
-
-\bigsimple{Basic data-handling}
-
-\begin{frame}[t]{How to get ``into'' \yt{}}
-\begin{itemize}
-\item Run a script with {\larger\texttt{py-yt}} or {\larger\texttt{python}}
-\item Load a dataset with {\larger\texttt{yt load}}
-\item Run {\larger\texttt{iyt}}
-\end{itemize}
-\end{frame}
-
-\mediumsimple{For these examples, we'll edit a script, then run it with {\larger\texttt{py-yt}}}
-
-\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}
-
-\bigsimple{Now, let's make some plots.}
-
-\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}
-
-\bigsimple{But it's cosmology, so can we find halos, too?}
-
-\begin{frame}[fragile,t]{}
-\small
-<<d['scripts/halo_plotting.py|fn|pyg|l']>>
-\tiny
-<<d['scripts/halo_plotting.py|fn|py|pyg|l']>>
-\end{frame}
-
-\fullimage{DD0023_Projection_y_Density_Density.png}
-
-\bigsimple{Let's dig deeper into our data.}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/inspect_grids.py|fn|pyg|l']>>
-\hline
-<<d['scripts/inspect_grids.py|fn|py|pyg|l']>>
-\end{frame}
-
-\bigsimple{Simple Scripting: Data Objects}
-
-\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}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/sphere_quantities.py|fn|pyg|l']>>
-\hline
-<<d['scripts/sphere_quantities.py|fn|py|pyg|l']>>
-\end{frame}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/sphere_angular_momentum.py|fn|pyg|l']>>
-\hline
-<<d['scripts/sphere_angular_momentum.py|fn|py|pyg|l']>>
-\end{frame}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/derived_fields.py|fn|pyg|l']>>
-\hline
-<<d['scripts/derived_fields.py|fn|py|pyg|l']>>
-\end{frame}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/phase_plot.py|fn|pyg|l']>>
-\hline
-<<d['scripts/phase_plot.py|fn|py|pyg|l']>>
-\end{frame}
-\fullimage{DD0087_Profile2D_0_Density_Temperature_MagneticEnergy.png}
-\fullimage{DD0087_Profile2D_1_Density_Temperature_CellMassMsun.png}
-
-\bigsimple{Advanced Plots}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/popiii_proj.py|fn|pyg|l']>>
-\hline
-<<d['scripts/popiii_proj.py|fn|py|pyg|l']>>
-\end{frame}
-\fullimage{DD0087_Projection_x_Density_Density.png}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/popiii_offaxis.py|fn|pyg|l']>>
-\hline
-<<d['scripts/popiii_offaxis.py|fn|py|pyg|l']>>
-\end{frame}
-\fullimage{DD0087_offaxis.png}
-
-\begin{frame}[fragile,t]{}
-\tiny
-<<d['scripts/volume_rendering_ptf.py|fn|pyg|l']>>
-\hline
-<<d['scripts/volume_rendering_ptf.py|fn|py|pyg|l']>>
-\end{frame}
-\fullimage{DD0087_isocontour.png}
-
-\bigsimple{Fun!}
-
-\mediumsimple{{\larger\texttt{yt mapserver}}}
-
-\mediumsimple{{\larger\texttt{yt serve}}}
-\fullimage{../reason.png}
-
-\begin{frame}[c]{Places to go from here}
-\item Documentation: tutorial, advanced examples, cookbook, etc
-\item Support venues: {\larger \texttt{yt-users}}, {\larger \texttt{yt-dev}}, IRC
-\item \yt{} Hub
-\item \yt{} workshop, Chicago, January 24-26 2012!
-\end{frame}
-
-\end{document}

File scripts/derived_field_list.py

+from yt.mods import *
+
+pf = load("Enzo_64/DD0030/data0030")
+
+for field in pf.h.derived_field_list:
+    if field not in pf.h.field_list: print field

File scripts/derived_fields.py

+from yt.mods import *
+
+@derived_field(name = "Dinosaurs", units = "TRexPerS")
+def Dinosaurs(field, data):
+    return (data["Density"]**(2./3) /
+            data["Temperature"]**(0.5))
+
+pf = load("Enzo_64/DD0023/data0023")
+dd = pf.h.all_data()
+
+dinosaurs, = dd.quantities["TotalQuantity"](["Dinosaurs"])
+print "Total T-Rexes per Second: %0.3e" % (dinosaurs)

File scripts/field_list.py

+from yt.mods import *
+
+pf = load("Enzo_64/DD0030/data0030")
+
+for field in pf.h.field_list:
+    print field

File yt_fields.tex

+\documentclass[14pt]{beamer}
+\newcommand{\bigsimple}[1]{
+  \begin{frame}[c]{}
+  \begin{center}
+    {\huge \textbf{#1} }
+  \end{center}
+  \end{frame}
+}
+\newcommand{\mediumsimple}[1]{
+  \begin{frame}[c]{}
+  \begin{center}
+    \textbf{#1}
+  \end{center}
+  \end{frame}
+}
+\newcommand{\fullimage}[1]{
+  {
+    \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{#1}}
+    \begin{frame}[plain]{}
+    \end{frame}
+  }
+}
+\newcommand{\defslide}[2]{
+  \begin{frame}[t]{}
+  \begin{center}
+  ``#1''
+  \end{center}
+  \\
+  \hspace{1in}
+  \\
+  #2
+  \end{frame}
+}
+
+\newcommand{\trans}[2]{\texttt{#1}$\rightarrow$\texttt{#2}}
+
+\setbeamercolor{normal text}{bg=black,fg=white}
+\setbeamertemplate{navigation symbols}{}
+\usecolortheme[named=white]{structure}
+\usetheme{default}
+\usepackage{relsize}
+\newcommand{\yt}{{\larger\texttt{yt}}}
+
+\usepackage[english]{babel}
+% or whatever
+
+\usepackage[latin1]{inputenc}
+% or whatever
+
+%\usepackage{times}
+\usepackage[T1]{fontenc}
+\usepackage{tgadventor}
+
+\usepackage{graphicx}
+\usepackage{color}
+\usepackage{fancyvrb}
+\usepackage{../pastie}
+
+\title{\yt{}: A Deep Dive}
+
+\begin{document}
+
+\begin{frame}
+ \titlepage
+\end{frame}
+
+\mediumsimple{First a few pedantic exercises}
+
+\defslide{Fields}{Fluid or particle characteristics defined everywhere in the
+simulation where fluids or particles are also found.}
+
+\begin{frame}[t]{Common Fields}
+\begin{itemize}
+\item
+\end{itemize}
+\end{frame}
+
+\mediumsimple{\yt{} will perform a regularization of names through
+``aliasing.''}
+
+\begin{frame}[t]{FLASH}
+\begin{itemize}
+\item \trans{x-velocity}{velx}
+\item \trans{Density}{dens}
+\item \trans{Temperature}{temp}
+\item For more, look in \texttt{yt.frontends.flash.fields}.
+\end{itemize}
+\end{frame}
+
+\mediumsimple{How do I find out which fields \yt{} knows about?}
+
+\begin{frame}[fragile,t]{}
+\tiny
+<<d['scripts/field_list.py|fn|pyg|l']>>
+\hline
+<<d['scripts/field_list.py|fn|py|pyg|l']>>
+\end{frame}
+
+\defslide{Derived field}{A field defined by a function that transforms
+existing, on-disk fields.}
+
+\begin{frame}[fragile,t]{}
+\tiny
+<<d['scripts/derived_field_list.py|fn|pyg|l']>>
+\hline
+<<d['scripts/derived_field_list.py|fn|py|pyg|l']>>
+\end{frame}
+
+\defslide{Field Object}{An object describing how to obtain a field, which
+carries with it information about units, conversion factors, integration,
+labelling, and so on.}
+
+\begin{frame}[fragile,t]{}
+\tiny
+<<d['scripts/derived_fields.py|fn|pyg|l']>>
+\hline
+<<d['scripts/derived_fields.py|fn|py|pyg|l']>>
+\end{frame}
+
+\end{document}