[yt-svn] commit/yt-doc: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Thu Dec 13 14:08:31 PST 2012


2 new commits in yt-doc:


https://bitbucket.org/yt_analysis/yt-doc/changeset/9d417d31755c/
changeset:   9d417d31755c
user:        sskory
date:        2012-12-04 17:11:09
summary:     Modifying the Rockstar docs for recent changes.
affected #:  1 file

diff -r dc8c2cecac47eac70516e09572cd1aa4273c823c -r 9d417d31755c97829618c4a9da22f2d02606ae2e source/analysis_modules/running_halofinder.rst
--- a/source/analysis_modules/running_halofinder.rst
+++ b/source/analysis_modules/running_halofinder.rst
@@ -478,9 +478,12 @@
 the MPI libraries allow yt to distribute particle information across multiple 
 nodes.
 
-.. code-block:: bash
-  
-  mpirun -n3 yt test_rockstar.py --parallel
+.. warning:: At the moment, running Rockstar inside of yt on multiple compute nodes
+   connected by an Infiniband network can be problematic. Therefore, for now
+   we recommend forcing the use of the non-Infiniband network (e.g. Ethernet)
+   using this flag: ``--mca btl ^openib``.
+   For example, here is how Rockstar might be called using 24 cores:
+   ``mpirun -n 24 --mca btl ^openib python ./run_rockstar.py --parallel``.
 
 Designing the python script itself is straightforward:
 
@@ -494,9 +497,7 @@
   #hopefully the file name order is chronological
   files.sort()
   ts = TimeSeriesData.from_filenames(files[:])
-  # Need to supply the DM particle mass in Msun.
-  pm = 7.81769027e+11
-  rh = RockstarHaloFinder(ts, particle_mass=pm)
+  rh = RockstarHaloFinder(ts)
   rh.run()
 
 The script above configures the Halo finder, launches a server process which 
@@ -506,8 +507,6 @@
 content.
 
 The RockstarHaloFinder class has these options:
-  * ``particle_mass``, the fixed mass of the particles.
-    Cannot vary between particles.
   * ``dm_type``, the index of the dark matter particle. Default is 1. 
   * ``outbase``, This is where the out*list files that Rockstar makes should be
     placed. Default is 'rockstar_halos'.
@@ -524,6 +523,18 @@
     last data snapshot (i.e. the one where time has evolved the
     longest) in the time series:
     ``pf_last.h.get_smallest_dx() * pf_last['mpch']``.
+  * ``total_particles``, if supplied, this is a pre-calculated
+    total number of dark matter
+    particles present in the simulation. For example, this is useful
+    when analyzing a series of snapshots where the number of dark
+    matter particles should not change and this will save some disk
+    access time. If left unspecified, it will
+    be calculated automatically. Default: ``None``.
+  * ``dm_only``, if set to ``True``, it will be assumed that there are
+    only dark matter particles present in the simulation.
+    This option does not modify the halos found by Rockstar, however
+    this option can save disk access time if there are no star particles
+    (or other non-dark matter particles) in the simulation. Default: ``False``.
 
 
 Output Analysis
@@ -617,21 +628,10 @@
         mine = ytcfg.getint('yt','__topcomm_parallel_rank')
         size = ytcfg.getint('yt','__topcomm_parallel_size')
 
-        # Get DM particle mass
-        all_fields = set(pf.h.derived_field_list + pf.h.field_list)
-        for g in pf.h.grids:
-            if g.proc_num == mine:
-                if 'particle_type' in all_fields:
-                    sel = g['particle_type'] == 1
-                else:
-                    sel = Ellipsis
-                pm = g['ParticleMassMsun'][sel][0]
-                break
-                
         # Call rockstar.
         ts = TimeSeriesData([pf])
         outbase = "./rockstar_halos_%04d" % pf['NumberOfPythonTopGridCalls']
