Dear Nathan, Thank you very much. This is very useful! I got an error that: AttributeError: 'AxisAlignedSlicePlot' object has no attribute 'to_pw' Another thing, when use down sample for data analysis. I find that dd = ds.all_data() print(dd[“density”].shape) Is the same as dd.max_level = 2 print(dd[“density”].shape) Do I miss anything? Many thanks, Kuo-Chuan
On Mar 21, 2018, at 12:44 PM, Nathan Goldbaum
wrote: Hi Kuo-Chuan,
The trick is to generate a slice data object and then use that data object to create the SlicePlot:
import yt
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
slc = ds.slice('x', 0.5) slc.max_level = 2
plot = slc.to_pw('density') plot.show()
This will generate a plot of 'density' sampled at a maximum AMR level of 2:
https://i.imgur.com/e1ACv2C.png https://urldefense.proofpoint.com/v2/url?u=https-3A__i.imgur.com_e1ACv2C.png&d=DwMFaQ&c=nE__W8dFE-shTxStwXtp0A&r=YmdhaqofMrF5BIO_XIl0Yg&m=wJ5AdaXo6IeW4xWFGIJnPtf3pLpCKM5a5knsmP9EAuo&s=vz9NUwIwSHbxIUciGE7pKpzEWejFFFR3rpQAc7OZ6b4&e=
Note that all yt data objects support both a min_level and max_level attribute to control the levels at which data selection happens.
Hope that helps,
Nathan
On Wed, Mar 21, 2018 at 10:01 AM, Kuo-Chuan Pan
mailto:astroodie@gmail.com> wrote: Dear all, Is there a simple way to create a data set with lower AMR levels? something like: ds = yt.load(fname, max_level=3)
I knew that there is an example to down sample for volume rendering with AMRKDTree, but I don't know how to create a downsample data set which can be analysis and plot with SlicePlot, for example. http://yt-project.org/docs/dev/cookbook/complex_plots.html#downsampling-data... https://urldefense.proofpoint.com/v2/url?u=http-3A__yt-2Dproject.org_docs_dev_cookbook_complex-5Fplots.html-23downsampling-2Ddata-2Dfor-2Dvolume-2Drendering&d=DwMFaQ&c=nE__W8dFE-shTxStwXtp0A&r=YmdhaqofMrF5BIO_XIl0Yg&m=wJ5AdaXo6IeW4xWFGIJnPtf3pLpCKM5a5knsmP9EAuo&s=5abBAV1Wh6AXmdtdfWMO6ReF-2L9d_5_Oozb2lKxK24&e=
Many thanks, Kuo-Chuan _______________________________________________ yt-users mailing list -- yt-users@python.org mailto:yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org mailto:yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org