I'm working with a dataset from a particle-based simulation with 64^3 particles and am trying to create a covering grid so that I can create a 3D visualization (using volume rendering). I have a problem with the dimensions of that covering grid. A ProjectionPlot from the covering grid dataset only produces a 2x2x2 pixel plot even though the original dataset ProjectionPlot is a 64x64x64 plot. I tried defining the dimensions of the covering grid to be [64,64,64], which results in a 64 pixel wide plot however data is only present in the first 2x2x2 pixels and the rest of the plot is blank. The way I define my covering grid is shown below. Could someone please suggest a solution to this problem? cov_grid = ds.covering_grid(level=0, left_edge=[-1,-1,-1], dims=ds.domain_dimensions, fields=('deposit','PartType1_density')) #alternate version cov_grid = ds.covering_grid(level=32, left_edge=[-1,-1,-1], dims=[64,64,64], fields=('deposit','PartType1_density')) ds_new = cov_grid.save_as_dataset() grid_ds = yt.load(ds_new)
The arbitrary_grid should be used instead for particle data: http://yt-project.org/docs/dev/analyzing/objects.html#arbitrary-grids-object... Best wishes, — Suoqing Ji Sherman Fairchild Fellow TAPIR & Walter Burke Institute for Theoretical Physics California Institue of Technology http://www.tapir.caltech.edu/~suoqing On Jun 22, 2019, at 6:55 AM, "andrea.husseiniova@gmail.com<mailto:andrea.husseiniova@gmail.com>" <andrea.husseiniova@gmail.com<mailto:andrea.husseiniova@gmail.com>> wrote: I'm working with a dataset from a particle-based simulation with 64^3 particles and am trying to create a covering grid so that I can create a 3D visualization (using volume rendering). I have a problem with the dimensions of that covering grid. A ProjectionPlot from the covering grid dataset only produces a 2x2x2 pixel plot even though the original dataset ProjectionPlot is a 64x64x64 plot. I tried defining the dimensions of the covering grid to be [64,64,64], which results in a 64 pixel wide plot however data is only present in the first 2x2x2 pixels and the rest of the plot is blank. The way I define my covering grid is shown below. Could someone please suggest a solution to this problem? cov_grid = ds.covering_grid(level=0, left_edge=[-1,-1,-1], dims=ds.domain_dimensions, fields=('deposit','PartType1_density')) #alternate version cov_grid = ds.covering_grid(level=32, left_edge=[-1,-1,-1], dims=[64,64,64], fields=('deposit','PartType1_density')) ds_new = cov_grid.save_as_dataset() grid_ds = yt.load(ds_new) _______________________________________________ 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>
I created the arbitrary grid (shown below), however there seem to be no data in it. arb_grid.field_data shows empty arrays for Coordinates and Masses fields and an array full of zeros for the Density field, which seems very strange. The density field is all zeros even after the arbitrary grid is saved and loaded as a new yt dataset. arb_grid = data.arbitrary_grid([-1,-1,-1], [1,1,1], [64,64,64]) ds_new = arb_grid.save_as_dataset(fields=[('deposit','PartType1_density')]) grid_ds = yt.load(ds_new) grid_ds.r[('gas','PartType1_density')] ----> YTArray full of zeros although I ask for this field to be pregenerated in ds_new Should I be defining the grid differently? Thank you
Do you have any sample dataset for testing? Best wishes, — Suoqing Ji Sherman Fairchild Fellow TAPIR & Walter Burke Institute for Theoretical Physics California Institute of Technology http://www.tapir.caltech.edu/~suoqing On Jun 25, 2019, at 2:56 AM, andrea.husseiniova@gmail.com<mailto:andrea.husseiniova@gmail.com> wrote: I created the arbitrary grid (shown below), however there seem to be no data in it. arb_grid.field_data shows empty arrays for Coordinates and Masses fields and an array full of zeros for the Density field, which seems very strange. The density field is all zeros even after the arbitrary grid is saved and loaded as a new yt dataset. arb_grid = data.arbitrary_grid([-1,-1,-1], [1,1,1], [64,64,64]) ds_new = arb_grid.save_as_dataset(fields=[('deposit','PartType1_density')]) grid_ds = yt.load(ds_new) grid_ds.r[('gas','PartType1_density')] ----> YTArray full of zeros although I ask for this field to be pregenerated in ds_new Should I be defining the grid differently? Thank you _______________________________________________ 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>
participants (2)
-
andrea.husseiniova@gmail.com
-
Ji, Suoqing