[yt-users] ZeroDivisionError: Gadget isolated galaxy sim
Nathan Goldbaum
nathan12343 at gmail.com
Thu Nov 14 15:05:36 PST 2013
Hi Keita,
You’ll also need to supply the box size when you load the data. Like so:
ds = GadgetStaticOutput('/Users/SilverStar/Desktop/iso_low.dat', unit_base = {"kpc": 1.0}, bounding_box=[[-100, -100, -100], [100, 100, 100]])
Take a look at the __init__ method of GadgetStaticOutput; all of the keyword arguments it accepts can be used when creating a GadgetStaticOutput instance.
The bbox I used in this example might need to be tweaked for your simulation. It should enclose all of the particles in the domain and be in whatever code units you ran the simulation with.
I think optimally for non-periodic SPH simulations yt would be able to *choose* an appropriate bbox after reading in the list of particle positions.
Since cosmological simulations (which have periodic boundary conditions) and all mesh-based simulations have a bounding box that is intimately linked with the data coordinates, in the past we’ve always known the bounding box when creating the new StaticOutput instance in memory. We don’t have that information for non-periodic SPH datasets. They are the first ones that yt has had to deal with where we can’t easily decide what the simulation domain is before inspecting all of the data. That’s why it doesn’t work that way right now, but hopefully (possibly with the help of SPH users) we’ll be able to fix that soon.
-Nathan
On November 14, 2013 at 2:46:55 PM, Keita Todoroki (keitee at physics.unlv.edu) wrote:
Hi,
I am trying to read in a gadget snap from isolated galaxy sims, but I get
ZeroDivisionError.
As you can see below, the parameters for the domain edge seems to be not
reading correctly, while it perfectly works fine for a snap from
cosmological sims.
In [2]: ds = GadgetStaticOutput('/Users/SilverStar/Desktop/iso_low.dat',
unit_base = {"kpc": 1.0})
yt : [INFO ] 2013-11-14 14:22:03,592 Omega Lambda is 0.0, so we are
turning off Cosmology.
yt : [INFO ] 2013-11-14 14:22:03,593 Parameters: current_time
= 0.0
yt : [INFO ] 2013-11-14 14:22:03,593 Parameters: domain_dimensions
= [2 2 2]
yt : [INFO ] 2013-11-14 14:22:03,594 Parameters: domain_left_edge
= [ 0. 0. 0.]
yt : [INFO ] 2013-11-14 14:22:03,595 Parameters: domain_right_edge
= [ 0. 0. 0.]
yt : [INFO ] 2013-11-14 14:22:03,596 Parameters:
cosmological_simulation = 0
If the domain edge is simply reading the BoxSize, the output above is
understandable because isolated galaxy sims do not require to set the
BoxSize (in fact we set it to 0) unlike cosmo sims.
Could this be the reason for the error?
-Keita
_______________________________________________
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/20131114/9ce3bc04/attachment.html>
More information about the yt-users
mailing list