This e-mail from Kuo-Chuan got delayed and he ended up replying to me off-list about it. We resolved the issue he had after noting that there's currently an issue with doing something like:

    dd = ds.all_data()
    dd['density']

    dd.max_level = 2
    dd['density']

The second data object access won't respect the fact that max_level has now been set to 2 because the selector object does not get updated. I think this is technically a bug that could be fixed by replacing max_level and min_level with descriptors that have a setter callback that invalidates the selector.

-Nathan

On Wed, Mar 21, 2018 at 12:05 PM, Kuo-Chuan Pan <pankuoch@msu.edu> wrote:
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 <nathan12343@gmail.com> 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

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 <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-for-volume-rendering

Many thanks,
Kuo-Chuan
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org

_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org


_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org