[yt-svn] commit/yt-doc: sskory: More updates to the cheatsheet and I noticed something was missing from the radial column density docs.
Bitbucket
commits-noreply at bitbucket.org
Wed Feb 13 12:34:06 PST 2013
1 new commit in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/commits/7690b3873f6e/
changeset: 7690b3873f6e
user: sskory
date: 2013-02-07 23:30:21
summary: More updates to the cheatsheet and I noticed something was missing from the radial column density docs.
affected #: 2 files
diff -r bcb26c76ff8c007e2e8e6c84c0b6164cb562a2bc -r 7690b3873f6ef72324482c5a3aedf51a6b382b0d cheatsheet.tex
--- a/cheatsheet.tex
+++ b/cheatsheet.tex
@@ -80,7 +80,7 @@
\begin{document}
\raggedright
-\footnotesize
+\fontsize{3mm}{3mm}\selectfont
\begin{multicols}{3}
@@ -111,38 +111,37 @@
Commands can be followed by
{\bf {-}{-}help} (e.g. {\bf yt render {-}{-}help}) for detailed help for that command
including a list of the available flags.
-\begin{tabular}{@{}lp{3.5cm}@{}}
-\texttt{iyt} & Load yt and IPython. \\
-\texttt{yt load} {\it dataset} & Load a single dataset. \\
-\texttt{yt help} & Print yt help information. \\
-\texttt{yt stats} \it{dataset} & Print stats of a dataset. \\
-\texttt{yt update} & Update yt to most recent version.\\
-\texttt{yt update --all} & Update yt and dependencies to most recent version. \\
-\texttt{yt instinfo} & yt installation information. \\
-\texttt{yt notebook} & Run the IPython notebook server. \\
-\texttt{yt serve} (\it{dataset}) & Run yt-specific web GUI ({\it dataset} is optional).\\
-\texttt{yt upload\_image} \it{image.png} & Upload PNG image to imgur.com. \\
-\texttt{yt upload\_notebook} \it{notebook.nb} & Upload IPython notebook to hub.yt-project.org.\\
-\texttt{yt plot} \it{dataset} & Create a set of images.\\
-\texttt{yt render} \it{dataset} & Create a simple
+
+\texttt{iyt}\textemdash\ Load yt and IPython. \\
+\texttt{yt load} {\it dataset} \textemdash\ Load a single dataset. \\
+\texttt{yt help} \textemdash\ Print yt help information. \\
+\texttt{yt stats} {\it dataset} \textemdash\ Print stats of a dataset. \\
+\texttt{yt update} \textemdash\ Update yt to most recent version.\\
+\texttt{yt update --all} \textemdash\ Update yt and dependencies to most recent version. \\
+\texttt{yt instinfo} \textemdash\ yt installation information. \\
+\texttt{yt notebook} \textemdash\ Run the IPython notebook server. \\
+\texttt{yt serve} ({\it dataset}) \textemdash\ Run yt-specific web GUI ({\it dataset} is optional).\\
+\texttt{yt upload\_image} {\it image.png} \textemdash\ Upload PNG image to imgur.com. \\
+\texttt{yt upload\_notebook} {\it notebook.nb} \textemdash\ Upload IPython notebook to hub.yt-project.org.\\
+\texttt{yt plot} {\it dataset} \textemdash\ Create a set of images.\\
+\texttt{yt render} {\it dataset} \textemdash\ Create a simple
volume rendering. \\
-\texttt{yt mapserver} {\it dataset} & View a plot/projection in a Gmaps-like
+\texttt{yt mapserver} {\it dataset} \textemdash\ View a plot/projection in a Gmaps-like
interface. \\
-\texttt{yt pastebin} \it{text.out} & Post text to the pastebin at
+\texttt{yt pastebin} {\it text.out} \textemdash\ Post text to the pastebin at
paste.yt-project.org. \\
-\texttt{yt pastebin\_grab} {\it identifier} & Print content of pastebin to
+\texttt{yt pastebin\_grab} {\it identifier} \textemdash\ Print content of pastebin to
STDOUT. \\
- \texttt{yt hub\_register} & Register with
+ \texttt{yt hub\_register} \textemdash\ Register with
hub.yt-project.org. \\
-\texttt{yt hub\_submit} & Submit hg repo to
+\texttt{yt hub\_submit} \textemdash\ Submit hg repo to
hub.yt-project.org. \\
-\texttt{yt bootstrap\_dev} & Bootstrap a yt
+\texttt{yt bootstrap\_dev} \textemdash\ Bootstrap a yt
development environment. \\
-\texttt{yt bugreport} & Report a yt bug. \\
-\texttt{yt hop} {\it dataset} & Run hop on a dataset. \\
-\texttt{yt rpdb} & Connect to running rpd
+\texttt{yt bugreport} \textemdash\ Report a yt bug. \\
+\texttt{yt hop} {\it dataset} \textemdash\ Run hop on a dataset. \\
+\texttt{yt rpdb} \textemdash\ Connect to running rpd
session.
-\end{tabular}
\subsection{yt Imports}
In order to use yt, Python must load the relevant yt modules into memory.
@@ -150,10 +149,6 @@
used as part of a script.
\newlength{\MyLen}
\settowidth{\MyLen}{\texttt{letterpaper}/\texttt{a4paper} \ }
-%\begin{tabular}{@{}p{\the\MyLen}%
-% @{}p{\linewidth-\the\MyLen}@{}}
-%\begin{tabular}{@{}ll@{}}
-\begin{tabular}{@{}p{8cm}}
\texttt{from yt.mods import \textasteriskcentered} \textemdash\
Load base yt modules. \\
\texttt{from yt.config import ytcfg} \textemdash\
@@ -166,16 +161,13 @@
are loaded in a similar way by swapping the
{\em emphasized} text.
See the \textbf{Analysis Modules} section for a listing and short descriptions of each.
-\end{tabular}
\subsection{Numpy Arrays}
Simulation data in yt is returned in Numpy arrays. The Numpy package provides a wealth of built-in
functions that operate on Numpy arrays. Here is a very brief list of some useful ones.
Please see \url{http://docs.scipy.org/doc/numpy/reference/} for the full
-numpy documentation.
+numpy documentation.\\
\settowidth{\MyLen}{\texttt{multicol} }
-\begin{tabular}{@{}p{8cm}}
-
\texttt{v = a.max(), a.min()} \textemdash\ Return maximum, minimum of \texttt{a}. \\
\texttt{index = a.argmax(), a.argmin()} \textemdash\ Return index of max,
min value of \texttt{a}.\\
@@ -183,18 +175,16 @@
\texttt{b = a[}{\it i:j}\texttt{]} \textemdash\ Select the slice of values from \texttt{a} between
locations {\it i} to {\it j-1} saved to a new Numpy array \texttt{b} with length {\it j-i}. \\
\texttt{sel = (a > const)} \textemdash\ Create a new boolean Numpy array \texttt{sel}, of the same shape as \texttt{a},
-that marks which values of \texttt{a > const}. Other operators work as well.\\
+that marks which values of \texttt{a > const}. Other operators (e.g. \textless, !=, \%) work as well.\\
\texttt{b = a[sel]} \textemdash\ Create a new Numpy array \texttt{b} made up of elements from \texttt{a} that correspond to elements of \texttt{sel}
-that are {\it True}.\\
+that are {\it True}. In the above example \texttt{b} would be all elements of \texttt{a} that are greater than \texttt{const}.\\
\texttt{a.dump({\it filename.dat})} \textemdash\ Save \texttt{a} to the binary file {\it filename.dat}.\\
-\texttt{a = load({\it filename.dat})} \textemdash\ Load the contents of {\it filename.dat} into \texttt{a}.
-\end{tabular}
+\texttt{a = np.load({\it filename.dat})} \textemdash\ Load the contents of {\it filename.dat} into \texttt{a}.
\subsection{IPython Tips}
\settowidth{\MyLen}{\texttt{multicol} }
These tips work if IPython has been loaded, typically either by invoking
\texttt{iyt} or \texttt{yt load} on the command line, or using the IPython notebook (\texttt{yt notebook}).
-\begin{tabular}{@{}p{8cm}}
\texttt{Tab complete} \textemdash\ IPython will attempt to auto-complete a
variable or function name when the \texttt{Tab} key is pressed, e.g. {\it HaloFi}\textendash\texttt{Tab} would auto-complete
to {\it HaloFinder}. This also works with imports, e.g. {\it from numpy.random.}\textendash\texttt{Tab}
@@ -209,7 +199,6 @@
\texttt{\%time, \%timeit} \textemdash\ Find running time of expressions for benchmarking.\\
\texttt{\%lsmagic} \textemdash\ List all available IPython magics. Hint: \texttt{?} works with magics.\\
-\end{tabular}
Please see \url{http://ipython.org/documentation.html} for the full
IPython documentation.
@@ -219,9 +208,6 @@
After that, simulation data is generally accessed in yt using {\it Data Containers} which are Python objects
that define a region of simulation space from which data should be selected.
\settowidth{\MyLen}{\texttt{multicol} }
-%\begin{tabular}{@{}p{\the\MyLen}%
-% @{}p{\linewidth-\the\MyLen}@{}}
-\begin{tabular}{@{}p{8cm}}
\texttt{pf = load(}{\it dataset}\texttt{)} \textemdash\ Reference a single snapshot.\\
\texttt{dd = pf.h.all\_data()} \textemdash\ Select the entire volume.\\
\texttt{a = dd[}{\it field\_name}\texttt{]} \textemdash\ Saves the contents of {\it field} into the
@@ -252,8 +238,8 @@
{\it [sp, ``NOT'', (di, ``OR'', re)]} gives a volume defined
by {\it sp} minus the patches covered by {\it di} and {\it re}.\\
-\texttt{pf.h.save\_object(sp, {\it "sp\_for\_later"})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
-\texttt{sp = pf.h.load\_object({\it "sp\_for\_later"})} \textemdash\ Recover a saved object.\\
+\texttt{pf.h.save\_object(sp, {\it ``sp\_for\_later''})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
+\texttt{sp = pf.h.load\_object({\it ``sp\_for\_later''})} \textemdash\ Recover a saved object.\\
\subsection{Defining New Fields \& Quantities}
@@ -271,14 +257,10 @@
\texttt{add\_quantity("TotalMass", function=\_TotalMass,}\\
\texttt{\hspace{4 mm} combine\_function=\_combTotalMass, n\_ret = 2)}\\
-\end{tabular}
\subsection{Slices and Projections}
\settowidth{\MyLen}{\texttt{multicol} }
-%\begin{tabular}{@{}p{\the\MyLen}%
-% @{}p{\linewidth-\the\MyLen}@{}}
-\begin{tabular}{@{}p{8cm}}
\texttt{slc = SlicePlot(pf, {\it axis}, {\it field}, {\it center=}, {\it width=}, {\it weight\_field=}, {\it additional parameters})} \textemdash\ Make a slice plot
perpendicular to {\it axis} of {\it field} weighted by {\it weight\_field} at (code-units) {\it center} with
{\it width} in code units or a (value, unit) tuple. Hint: try {\it SlicePlot?} to see additional parameters.\\
@@ -289,48 +271,40 @@
\texttt{prj = OffAxisSlicePlot(pf, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off-axis slice. Note this takes an array of fields. \\
\texttt{prj = OffAxisProjectionPlot(pf, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off axis projection. Note this takes an array of fields. \\
-\end{tabular}
-
\subsection{Plot Annotations}
\settowidth{\MyLen}{\texttt{multicol} }
Plot callbacks are functions itemized in a registry that is attached to every plot object. They can be accessed and then called like \texttt{ prj.modify["velocity"](factor=16,normalize=False)}. Most callbacks also accept a {\it plot\_args} dict that is fed to matplotlib annotator. \\
-\begin{tabular}{@{}p{8cm}}
\texttt{velocity({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "x-velocity" to draw quivers\\
\texttt{magnetic\_field({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "Bx" to draw quivers\\
\texttt{quiver({\it field\_x},{\it field\_y},{\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \\
\texttt{contour({\it field=},{\it ncont=},{\it factor=},{\it clim=},{\it take\_log=}, {\it additional parameters})} \textemdash Plots a number of contours {\it ncont} to interpolate {\it field} optionally using {\it take\_log}, upper and lower {\it c}ontour{\it lim}its and {\it factor} number of points in the interpolation.\\
\texttt{grids({\it alpha=}, {\it draw\_ids=}, {\it periodic=}, {\it min\_level=}, {\it max\_level=})} \textemdash Add grid boundaries. \\
\texttt{streamlines({\it field\_x},{\it field\_y},{\it factor=},{\it density=})}\\
-\texttt{clumps({\it clumplist})} \textemdash Generate {\it clumplist} using the clump finder and plot. \\
+\texttt{clumps({\it clumplist})} \textemdash\ Generate {\it clumplist} using the clump finder and plot. \\
\texttt{arrow({\it pos}, {\it code\_size})} Add an arrow at a {\it pos}ition. \\
-\texttt{point({\it pos}, {\it text})} \textemdash Add text at a {\it pos}ition. \\
-\texttt{marker({\it pos}, {\it marker=})} \textemdash Add a matplotlib-defined marker at a {\it pos}ition. \\
-\texttt{sphere({\it center}, {\it radius}, {\it text=})} \textemdash Draw a circle and append {\it text}.\\
-\texttt{hop\_circles({\it hop\_output}, {\it max\_number=}, {\it annotate=}, {\it min\_size=}, {\it max\_size=}, {\it font\_size=}, {\it print\_halo\_size=}, {\it fixed\_radius=}, {\it min\_mass=}, {\it print\_halo\_mass=}, {\it width=})} \textemdash Draw a halo, printing it's ID, mass, clipping halos depending on number of particles ({\it size}) and optionally fixing the drawn circle radius to be constant for all halos.\\
-\texttt{hop\_particles({\it hop\_output},{\it max\_number=},{\it p\_size=},{\it min\_size},{\it alpha=}} Draw particle positions for member halos with a certain number of pixels per particle.\\
-\texttt{particles({\it width},{\it p\_size=},{\it col=}, {\it marker=}, {\it stride=}, {\it ptype=}, {\it stars\_only=}, {\it dm\_only=}, {\it minimum\_mass=}, {\it alpha=}} \textemdash Draw particles of {\it p\_size} pixels in a slab of {\it width} with {\it col}or using a matplotlib {\it marker} plotting only every {\it stride} number of particles.\\
+\texttt{point({\it pos}, {\it text})} \textemdash\ Add text at a {\it pos}ition. \\
+\texttt{marker({\it pos}, {\it marker=})} \textemdash\ Add a matplotlib-defined marker at a {\it pos}ition. \\
+\texttt{sphere({\it center}, {\it radius}, {\it text=})} \textemdash\ Draw a circle and append {\it text}.\\
+\texttt{hop\_circles({\it hop\_output}, {\it max\_number=}, {\it annotate=}, {\it min\_size=}, {\it max\_size=}, {\it font\_size=}, {\it print\_halo\_size=}, {\it fixed\_radius=}, {\it min\_mass=}, {\it print\_halo\_mass=}, {\it width=})} \textemdash\ Draw a halo, printing it's ID, mass, clipping halos depending on number of particles ({\it size}) and optionally fixing the drawn circle radius to be constant for all halos.\\
+\texttt{hop\_particles({\it hop\_output},{\it max\_number=},{\it p\_size=},\\
+{\it min\_size},{\it alpha=})} \textemdash\ Draw particle positions for member halos with a certain number of pixels per particle.\\
+\texttt{particles({\it width},{\it p\_size=},{\it col=}, {\it marker=}, {\it stride=}, {\it ptype=}, {\it stars\_only=}, {\it dm\_only=}, {\it minimum\_mass=}, {\it alpha=})} \textemdash\ Draw particles of {\it p\_size} pixels in a slab of {\it width} with {\it col}or using a matplotlib {\it marker} plotting only every {\it stride} number of particles.\\
\texttt{title({\it text})}\\
-\end{tabular}
\subsection{The $\sim$/.yt/ Directory}
\settowidth{\MyLen}{\texttt{multicol} }
yt will automatically check for configuration files in a special directory (\texttt{\$HOME/.yt/}) in the user's home directory.
-%\begin{tabular}{@{}p{\the\MyLen}%
-% @{}p{\linewidth-\the\MyLen}@{}}
-\begin{tabular}{@{}p{8cm}}
The \texttt{config} file \textemdash\ Settings that control runtime behavior. \\
The \texttt{my\_plugins.py} file \textemdash\ Add functions, derived fields, constants, or other commonly-used Python code to yt.
-\end{tabular}
+
\subsection{Analysis Modules}
\settowidth{\MyLen}{\texttt{multicol}}
The import name for each module is listed at the end of each description (see \textbf{yt Imports}).
-%\begin{tabular}{@{}p{\the\MyLen}%
-% @{}p{\linewidth-\the\MyLen}@{}}
-\begin{tabular}{@{}p{8cm}}
+
\texttt{Absorption Spectrum} \textemdash\ (\texttt{absorption\_spectrum}). \\
\texttt{Clump Finder} \textemdash\ Find clumps defined by density thresholds (\texttt{level\_sets}). \\
\texttt{Coordinate Transformation} \textemdash\ (\texttt{coordinate\_transformation}). \\
@@ -338,15 +312,14 @@
\texttt{Halo Mass Function} \textemdash\ Find halo mass functions from data and from theory (\texttt{halo\_mass\_function}). \\
\texttt{Halo Profiling} \textemdash\ Profile and project multiple halos (\texttt{halo\_profiler}). \\
\texttt{Halo Merger Tree} \textemdash\ Create a database of halo mergers (\texttt{halo\_merger\_tree}). \\
-\texttt{Light Cone Generator} \textemdash\ \\
-\texttt{Light Ray Generator} \textemdash\ \\
+\texttt{Light Cone Generator} \textemdash\ Stitch datasets together to perform analysis over cosmological volumes. \\
+\texttt{Light Ray Generator} \textemdash\ Analyze the path of light rays.\\
\texttt{Radial Column Density} \textemdash\ Calculate column densities around a point (\texttt{radial\_column\_density}). \\
\texttt{Rockstar Halo Finding} \textemdash\ Locate halos of dark matter using the Rockstar halo finder (\texttt{halo\_finding.rockstar}). \\
\texttt{Star Particle Analysis} \textemdash\ Analyze star formation history and assemble spectra (\texttt{star\_analysis}). \\
\texttt{Sunrise Exporter} \textemdash\ Export data to the sunrise visualization format (\texttt{sunrise\_export}). \\
\texttt{Two Point Functions} \textemdash\ Two point correlations (\texttt{two\_point\_functions}). \\
-\end{tabular}
\subsection{Parallel Analysis}
\settowidth{\MyLen}{\texttt{multicol}}
@@ -357,25 +330,24 @@
{\it mpirun -n 12 python script.py --parallel}\\
This command may differ for each system on which you use yt;
please consult the system documentation for details on how to run parallel applications.
-\begin{tabular}{@{}p{8cm}}
+
\texttt{from yt.pmods import *} \textemdash\ Load yt faster when in parallel.
This replaces the usual \texttt{from yt.mods import *}.\\
\texttt{parallel\_objects()} \textemdash\ A way to parallelize analysis over objects
(such as halos or clumps).\\
-\end{tabular}
\subsection{Pre-Installed Versions}
\settowidth{\MyLen}{\texttt{multicol}}
yt is pre-installed on several supercomputer systems.
-\begin{tabular}{@{}p{8cm}}
+
\textbf{NICS Kraken} \textemdash\ {\it module load yt} \\
-\end{tabular}
+
\subsection{Mercurial}
\settowidth{\MyLen}{\texttt{multicol}}
Please see \url{http://mercurial.selenic.com/} for the full Mercurial documentation.
-\begin{tabular}{@{}p{8cm}}
+
\texttt{hg clone https://bitbucket.org/yt\_analysis/yt} \textemdash\ Clone a copy of yt. \\
\texttt{hg status} \textemdash\ Files changed in working directory.\\
\texttt{hg diff} \textemdash\ Print diff of all changed files in working directory. \\
@@ -389,14 +361,13 @@
\texttt{hg push} \textemdash\ Push changes to default remote repository. \\
\texttt{hg pull} \textemdash\ Pull changes from default remote repository. \\
\texttt{hg serve} \textemdash\ Launch a webserver on the local machine to examine the repository in a web browser. \\
-\end{tabular}
\subsection{FAQ}
\settowidth{\MyLen}{\texttt{multicol}}
-\begin{tabular}{@{}p{8cm}}
+
\texttt{pf.field\_info[`field'].take\_log = False} \textemdash\ When plotting \texttt{field}, do not take log.
Must enter \texttt{pf.h} before this command. \\
-\end{tabular}
+
%\rule{0.3\linewidth}{0.25pt}
%\scriptsize
diff -r bcb26c76ff8c007e2e8e6c84c0b6164cb562a2bc -r 7690b3873f6ef72324482c5a3aedf51a6b382b0d source/analysis_modules/radial_column_density.rst
--- a/source/analysis_modules/radial_column_density.rst
+++ b/source/analysis_modules/radial_column_density.rst
@@ -47,6 +47,7 @@
max_radius = 0.5)
def _RCDNumberDensity(field, data, rcd = rcdnumdens):
return rcd._build_derived_field(data)
+ add_field('RCDNumberDensity', _RCDNumberDensity, units=r'1/\rm{cm}^2')
dd = pf.h.all_data()
print dd['RCDNumberDensity']
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list