Yo, now that I've been playing around with stars and creation_time, I've noticed a bug in HaloFinding. The total_mass line below will include stars regardless of dm_only: # do it once with no padding so the total_mass is correct (no duplicated particles) self.padding = 0.0 padded, LE, RE, data_source = self._partition_hierarchy_3d(padding=self.padding) # For scaling the threshold, note that it's a passthrough total_mass = self._mpi_allsum(data_source["ParticleMassMsun"].sum()) Is there a better way to fix it than this? # do it once with no padding so the total_mass is correct (no duplicated particles) self.padding = 0.0 padded, LE, RE, data_source = self._partition_hierarchy_3d(padding=self.padding) # For scaling the threshold, note that it's a passthrough if dm_only: select = data_source["creation_time"] > 0 total_mass = self._mpi_allsum(data_source["ParticleMassMsun"][select].sum()) else: total_mass = self._mpi_allsum(data_source["ParticleMassMsun"].sum()) _______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________
Is there a better way to fix it than this?
I guess what I'm really asking is there a faster way to find out if there are any stars *at all*? If there are no stars and dm_only=True, then we could skip reading creation_time altogether. _______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________
I think the idea is correct, but we can do a slightly better
implementation. I was planning -- as I mentioned to you off list --
to code up something to handle this, but other obligations got in the
way. So here's what I'd suggest.
Create a new derived quantity, TotalParticleMass. Add as an optional
argument particle_type (I have no interest in using creation_time any
longer as a distinguishing factor, so feel free to overload the field
in EnzoFields.py) and then "if particle_type is not None" use it as a
cut for the particles. Otherwise just sum up ParticleMassMsun.
We should be using Quantities here rather than a sum of the data
source's field anyway, and this'll be a great time to convert!
-Matt
On Sat, Jun 20, 2009 at 8:13 PM, Stephen Skory
Is there a better way to fix it than this?
I guess what I'm really asking is there a faster way to find out if there are any stars *at all*? If there are no stars and dm_only=True, then we could skip reading creation_time altogether.
_______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________ _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (2)
-
Matthew Turk
-
Stephen Skory