[yt-dev] Making a particle density plot

John ZuHone jzuhone at gmail.com
Sat Dec 1 12:18:45 PST 2012


Chris,

You could probably use the uniform grid stream for what you want. You could just flatten the particle position along the axis you're projecting along and then define a 2D uniform grid with shape, say, (nx, ny, 1) if you were projecting along Z. Then you could use the normal yt stuff to make plots, but the particles would only be on one grid.

When I'm able to get back to a real keyboard I will write an example script if this sounds good to you.

John

John ZuHone
Laboratory for High-Energy Astrophysics
NASA/Goddard Space Flight Center
8800 Greenbelt Rd., Code 662
Greenbelt, MD 20771
(w) 301-286-2531
(m) 773-758-0172
jzuhone at gmail.com
john.zuhone at nasa.gov

On Dec 1, 2012, at 2:57 PM, Christopher Moody <cemoody at ucsc.edu> wrote:

> Hi everyone,
> 
> I'd like to implement a particle density plot type, but I'm not familiar enough with the yt/visualization classes. I'm explicitly avoiding particle deposition on the grid (ie, the stuff John ZuHone just PR'd), because even after the particles are assigned to grids, splitting the array for each grid, and then concatenating grid-by-grid is slow. And moving to yt-3.0, we should be able to handle particle as particles not on a grid/oct (right?).
> 
> To collect all of the particles, project them, and do a 2D histogram is straightforward, but my question is where to do it. I was thinking of imitating the ParticlePlot class, but that basically uses the particle callback that draws a dot for every particle. A histogram'd field is defined everywhere, and is probably not appropriate as a callback.
> How should I structure this? Which files are the relevant ones?
> 
> chris
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20121201/770559ce/attachment.htm>


More information about the yt-dev mailing list