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.<br>
<br>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?<br><br>I can commit a fix to this that works as mentioned above.  Any objections to this?<br>
<br>Thanks for finding that!<br><br>Britton<br><br><div class="gmail_quote">On Sun, Jan 25, 2009 at 4:27 PM, Stephen Skory <span dir="ltr"><<a href="mailto:stephenskory@yahoo.com">stephenskory@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
<br>
----- Original Message ----<br>
> From: Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>
> To: <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
> Sent: Sunday, January 25, 2009 3:22:09 PM<br>
> Subject: Re: [Yt-dev] HaloProfiler Problems<br>
><br>
> OH!  And what's the radius of the halo, and how many cells does it get<br>
> if you make a sphere from the HOPGroup?  THAT is the key thing,<br>
> actually...<br>
<br>
</div>When it calls this on the first problem halo:<br>
<br>
profile = lagos.BinnedProfile1D(sphere,self.haloProfilerParameters['n_bins'],"RadiusMpc",<br>
                        (4*self.pf.h.get_smallest_dx() * <a href="http://self.pf" target="_blank">self.pf</a>['mpc']),halo['r_max'],<br>
                        log_space=True, lazy_reader=True)<br>
<br>
<br>
self.haloProfilerParameters['n_bins'] = 64<br>
(4*self.pf.h.get_smallest_dx() * <a href="http://self.pf" target="_blank">self.pf</a>['mpc']) = 0.021143<br>
halo['r_max'] = 0.029493<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________________________<br>
<a href="mailto:sskory@physics.ucsd.edu">sskory@physics.ucsd.edu</a>           o__  Stephen Skory<br>
<a href="http://physics.ucsd.edu/%7Esskory/" target="_blank">http://physics.ucsd.edu/~sskory/</a> _.>/ _Graduate Student<br>
________________________________(_)_\(_)_______________<br>
_______________________________________________<br>
Yt-dev mailing list<br>
<a href="mailto:Yt-dev@lists.spacepope.org">Yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</div></div></blockquote></div><br>