[yt-users] Best way to create radial bins

Britton Smith brittonsmith at gmail.com
Mon Apr 28 06:57:51 PDT 2014


Hi Thomas,

What you are describing sounds like exactly the case of a one-dimensional
profile, so I think it's worth going back to the BinnedProfile1D or perhaps
the newer function, create_profile.  You can see the documentation for
create_profile by doing help(create_profile) after "from yt.mods import *".
 There are some ways in which you could speed this process up, like running
in parallel and limiting the size of the region over which you perform the
profile.  Could you describe the nature of your data (format, size, etc)
and the size of the regions you're looking to profile?  We might be able to
provide some additional advice.

Britton


On Sun, Apr 27, 2014 at 8:17 AM, Thomas Hansen <thansen at princeton.edu>wrote:

> Hi everyone,
>
> I'm kind of new to yt and am currently working on creating a set of graphs
> but am having a bit of difficulty.  My goal is to take a list of central
> points (a set of x,y,z coordinates) and then look at a set of 30 spherical
> "shells" which surround the central points.  So I want to be able to know
> how much mass is between, say 30 and 60 parsecs away from a certain point
> (along with 60-90, 90-120, etc.).  The problem is, the number of points is
> absolutely massive, so I need a fairly quick way of finding these values
> for all the points I'm interested in.
>
> I've tried a few tactics already.  First I tried going to each point,
> creating a sphere with that center and the maximum radius.  Then I used the
> center location to set a field parameter, then created a BinnedProfile1D
> using a "radius" field and the sphere I created, but that seemed to be
> impractically slow.
>
> Next, I tried the somewhat hackish method of for each point, creating a
> series of 30 spheres with radii corresponding with the boundaries I wanted
> between the shells.  I then used the boolean("NOT") command to construct a
> series of shells by finding the part of each sphere not in the smaller
> one.  I could then sum over the values in each shell.  This seemed to go a
> bit faster, but I feel like this could use an absolutely massive amount of
> computation, if I understand how yt works properly.
>
> Is there a better way of doing this?
>
> Thank you so much for your time,
> Thomas
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140428/a59f0d37/attachment.html>


More information about the yt-users mailing list