Downsampling AMR data for plotting isocontours
Hi, I'm trying to figure out the best way to downsample FLASH AMR data for making isocontours. I'd like to be able to specify the maximum refinement level that should be used for creating the isocontours. My first thought was to use a covering grid, but I'm uncertain how to use that to create a YTSurface object. If anyone can offer any suggestions, I'd appreciate it. Thanks, Dan
Hi Dan,
I think you should be able to set the max_level attribute on the data
object you're creating the surface from. Here's an example:
import yt
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
ad = ds.all_data()
ad.max_level = 6
ds.surface(ad, 'density', 5e-27)
surf = ds.surface(ad, 'density', 5e-27)
You can then export the surface if you want (I used export_ply) to verify
that that degrading the resolution produces a reasonable low-resolution
representation:
http://imgur.com/a/WkOjA
Here I'm using meshlab to view the surfaces outside of yt after exporting
them to ply files. The left-hand one has max_level = 4, the right-hand one
is with no max_level.
-Nathan
On Thu, Jul 28, 2016 at 2:05 PM, Daniel Fenn
Hi,
I'm trying to figure out the best way to downsample FLASH AMR data for making isocontours. I'd like to be able to specify the maximum refinement level that should be used for creating the isocontours.
My first thought was to use a covering grid, but I'm uncertain how to use that to create a YTSurface object.
If anyone can offer any suggestions, I'd appreciate it.
Thanks,
Dan
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thank you, Nathan. That worked perfectly! I didn't realize it would be so
simple.
Thanks again,
Dan
2016-07-28 15:33 GMT-04:00 Nathan Goldbaum
Hi Dan,
I think you should be able to set the max_level attribute on the data object you're creating the surface from. Here's an example:
import yt ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') ad = ds.all_data() ad.max_level = 6 ds.surface(ad, 'density', 5e-27) surf = ds.surface(ad, 'density', 5e-27)
You can then export the surface if you want (I used export_ply) to verify that that degrading the resolution produces a reasonable low-resolution representation:
Here I'm using meshlab to view the surfaces outside of yt after exporting them to ply files. The left-hand one has max_level = 4, the right-hand one is with no max_level.
-Nathan
On Thu, Jul 28, 2016 at 2:05 PM, Daniel Fenn
wrote: Hi,
I'm trying to figure out the best way to downsample FLASH AMR data for making isocontours. I'd like to be able to specify the maximum refinement level that should be used for creating the isocontours.
My first thought was to use a covering grid, but I'm uncertain how to use that to create a YTSurface object.
If anyone can offer any suggestions, I'd appreciate it.
Thanks,
Dan
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Daniel Fenn
-
Nathan Goldbaum