[Yt-svn] yt-commit r1273 - trunk/examples

sskory at wrangler.dreamhost.com sskory at wrangler.dreamhost.com
Thu Apr 23 09:57:04 PDT 2009


Author: sskory
Date: Thu Apr 23 09:57:02 2009
New Revision: 1273
URL: http://yt.spacepope.org/changeset/1273

Log:
updating examples/ to reflect upcoming HaloFinder change.

Modified:
   trunk/examples/cookbook_hop_mass_sum.py
   trunk/examples/fastBuildMerge.py

Modified: trunk/examples/cookbook_hop_mass_sum.py
==============================================================================
--- trunk/examples/cookbook_hop_mass_sum.py	(original)
+++ trunk/examples/cookbook_hop_mass_sum.py	Thu Apr 23 09:57:02 2009
@@ -1,10 +1,8 @@
 from yt.mods import *
-from yt.lagos import hop
 
 pf = get_pf() # last argument on the command line gets turned into an EnzoStaticOutput
 
-full_sphere = pf.h.sphere([0.5,0.5,0.5], 1.0) # Everything, no pre-loading of fields
-hop_results = hop.HopList(full_sphere, 80.0) # threshold = 80
+hop_results = HaloFinder.HOPHaloFinder(pf, threshold=80.0)
 
 def get_mass_results(hop_group):
     sphere = hop_group.get_sphere()

Modified: trunk/examples/fastBuildMerge.py
==============================================================================
--- trunk/examples/fastBuildMerge.py	(original)
+++ trunk/examples/fastBuildMerge.py	Thu Apr 23 09:57:02 2009
@@ -63,8 +63,8 @@
 print "import %s" % name
 print "import yt.raven as raven"
 print "import yt.lagos as lagos"
-print "import yt.lagos.hop as hop"
 print "from yt.lagos import mylog"
+print "from yt.mods import *"
 
 print """
 def instantiateSnapshots(dirbasename,filebasename,start,end):
@@ -116,8 +116,8 @@
         break
     
     # we need to run hop on the snapshot
-    print "sphere = snapshots[%d].h.sphere([0.5,0.5,0.5],1.0)" % nextsnapshot
-    print "hop_results = lagos.hop.HopList(sphere, %f, dm_only=dmonly)" % hopthreshold
+    print "hop_results = HaloFinder.HOPHaloFinder(snapshots[%d], threshold=%f, dm_only=dmonly)" % \
+        (nextsnapshot,hopthreshold)
     
     # get the group info for the next snapshot
     # get group positions
@@ -134,8 +134,8 @@
     # in the beginning we need to read in two groups before we build the links, so do everything above
     # again
     if (snapshot==start):
-        print "sphere = snapshots[%d].h.sphere([0.5,0.5,0.5],1.0)" % snapshot
-        print "hop_results = lagos.hop.HopList(sphere, %f, dm_only=dmonly)" % hopthreshold
+        print "hop_results = HaloFinder.HOPHaloFinder(snapshots[%d], threshold=%f, dm_only=dmonly)" % \
+            (snapshot,hopthreshold)
         print "positions = %s.convertPositionsSelected(hop_results,%d,positions,indices)" % (name,snapshot)
         print "g%04d = %s.convertGroupsSelected(hop_results,%d,indices)" % (snapshot,name,snapshot)
         print "for g in g%04d: g.particles.sort()\n" % snapshot



More information about the yt-svn mailing list