[yt-svn] commit/yt: ngoldbaum: Merged in samskillman/yt (pull request #1317)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Dec 2 14:47:49 PST 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/ace1367a9281/
Changeset:   ace1367a9281
Branch:      yt
User:        ngoldbaum
Date:        2014-12-02 22:47:37+00:00
Summary:     Merged in samskillman/yt (pull request #1317)

yt-rockstar updates
Affected #:  2 files

diff -r 31ae0c99074a8cae7e61041d94d477cc1dfe2c10 -r ace1367a92817ab0dc1dd2b0fe5735fd0494a9ea yt/analysis_modules/halo_finding/rockstar/rockstar.py
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar.py
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar.py
@@ -195,7 +195,7 @@
     def __init__(self, ts, num_readers = 1, num_writers = None,
             outbase="rockstar_halos", particle_type="all",
             force_res=None, total_particles=None, dm_only=False,
-            particle_mass=None):
+            particle_mass=None, min_halo_size=25):
         if is_root():
             mylog.info("The citation for the Rockstar halo finder can be found at")
             mylog.info("http://adsabs.harvard.edu/abs/2013ApJ...762..109B")
@@ -217,6 +217,7 @@
         self.ts = ts
         self.particle_type = particle_type
         self.outbase = outbase
+        self.min_halo_size = min_halo_size
         if force_res is None:
             tds = ts[-1] # Cache a reference
             self.force_res = tds.index.get_smallest_dx().in_units("Mpc/h")
@@ -263,9 +264,9 @@
             tp = dd.quantities.total_quantity((ptype, "particle_ones"))
             p['total_particles'] = int(tp)
             mylog.warning("Total Particle Count: %0.3e", int(tp))
-        p['left_edge'] = tds.domain_left_edge
-        p['right_edge'] = tds.domain_right_edge
-        p['center'] = (tds.domain_right_edge + tds.domain_left_edge)/2.0
+        p['left_edge'] = tds.domain_left_edge.in_units("Mpccm/h")
+        p['right_edge'] = tds.domain_right_edge.in_units("Mpccm/h")
+        p['center'] = (tds.domain_right_edge.in_units("Mpccm/h") + tds.domain_left_edge.in_units("Mpccm/h"))/2.0
         p['particle_mass'] = self.particle_mass = particle_mass
         p['particle_mass'].convert_to_units("Msun / h")
         del tds
@@ -342,7 +343,8 @@
                     outbase = self.outbase,
                     force_res = self.force_res,
                     callbacks = callbacks,
-                    restart_num = restart_num)
+                    restart_num = restart_num,
+                    min_halo_size = self.min_halo_size)
         # Make the directory to store the halo lists in.
         if not self.outbase:
             self.outbase = os.getcwd()

diff -r 31ae0c99074a8cae7e61041d94d477cc1dfe2c10 -r ace1367a92817ab0dc1dd2b0fe5735fd0494a9ea yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
@@ -203,9 +203,9 @@
 
     p[0] = <particle *> malloc(sizeof(particle) * local_parts)
 
-    left_edge[0] = ds.domain_left_edge[0]
-    left_edge[1] = ds.domain_left_edge[1]
-    left_edge[2] = ds.domain_left_edge[2]
+    left_edge[0] = ds.domain_left_edge.in_units('Mpccm/h')[0]
+    left_edge[1] = ds.domain_left_edge.in_units('Mpccm/h')[1]
+    left_edge[2] = ds.domain_left_edge.in_units('Mpccm/h')[2]
     left_edge[3] = left_edge[4] = left_edge[5] = 0.0
     pi = 0
     fields = [ (rh.particle_type, f) for f in

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

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