[Yt-svn] commit/yt-doc: sskory: Updating the merger tree docs with imports and updated examples.

Bitbucket commits-noreply at bitbucket.org
Thu Mar 10 08:33:53 PST 2011


1 new changeset in yt-doc:

http://bitbucket.org/yt_analysis/yt-doc/changeset/b383d7c69ed0/
changeset:   r38:b383d7c69ed0
user:        sskory
date:        2011-03-10 17:33:47
summary:     Updating the merger tree docs with imports and updated examples.
affected #:  1 file (1.2 KB)

--- a/source/analysis_modules/merger_tree.rst	Tue Mar 08 10:43:54 2011 -0700
+++ b/source/analysis_modules/merger_tree.rst	Thu Mar 10 09:33:47 2011 -0700
@@ -15,7 +15,7 @@
 General Overview
 ----------------
 
-The first requirement is a set of sequential Enzo datasets.
+The first requirement is a set of sequential datasets.
 The detail of the merger tree is increased as the difference in
 time between snapshots is reduced, at the cost of higher computational effort
 for the tree itself and and disk usage for the snapshots.
@@ -110,7 +110,9 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
+  from yt.analysis_modules.halo_finding.api import *
 
   files = []
   start = 100
@@ -134,7 +136,9 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
+  from yt.analysis_modules.halo_finding.api import *
   import yt.analysis_modules.simulation_handler.api as ES
   
   es = ES.EnzoSimulation('/path/to/snapshots/simulation.par')
@@ -226,6 +230,13 @@
   halos.write_particle_lists('MergerHalos')
   halos.write_particle_lists_txt('MergerHalos')
 
+There is a convenience function that will call the three functions above
+at one time:
+
+.. code-block:: python
+
+  halos.dump('MergerHalos')
+
 Please see the documents on halo finding for more information on what these
 commands do (:ref:`halo_finding`).
 
@@ -291,6 +302,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
 
   mtc = MergerTreeConnect(database='halos.db')
@@ -306,6 +318,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
 
   mtc = MergerTreeConnect(database='halos.db')
@@ -336,6 +349,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
 
   mtc = MergerTreeConnect(database='halos.db')
@@ -370,6 +384,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   mtc = MergerTreeConnect(database='halos.db')
@@ -395,6 +410,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   mtc = MergerTreeConnect(database='halos.db')
@@ -417,6 +433,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   mtc = MergerTreeConnect(database='halos.db')
@@ -599,6 +616,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   mtc = MergerTreeConnect(database='halos.db')
@@ -612,6 +630,19 @@
 ``SnapHaloID``=0. ``results`` will contain a one-tuple in a list of the
 desired ``GlobalHaloID``.
 
+Alternatively, one of the convenience functions can be used which may be easier:
+
+.. code-block:: python
+
+  from yt.mods import *
+  
+  mtc = MergerTreeConnect(database='halos.db')
+  
+  thisHalo = mtc.get_GlobalHaloID(0, 0.0)
+
+``thisHalo`` will be an integer giving the GlobalHaloID for the most massive
+halo (ID=0) at z=0.0.
+
 To output the merger tree for the five largest halos in the last snapshot,
 it may be simplest to find the ``SnapCurrentTimeIdentifier`` for that
 snapshot.
@@ -622,6 +653,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   mtc = MergerTreeConnect(database='halos.db')
@@ -640,6 +672,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   MergerTreeDotOutput(halos=[0,1,2,3,4], database='halos.db',
@@ -655,6 +688,7 @@
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
   
   MergerTreeDotOutput(halos=[24212,5822,19822,10423,51324], database='halos.db',
@@ -664,6 +698,18 @@
 parent and child halos for which at least 70% of the parent halo's mass goes
 to the child. The default is 0.2.
 
+In this slightly modified example below, if ``dot`` is installed in the
+``PATH``, an image file will be created without an intermediate text file:
+
+.. code-block:: python
+
+  from yt.mods import *
+  from yt.analysis_modules.halo_merger_tree.api import *
+  
+  MergerTreeDotOutput(halos=[24212,5822,19822,10423,51324], database='halos.db',
+      dotfile='MergerTree.png', link_min=0.7)
+
+
 Plain-Text Output
 ~~~~~~~~~~~~~~~~~
 
@@ -679,12 +725,15 @@
 -----------------------
 
 Here is an example of how to create a merger tree for the most massive halo
-in the final snapshot from start to finish.
+in the final snapshot from start to finish, and output the Graphviz
+visualization as a PDF file.
 This will work in serial and in parallel.
 
 .. code-block:: python
 
+  from yt.mods import *
   from yt.analysis_modules.halo_merger_tree.api import *
+  from yt.analysis_modules.halo_finding.api import *
 
   # Pick our snapshots to use.
   files = []
@@ -700,13 +749,11 @@
   
   # Get the GlobalHaloID for the halo.
   mtc = MergerTreeConnect(database=my_database)
-  line = "SELECT max(GlobalHaloID) FROM Halos WHERE SnapHaloID=0;"
-  results = mtc.query(line)
-  my_halo = results[0][0] # one-tuple in a list
+  my_halo = mtc.get_GlobalHaloID(0, 0.0)
   
-  # Output the Graphviz file.
+  # Output the tree as a PDF file.
   MergerTreeDotOutput(halos=my_halo, database=my_database, link_min=0.5,
-      dotfile='MergerTree.gv')
+      dotfile='MergerTree.pdf')

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