Get particle extent for a non-cosmological simulation
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
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@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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Great, thanks! I'll take a look at the in-development version. If you wouldn't mind pointing me to those commits, I can take a look and work on it over the holidays, perhaps? -Jared On Mon, Dec 11, 2017 at 1:03 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
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@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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
I think this is the relevant commit: https://github.com/ngoldbaum/yt/commit/da1a39cebd776bde23525ebf44da0e1a653ba... On Mon, Dec 11, 2017 at 12:13 PM, Jared Coughlin <Jared.W.Coughlin.29@nd.edu
wrote:
Great, thanks! I'll take a look at the in-development version. If you wouldn't mind pointing me to those commits, I can take a look and work on it over the holidays, perhaps? -Jared
On Mon, Dec 11, 2017 at 1:03 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
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@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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Jared Coughlin
-
Nathan Goldbaum