[yt-users] Density Profiles with PBCs in RAMSES

Thor Andreas Seiff Ellewsen tellewsen at gmail.com
Fri Aug 12 01:33:06 PDT 2016


Hi everyone.

I'm fairly new to yt and I'm having some problems.
I'm trying to plot radial density profiles for some halos in a RAMSES
simulation with periodic boundary conditions.
The problem arises when dealing with a halo close to the edge.

The relevant part of the code looks like this:
ds = yt.load(datapath)
cen = halos[0] # numpy array [x,y,z] in code units
rad = haloradius[0] # float in code units
sph = ds.sphere(cen, (10.*rad, 'Mpc/h'))
plot = yt.ProfilePlot(sph, "radius", 'particle_mass')

This returns
IndexError: index 3665 is out of bounds for axis 1 with size 3665

If I understand this correctly the problem is in the sphere object.
It works fine if I keep the sphere inside the edge of the simulation.

Is there a way to deal with this problem?

PS: I know particle_mass is not the density of the dark matter, but I
haven't found a field for that, so this will have to do until I find one or
learn how to make one myself.

Best,
Andreas Ellewsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160812/298f68bf/attachment-0001.htm>


More information about the yt-users mailing list