Yeah for the spheres I use the "Ones" to get a cell count.  I guess if I just want the region around the halo I don't necessarily need to limit myself to the sphere data object, it was just the first thing that came to mind.<div>
<br></div><div>Thanks!</div><div><br></div><div>From</div><div>G.S.<br><br><div class="gmail_quote">On Wed, May 23, 2012 at 1:46 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Geoffrey,<br>
<div><div class="h5"><br>
On Thu, May 24, 2012 at 5:40 AM, Geoffrey So <<a href="mailto:gsiisg@gmail.com">gsiisg@gmail.com</a>> wrote:<br>
> Stephen,<br>
><br>
> I'm printing the warning message when along with the <a href="http://halo.id" target="_blank">halo.id</a> as the<br>
> exception is raised, so it appears that halo 5 in this case has a radius<br>
> smaller than dx, but what it really should be checking is the maximum<br>
> instead of the virial radius instead if I'm not mistaken.<br>
><br>
> Matt,<br>
><br>
> I just want the field attributes of where the halo is located, and I'm<br>
> comparing the attributes to the region surrounding the halo (up to 3x the<br>
> virial or maximum radius) to see if there's anything that is substantially<br>
> different.  I want to see what's different in the field quantity that<br>
> suppresses star formation in lower mass haloes.  In this analysis the<br>
> detailed shape and size of the sphere doesn't really matter, I'm just using<br>
> it as a data container.<br>
><br>
> Right now I'm trying to output Density averaged values of each halo but<br>
> whenever I encounter a halo with radius smaller than a cell (triggering<br>
> YTSphereTooSmall), I output 0 for all attributes.  So I expect lots of zeros<br>
> to occur on the small end.  However I'm seeing some zeros scattered even in<br>
> the high mass end with large maximum radius, and I think the high mass halos<br>
> with zeros is the result of it having a small virial radius, at least that's<br>
> my current hypothesis.<br>
><br>
> I'm going to try to go down the list from the high mass end to see if the<br>
> second halo giving me zeros on the high end also have a virial radius<br>
> smaller than dx.<br>
><br>
> I guess a work around for this problem temporarily is to<br>
> use pf.h.sphere(halo.center_of_mass(), halo.maximum_radius()) instead of<br>
> calling halo.get_sphere().<br>
<br>
</div></div>That makes sense!  Good luck.  One other option would be to take the<br>
halo center and construct a region, with:<br>
<br>
region = pf.h.region(halo_center, halo_center - dx*n_cells,<br>
halo_center + dx*n_cells)<br>
<br>
This will get you a rectangular prism.  (You'll need to set n_cells<br>
and dx.)  A quick way to see how many cells it contains is to take a<br>
look at region["Ones"].size, which should be very fast.<br>
<br>
-Matt<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> From<br>
> G.S.<br>
><br>
><br>
> On Tue, May 22, 2012 at 6:16 PM, Stephen Skory <<a href="mailto:s@skory.us">s@skory.us</a>> wrote:<br>
>><br>
>> Hi Geoffrey and Matt,<br>
>><br>
>> > While I think Stephen might know why the difference between<br>
>> > maximum_radius / virial_radius is confusing the system here,<br>
>><br>
>> I don't quite know what's going on. halo.get_sphere() should give you<br>
>> a YT sphere centered on the center of mass of the halo, with radius of<br>
>> .maximum_radius(). Perhaps it's not halo 5 that's giving you the<br>
>> error? Or there's an error in what you're printing?<br>
>><br>
>> > I want to<br>
>> > suggest you back up a bit.  Do you really want to analyze halos that<br>
>> > are O(dx) across?<br>
>><br>
>> I agree with Matt that you should take a close look at what you are<br>
>> asking from these halos, and if one or just a few cells are sufficient<br>
>> to give you that.<br>
>><br>
>> --<br>
>> Stephen Skory<br>
>> <a href="mailto:s@skory.us">s@skory.us</a><br>
>> <a href="http://stephenskory.com/" target="_blank">http://stephenskory.com/</a><br>
>> <a href="tel:510.621.3687" value="+15106213687">510.621.3687</a> (google voice)<br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div>