Source

yt.geometry_tests / slice_coords.py

Full commit
from yt.mods import *
import time

pf = load("DD0039/output_0039")
#v, c = pf.h.find_max("Density")
c = [0.5, 0.5, 0.5]
dd = pf.h.slice(0, c[0])
data = dd["Density"]
px = dd["px"]
py = dd["py"]
pdx = dd["pdx"]
pdy = dd["pdy"]

for arr in [data, px, py, pdx, pdy]:
    print arr.min(), arr.max(), arr.size

for i,chunk in enumerate(dd.chunks(None, 'spatial')):
    print "    ", i, dd['px'].min(), dd['px'].max(), dd['px'].size, dd['Density'].size
    assert(dd['px'].size == dd['Density'].size)