I think I see what the problem is here. The smallest bin for the profile is
0.021 and the maximum radius is 0.029, so even if 64 bins are requested, the
profiler is only going to have one bin or bins full of zeros. From the
orginal error message, it looks like it only had one bin. Since virial
quantities are calculated by interpolating between bins where the
overdensity crosses the critical overdensity, it needs at least 2 bins to do
anything. I think the solution is to put a check in to see if the profile
only has one bin, and skip further operations on that halo.
As a side note, the first bin for CellVolume will always be zero, since the
radius of the bin is zero. Maybe that should be changed. Any thoughts on
that?
I can commit a fix to this that works as mentioned above. Any objections to
this?
Thanks for finding that!
Britton
On Sun, Jan 25, 2009 at 4:27 PM, Stephen Skory
----- Original Message ----
From: Matthew Turk
To: yt-dev@lists.spacepope.org Sent: Sunday, January 25, 2009 3:22:09 PM Subject: Re: [Yt-dev] HaloProfiler Problems OH! And what's the radius of the halo, and how many cells does it get if you make a sphere from the HOPGroup? THAT is the key thing, actually...
When it calls this on the first problem halo:
profile = lagos.BinnedProfile1D(sphere,self.haloProfilerParameters['n_bins'],"RadiusMpc", (4*self.pf.h.get_smallest_dx() * self.pf ['mpc']),halo['r_max'], log_space=True, lazy_reader=True)
self.haloProfilerParameters['n_bins'] = 64 (4*self.pf.h.get_smallest_dx() * self.pf['mpc']) = 0.021143 halo['r_max'] = 0.029493
_______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ http://physics.ucsd.edu/%7Esskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________ _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org