[yt-users] Get particle extent for a non-cosmological simulation

Nathan Goldbaum nathan12343 at gmail.com
Mon Dec 11 10:03:07 PST 2017


Hi Jared,

Unfortunately right now for Gadget data you need to know that information
before you load your data. Try using a very large bounding box.

I've fixed this behavior in an in-development version of yt which has not
been upstreamed yet. The code will be part of yt 4.0 (due out sometime in
2019 at the moment) so in the future this will be easier. In this new
version if there's no user-specified bounding box, we scan the file and
find the min and max particle locations and use those to set the bounding
box.

If you're interested in trying the new version of yt out, you'll need to
build yt from source using the "sph-viz" branch on my fork of yt on github (
https://github.com/ngoldbaum/yt). You'll also need to build and install
cykdtree (https://github.com/cykdtree/cykdtree) which has been added as a
dependency of yt.

In principle it should be possible to backport this functionality to the
current version of yt but it will take a bit of work. If you're interested
in taking that on I can point you to the commits where I implemented the
new automatic bounding box detection in the in-development version of yt.

Hope that's helpful,

Nathan

On Mon, Dec 11, 2017 at 11:52 AM, Jared Coughlin <Jared.W.Coughlin.29 at nd.edu
> wrote:

> Hello! I have a gadget snapshot that was generated from a non-cosmological
> simulation. This causes yt to ignore the box size parameter. However, when
> I try to make a plot, yt generally fails because ds.domain_left_edge =
> ds.domain_right_edge = 0.0. This necessitates that I change those
> parameters manually. My question is: is there a way to get the domain
> bounds from the file so that I don't have to set these manually every time?
>
> I noticed that if I get the box size wrong, yt complains about particle
> bounds exceeding the domain bounds, and so I looked a little bit at the
> code to see if I could figure out how yt was getting these numbers and see
> if I could just do something similar, but I haven't had a whole lot of
> luck. It seems that in the compute_morton function there's a pos_x.max and
> min function, but those are passed in _initialize_index as data having been
> read from an hdf5 file?
>
> I'm not super sure I understand what's going on there, but if anyone has
> any thoughts, I'd greatly appreciate it. I basically just need the max and
> min particle positions along each of the x, y, and z directions, but trying
> ad["Coordinates"] fails unless the bounds are properly set to begin with.
> Thanks!
>
> -Jared
>
> _______________________________________________
> 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/20171211/80d13da9/attachment.html>


More information about the yt-users mailing list