[yt-dev] Issue #629: Rockstar support for particle codes (Gadget) (yt_analysis/yt)

Oliver Hahn issues-reply at bitbucket.org
Sun Aug 18 15:07:38 PDT 2013


New issue 629: Rockstar support for particle codes (Gadget)
https://bitbucket.org/yt_analysis/yt/issue/629/rockstar-support-for-particle-codes-gadget

Oliver Hahn:

Two issues with running rockstar with Gadget data (and probably other non-grid codes)
First issue was that yt is looking for grids, fix has been supplied by Chris Moody:
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx	Sat Aug 17 11:47:21 2013 -0400
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx	Sun Aug 18 15:05:26 2013 -0700
@@ -190,8 +190,6 @@
     else:
         local_parts = TOTAL_PARTICLES
 
-    #print "local_parts", local_parts
-
     p[0] = <particle *> malloc(sizeof(particle) * local_parts)
 
     conv[0] = conv[1] = conv[2] = pf["mpchcm"]
@@ -201,8 +199,12 @@
     left_edge[2] = pf.domain_left_edge[2]
     left_edge[3] = left_edge[4] = left_edge[5] = 0.0
     pi = 0
-    for g in pf.h._get_objs("grids"):
-        if g.NumberOfParticles == 0: continue
+    if "grids" in dir(pf.h):
+        sources = pf.h._get_objs("grids")
+    else:
+        sources = [pf.h.all_data()]
+    for g in sources:
+        if len(g['particle_position_x']) == 0: continue
         if (rh.dm_only or (not has_particle_type)):
             if rh.hires_only:
                 iddm = (g['ParticleMassMsun'] < PARTICLE_MASS*1.1)



Second problem then is that still some field names are not present. Error shows up
as follows:

[     0s] Reading 1 blocks for snapshot 0...
reading from particle filename ./inline.0: snapshot_011
Exception yt.utilities.exceptions.YTFieldNotFound: YTFieldNotFound() in 'yt.analysis_modules.halo_finding.rockstar.rockstar_interface.rh_read_particles' ignored







More information about the yt-dev mailing list