import yt12ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")34# The maximum refinement level of this dataset is 85print(ds.max_level)67# If we ask for *all* of the AMR data, we get back field8# values sampled at about 3.6 million AMR zones9ad = ds.all_data()10print(ad["gas", "density"].shape)1112# Let's only sample data up to AMR level 213ad.max_level = 21415# Now we only sample from about 200,000 zones16print(ad["gas", "density"].shape)1718# Note that this includes data at level 2 that would19# normally be masked out. There aren't any "holes" in20# the downsampled AMR mesh, the volume still sums to21# the volume of the domain:22print(ad["gas", "volume"].sum())23print(ds.domain_width.prod())2425# Now let's make a downsampled plot26plot = yt.SlicePlot(ds, "z", ("gas", "density"), data_source=ad)27plot.save("downsampled.png")282930