<div dir="ltr">Hi everyone.<div><br></div><div>I'm fairly new to yt and I'm having some problems.</div><div>I'm trying to plot radial density profiles for some halos in a RAMSES simulation with periodic boundary conditions.</div><div>The problem arises when dealing with a halo close to the edge.</div><div><br></div><div>The relevant part of the code looks like this:</div><div><div>ds = yt.load(datapath)</div><div>cen = halos[0] # numpy array [x,y,z] in code units</div><div>rad = haloradius[0] # float in code units</div><div>sph = ds.sphere(cen, (10.*rad, 'Mpc/h')) </div><div>plot = yt.ProfilePlot(sph, "radius", 'particle_mass')</div><div><br></div><div>This returns</div><div>IndexError: index 3665 is out of bounds for axis 1 with size 3665</div></div><div><br></div><div>If I understand this correctly the problem is in the sphere object. </div><div>It works fine if I keep the sphere inside the edge of the simulation.</div><div><br></div><div>Is there a way to deal with this problem?</div><div><br></div><div>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.</div><div><br></div><div>Best,</div><div>Andreas Ellewsen</div></div>