Pastebin

Paste #6700: cutout_region_problem

< previous paste - next paste>

Pasted by Max

Download View as text

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

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.