import yt # Load any data set # e.g., uncomment the following lines # !wget http://yt-project.org/data/ShockCloud.tar.gz # !tar xf ShockCloud.tar.gz # import glob # ds_fn = glob.glob("*.vtk")[0] ds = yt.load(ds_fn) dt = yt.YTArray(0.1, "s") Wx = ds.domain_left_edge[0].convert_to_cgs() # The next line fails because of incompatibility with units cr = ds.all_data().cut_region('obj["x"].in_units("cm") + (obj["velocity_x"] * %g).in_units("cm") > %g' %(dt, Wx)) print cr['density'].shape