[yt-users] Star Projections

Nathan Goldbaum nathan12343 at gmail.com
Wed Nov 28 11:34:54 PST 2012


Hi Munier,

I suspect that the projection of the particle field is zero in the locations that are colored white in your image.  This causes these regions to 'fall off' the bottom end of the logarithmic color bar.

I think you have two options.  One would be to use a linear colorbar.  You can do this following the instructions here: http://yt-project.org/doc/faq/index.html#how-do-i-modify-whether-or-not-yt-takes-the-log-of-a-particular-field

Another option would be to make the plot by hand using a FixedResolutionBuffer.  In this case you would make the projection object by hand, extract the raw image buffer using an FRB, and then make the plot manually using matplotlib.  There's an example in the yt docs that covers how to do this: http://yt-project.org/doc/visualizing/manual_plotting.html?highlight=manual%20plotting

In the latter case if you want the areas that project to zero to appear with a logarithmic colorbar, you'll need to manually set the regions in the FRB that are equal to zero to some small number.

Cheers,

Nathan

On Nov 28, 2012, at 9:29 AM, Munier Azzam Salem wrote:

> Hi yt gurus,
> 
>       I've been making projections of star_density from enzo output files and they seem to be working out fine. However, wherever particles do not exist the background remains white instead of following my chosen colormap. Is there a way to paint these areas to follow the colormap?
> 
>        thanks!
>            Munier
> 
> I've attached an image of what gets plotted, and the relevant bits of my script are:
> 
> from yt.mods import *
> 
> fName = "DD0006/test_sim_0006"
> var   = "star_density"
> axis  = 0
> 
> pf = load(fName)
> pf.h
> 
> pc = PlotCollection(pf)
> p = pc.add_projection(var,axis)
> #p.modify["particles"](1.0)
> 
> radius = .02;
> 
> pc.set_xlim(.5-radius,.5+radius)
> pc.set_ylim(.5-radius,.5+radius)
> 
> pc.save(fName)
> 
> 
> -- 
> Munier A. Salem // 845.489.6450
> <test_sim_0006_Projection_x_star_density.png>_______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20121128/9a8c9de2/attachment.html>


More information about the yt-users mailing list