Commits

Matthew Turk committed cdf3ade

Adding stream

  • Participants
  • Parent commits f186849

Comments (0)

Files changed (4)

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}
-  \\
-  \vspace{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}

first_earth.png

Added
New image
+\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}
+  \\
+  \vspace{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{What is a ``frontend'' anyway?}
+
+\begin{document}
+
+\begin{frame}
+ \titlepage
+\end{frame}
+
+\mediumsimple{How does \yt{} see data?}
+
+\defslide{frontend}{
+A frontend is a mechanism for \yt{} to translate data from on-disk structures
+(such as files) into memory, with semantic information.
+}
+
+\begin{frame}[t]{What do we need to know?}
+\begin{itemize}
+\item How is data distributed throughout memory?
+\item How do I load it?
+\item What does it correspond to?
+\item What are units, domain volume, etc etc
+\end{itemize}
+\end{frame}
+
+\mediumsimple{How do I load raw data?}
+
+\begin{frame}[fragile, t]
+\tiny
+<<d['scripts/stream_load.py|fn|pyg|l']>>
+\end{frame}
+
+\begin{frame}[fragile, t]
+\tiny
+<<d['scripts/stream_vr.py|fn|pyg|l']>>
+\end{frame}
+
+\fullimage{first_earth.png}
+
+\bigsimple{What's next?}
+\mediumsimple{Geometry refactoring.}
+\mediumsimple{Better volume rendering.}
+\mediumsimple{Deeper code integration.}
+\mediumsimple{Fixing broken windows and rusty gates.}
+
+\bigsimple{Thank you.}
+
+\bigsimple{Community.}
+
+\end{document}

scripts/stream_vr.py

+sfh.pf = spf
+spf.h
+spf.field_info["Density"].take_log = True
+
+dd = spf.h.all_data()
+mi, ma = na.log10(dd.quantities["Extrema"]("Density", non_zero=True)[0])
+print mi, ma
+mi = -15
+tf = ColorTransferFunction((mi, ma))
+tf.add_layers(4, w=0.01)
+cam = spf.h.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4],
+     1.0, (1024, 1024), tf)
+cam.volume.initialize_source()
+for b in cam.volume.bricks:
+    b.my_data[0][na.isnan(b.my_data[0])] = mi - 0.5
+    b.my_data[0][na.isinf(b.my_data[0])] = mi - 0.5
+print b.my_data[0].min(),
+print b.my_data[0].max()
+im = cam.snapshot("hi.png", 4.0)