Source

yt.workshop2012.fields / yt_fields.tex

Full commit
\documentclass[13pt]{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[T1]{fontenc}
\usepackage{tgadventor}
\newcommand\smfont{\fontsize{8}{6.4}\selectfont}

\usepackage{graphicx}
\usepackage{color}
\usepackage{fancyvrb}
\usepackage{../pastie}

\title{Fields and Quantities}

\begin{document}

\begin{frame}
 \titlepage
\end{frame}

% How to create a new derived field
% Where can I find information about derived fields?
% How to use spatial information in that derived field
%   Where does that spatial information come from?
%   How do you efficiently slice?
% How to pass parameters in to a derived field
%   Walk through "Delta" function
% What are derived quantities?
% Which DQs are available?


\mediumsimple{(start slow, end fast)}

\mediumsimple{First a few pedantic exercises}

\defslide{Fields}{Fluid or particle characteristics defined everywhere in the
simulation where fluids or particles are also found.}

\defslide{Known Fields}{Fields that are known to exist on-disk under some
circumstances in a particular output type.}

\defslide{Derived field}{A field defined by a function that transforms
existing, on-disk fields.}


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

\mediumsimple{Auto-generated
list:\\\texttt{http://yt-project.org/docs/2.3/reference/field\_list.html}}

\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,
labeling, and so on.}

\begin{frame}[fragile,t]{}
\tiny
<<d['scripts/examine_field.py|fn|pyg|l']>>
\hline
<<d['scripts/examine_field.py|fn|py|pyg|l']>>
\end{frame}

\begin{frame}[fragile,t]{Defining a Field}
\hspace{1.0in}
\tiny
<<d['scripts/derived_fields.py|fn|pyg|l']>>
\end{frame}

\begin{frame}[fragile, t]{Arguments to \texttt{derived\_field}}
\begin{center}
\smfont{}
\begin{tabular}{l|p{2.5in}}
\texttt{function} & The function that will define the field.  Accepts two
arguments: \texttt{field} and \texttt{data}.  \texttt{data} will always be a
data container, and \texttt{field} is the \texttt{DerivedField} object. \\[9pt]
%\hline
\texttt{convert\_function} & A function that accepts \texttt{data} and returns
the conversion factor to CGS.  \\[9pt]
%\hline
\texttt{units} & A text field of units, suitable for \LaTeX processing. \\[9pt]
%\hline
\texttt{projected\_units} & The units after projection (i.e., line integral)
\\[9pt]
%\hline
\texttt{projection\_conversion} & Units to multiply against after projecting
through the domain.\\[9pt]
%\hline
\texttt{take\_log} & Should we tend to take the log of this field when we plot
it? \\[9pt]
%\hline
\texttt{particle\_type} & Is this field shaped like particle data? \\[9pt]
%\hline
\texttt{display\_name} & What's a nice, \LaTeX-friendly display of this field?
\\[9pt]
%\hline
\texttt{validators} & List of ``validators'' that govern the type of data
passed in.
\end{tabular}
\end{center}
\end{frame}

\bigsimple{What's a validator?}

\begin{frame}[t]{}
\begin{center}
\smfont{}
\begin{tabular}{l|p{2.5in}}
\texttt{ValidateParameter} & Ensure that a particular parameter is passed in
via \texttt{field\_parameters}. \\[9pt]
\texttt{ValidateDataField} & Ensure that a dataset has a particular data field.
\\[9pt]
\texttt{ValidateSpatial} & Ensure that we are passed 3D spatial data.  Accepts
an argument of the number of extra zones in each direction. \\[9pt]
\texttt{ValidateGridType} & Ensure we have an actual grid object.
\end{tabular}
\end{center}
\end{frame}

\begin{frame}[fragile, t]{Example: Field Parameters}
\tiny
<<d['scripts/field_parameters.py|fn|pyg|l']>>
\end{frame}

\begin{frame}[fragile, t]{Example: Field Parameters}
\tiny
<<d['scripts/field_parameters.py|fn|py|pyg|l']>>
\end{frame}


\end{document}