<div dir="ltr">Hi Geoffrey, <div><br></div><div>At first I thought particle io would be simple to add, but after reading stephen's response and looking into it more, it seems you will need to either mask the particles after the fact or modify the hdf5_light_reader.  Once you do that, you'll need to also modify the particle_io.py file, as I had started to (with a minor adjustment to call the correct type of reader).  My failed attempt was taken out by the time I PR'ed the ellipsoid speedup, but you can see the attempt if you look at:</div>


<div><br></div><div><a href="https://bitbucket.org/samskillman/yt/commits/8dd9d9819b061bcfa68d2ef962e44f44810228f3" target="_blank">https://bitbucket.org/samskillman/yt/commits/8dd9d9819b061bcfa68d2ef962e44f44810228f3</a><br>

</div><div><br>
</div><div>Hope that helps.</div><div><br></div><div>Additionally, if you could test out the PR I just submitted and let me know if you get a speed boost, that'd be great.  For the nosetests I got a speedup from about 60 seconds in test_ellipsoids.py to 36 seconds.</div>


<div><br></div><div>Cheers,</div><div>Sam</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 1, 2013 at 4:51 PM, Geoffrey So <span dir="ltr"><<a href="mailto:gsiisg@gmail.com" target="_blank">gsiisg@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ah this file is it, I guess I didn't know reading the particles for the 3D objects was in a whole different file.<div>

<br></div><div>Thanks, I'll look into it.</div><div><br></div><div>
From</div><span class="HOEnZb"><font color="#888888"><div>G.S.</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 1, 2013 at 3:39 PM, Stephen Skory <span dir="ltr"><<a href="mailto:s@skory.us" target="_blank">s@skory.us</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><br>
> I am interested at least in fixing it, because I may use this directly in my<br>
> research, so I was wondering if anyone has worked on 3D containers to help<br>
> me out in digging for the cause of this?<br>
<br>
</div>It is unfortunate that Matt is on vacation because he would be the<br>
best equipped to answer this, but I've done some particle stuff in yt<br>
for enzo data, so I'll take a shot.<br>
<br>
One answer is you'll have to add some functions to<br>
yt/utilities/hdf5_light_reader.c that can select out particles from an<br>
ellipsoid. You can see how it's done for a cylinder, sphere, or<br>
right-angled region already. You'll also have to make some<br>
commensurate changes in the python interface such that these new<br>
functions are called, but for the time being you can study that .c<br>
file and decide if that's the route you want to go down, since that is<br>
the hardest part!<br>
<br>
Another answer is to make your changes in yt-3, which is still under<br>
heavy development. In particular, it is using a different model of how<br>
to read in and process data, which may make your life easier. I am not<br>
knowledgable enough to help you with that, you will have to wait on<br>
Matt for this.<br>
<br>
A more hacky route is to kludge it for the time being and do something<br>
like this.<br>
- For the ellipsoid create a sphere that contains it entirely.<br>
- Get the particle positions from the sphere.<br>
- Apply the math you use to select cells to these particle positions,<br>
keeping particles that are inside. With this you can create a mask<br>
which you can use to apply to other fields (e.g.<br>
big_enough_sphere['ParticleMassMsun'][mask])<br>
<br>
Good luck!<br>
<br>
--<br>
Stephen Skory<br>
<a href="mailto:s@skory.us" target="_blank">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" target="_blank">510.621.3687</a> (google voice)<br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">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>
</blockquote></div><br></div>
</div></div><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>
<br></blockquote></div><br></div>