-        rh = RockstarHaloFinder(ts, num_readers = size, particle_mass=pm,
+        rh = RockstarHaloFinder(ts, num_readers = size,
             outbase = outbase)
         rh.run()
     



https://bitbucket.org/yt_analysis/yt-doc/changeset/3dee29549c25/
changeset:   3dee29549c25
user:        sskory
date:        2012-12-13 23:05:53
summary:     Adding a incomplete cheat sheet.
affected #:  1 file

diff -r 9d417d31755c97829618c4a9da22f2d02606ae2e -r 3dee29549c252fa44eccf29de6326e1d09968c49 cheatsheet.tex
--- /dev/null
+++ b/cheatsheet.tex
@@ -0,0 +1,234 @@
+\documentclass[10pt,landscape]{article}
+\usepackage{multicol}
+\usepackage{calc}
+\usepackage{ifthen}
+\usepackage[landscape]{geometry}
+\usepackage[colorlinks = true, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
+
+% To make this come out properly in landscape mode, do one of the following
+% 1.
+%  pdflatex latexsheet.tex
+%
+% 2.
+%  latex latexsheet.tex
+%  dvips -P pdf  -t landscape latexsheet.dvi
+%  ps2pdf latexsheet.ps
+
+
+% If you're reading this, be prepared for confusion.  Making this was
+% a learning experience for me, and it shows.  Much of the placement
+% was hacked in; if you make it better, let me know...
+
+
+% 2008-04
+% Changed page margin code to use the geometry package. Also added code for
+% conditional page margins, depending on paper size. Thanks to Uwe Ziegenhagen
+% for the suggestions.
+
+% 2006-08
+% Made changes based on suggestions from Gene Cooperman. <gene at ccs.neu.edu>
+
+% 2012-11 - Stephen Skory
+% Converted the latex cheat sheet to a yt cheat sheet, taken from
+% http://www.stdout.org/~winston/latex/
+
+
+% This sets page margins to .5 inch if using letter paper, and to 1cm
+% if using A4 paper. (This probably isn't strictly necessary.)
+% If using another size paper, use default 1cm margins.
+\ifthenelse{\lengthtest { \paperwidth = 11in}}
+	{ \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} }
+	{\ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
+		{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
+		{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
+	}
+
+% Turn off header and footer
+\pagestyle{empty}
+ 
+
+% Redefine section commands to use less space
+\makeatletter
+\renewcommand{\section}{\@startsection{section}{1}{0mm}%
+                                {-1ex plus -.5ex minus -.2ex}%
+                                {0.5ex plus .2ex}%x
+                                {\normalfont\large\bfseries}}
+\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}%
+                                {-1explus -.5ex minus -.2ex}%
+                                {0.5ex plus .2ex}%
+                                {\normalfont\normalsize\bfseries}}
+\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}%
+                                {-1ex plus -.5ex minus -.2ex}%
+                                {1ex plus .2ex}%
+                                {\normalfont\small\bfseries}}
+\makeatother
+
+% Define BibTeX command
+\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
+    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
+
+% Don't print section numbers
+\setcounter{secnumdepth}{0}
+
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{0pt plus 0.5ex}
+
+
+% -----------------------------------------------------------------------
+
+\begin{document}
+
+\raggedright
+\footnotesize
+\begin{multicols}{3}
+
+
+% multicol parameters
+% These lengths are set only within the two main columns
+%\setlength{\columnseprule}{0.25pt}
+\setlength{\premulticols}{1pt}
+\setlength{\postmulticols}{1pt}
+\setlength{\multicolsep}{1pt}
+\setlength{\columnsep}{2pt}
+
+\begin{center}
+     \Large{\textbf{yt Cheat Sheet}} \\
+\end{center}
+
+\subsection{General Info}
+For everything yt please see \url{http://yt-project.org}.
+Documentation \url{http://yt-project.org/doc/index.html}.
+Need help, start here \url{http://yt-project.org/doc/help/} and then
+try the IRC chat room \url{http://yt-project.org/irc.html},
+or the mailing list \url{http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org}.
+
+
+\subsection{Command Line yt}
+\begin{tabular}{@{}ll@{}}
+\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 instinfo} & yt installation information. \\
+\texttt{yt serve} (\it{dataset})  &  Run web GUI.\\
+\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 \\
+ & volume rendering. \\
+\texttt{yt mapserver} {\it dataset} & View plot in Gmaps-like \\
+ & interface. \\
+\texttt{yt pastebin} \it{text.out} & Post text to the pastebin at\\
+ & paste.yt-project.org. \\ 
+\texttt{yt pastebin\_grab} {\it identifier} & Print content of pastebin to \\
+ & STDOUT. \\
+ \texttt{yt hub\_register} & Register with\\
+  & hub.yt-project.org. \\
+\texttt{yt hub\_submit} & Submit hg repo to\\
+ &  hub.yt-project.org. \\
+\texttt{yt bootstrap\_dev} & 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 \\
+ & session. 
+\end{tabular}
+
+Many commands have flags to control behavior.
+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.
+({\it Parentheticals}) above are optional.
+
+\subsection{yt Imports}
+\newlength{\MyLen}
+\settowidth{\MyLen}{\texttt{letterpaper}/\texttt{a4paper} \ }
+%\begin{tabular}{@{}p{\the\MyLen}%
+%                @{}p{\linewidth-\the\MyLen}@{}}
+%\begin{tabular}{@{}ll@{}}
+\begin{tabular}{@{}l}
+\texttt{from yt.mods import \textasteriskcentered} \\
+\hspace{10pt} Load base yt  modules. \\
+\texttt{from yt.config import ytcfg} \\
+\hspace{10pt} Used to set yt configuration options.\\
+\hspace{10pt} If used, must be called before importing other modules.\\
+\texttt{from yt.analysis\_modules.api import \textasteriskcentered}  \\
+\hspace{10pt} Load all yt analysis modules. \\
+\texttt{from yt.analysis\_modules.\emph{halo\_finding}.api import \textasteriskcentered} \\
+\hspace{10pt} Load halo finding modules. Other modules, listed below, \\
+\hspace{10pt} are loaded in a similar way by swapping the \\
+\hspace{10pt} {\em emphasized} text.\\
+\texttt{absorption\_spectrum}, \texttt{coordinate\_transformation}, \\
+\texttt{cosmological\_observation}, \texttt{halo\_mass\_function}, \\
+\texttt{halo\_merger\_tree}, \texttt{halo\_profiler}, \texttt{level\_sets}, \\
+\texttt{hierarchy\_subset}, \texttt{radial\_column\_density}, \\
+\texttt{spectral\_integrator}, \texttt{star\_analysis}, \texttt{sunrise\_export}, \\
+\texttt{two\_point\_functions}
+\end{tabular}
+The import commands are entered in the Python shell or
+used as part of a script.
+
+
+\subsection{Load and Access Data}
+\settowidth{\MyLen}{\texttt{multicol} }
+%\begin{tabular}{@{}p{\the\MyLen}%
+ %               @{}p{\linewidth-\the\MyLen}@{}}
+\begin{tabular}{@{}l}
+\texttt{pf = load(}{\it dataset}\texttt{)} \textemdash\   Load 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 \\
+numpy array \texttt{a}. Similarly for other data containers.\\
+\texttt{pf.h.field\_list} \textemdash\ A list of available fields in the snapshot. \\
+\texttt{pf.h.derived\_field\_list} \textemdash\ A list of available derived fields \\
+in the snapshot. \\
+\texttt{val, loc = pf.h.find\_max("Density")} \textemdash\ Find the \texttt{val}ue of\\
+the maximum of the field \texttt{Density} and its \texttt{loc}ation. \\
+\texttt{sp = pf.h.sphere(}{\it cen}\texttt{,}{\it radius}\texttt{)} \textemdash\   Create a spherical data \\ 
+container. {\it cen} may be a coordinate, or 'max' which \\
+centers on the max density point. {\it radius} may be a float in \\ 
+code units or a tuple of ({\it length, unit}).\\
+
+\texttt{re = pf.h.region({\it cen}, {\it left edge}, {\it right edge})} \textemdash\ Create a\\
+rectilinear data container. {\it cen} is required but not used.\\
+{\it left} and {\it right edge} are coordinate values that define the region.\\
+
+\texttt{di = pf.h.disk({\it cen}, {\it normal}, {\it radius}, {\it height})} \textemdash\ \\
+Create a cylindrical data container centered at {\it cen} along the \\
+direction set by {\it normal},with total length\\
+ 2$\times${\it height} and with radius {\it radius}.
+ 
+\end{tabular}
+
+
+
+\subsection{Numpy Arrays}
+\settowidth{\MyLen}{\texttt{multicol} }
+\begin{tabular}{@{}l}
+
+\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}.\\
+\texttt{v = a[}{\it index}\texttt{]} \textemdash\ Select a single value from \texttt{a} at location {\it index}.\\
+\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}. \\
+
+\end{tabular}
+
+Please see \url{http://docs.scipy.org/doc/numpy/reference/} for the full
+numpy documentation.
+
+
+
+%\rule{0.3\linewidth}{0.25pt}
+%\scriptsize
+
+% Can put some final stuff here like copyright etc...
+
+
+\end{multicols}
+\end{document}
\ No newline at end of file

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