[yt-users] Particles on projections

John ZuHone jzuhone at gmail.com
Thu Jun 5 13:17:20 PDT 2014


Hi Jeremy,

Indeed, 1.0 code_length = 1.0 cm for FLASH data. So the values of 0.5, 1.0, and 2000.0 are all lengths that are far smaller than the width of the smallest cell size. 

As far as why you're getting a 10pc slab, if we look at the _get_region method in plot_modifications.py, lines 1135-1136:

        self.region = data.pf.h.periodic_region(
            data.center, LE, RE)

This call will grab all of the cells that this region crosses. Essentially, you have a very thin slab, a slice really, and regardless of what you set that very small width to, you will always catch the individual cells that the slice passes through. In any case, all of the cells within these zones will be plotted, despite the fact that they may not even be within the width of the very small slab.

For FLASH data, if you want a slab the width of the domain, you should put 2*3.0856e21 as the width in the call to annotate_particles. 

I agree with Nathan that the docs need to be more clear, and in yt 3.0 we should probably fix this call to annotate_particles up so that you can specify something like (2.0,"kpc") as the width.

Best,

John

On Jun 5, 2014, at 3:42 PM, Jeremy Ritter <jritter at astro.as.utexas.edu> wrote:

> Hi Nathan,
> 
> This is FLASH data using the stable version of YT. If it's cgs units as in the data file, then a 1.0 should show nothing rather than a 10pc slab. It seems that lowering the width doesn't have any effect either. For slices, we are trying to plot fewer particles than the 10pc slab. Values of 0.5, 1.0 and 2000.0 all give the same number of particles. 
> 
> I've even modified the code directly to use 1/10 of the specified width 
> 
>        LE[zax] = data.center[zax] - self.width*0.05
>        RE[zax] = data.center[zax] + self.width*0.05
> 
> instead of
> 
>        LE[zax] = data.center[zax] - self.width*0.5
>        RE[zax] = data.center[zax] + self.width*0.5
> 
> and they both seem to plot the exact same number of particles as well. Is there some sort of minimum slab thickness imposed elsewhere? The maximum grid resolution is less than 1 parsec, so that should not be a limiting factor.
> 
> Thanks!
> -Jeremy
> 
> On Jun 5, 2014, at 1:30 PM, Nathan Goldbaum wrote:
> 
>> Hi Jeremy,
>> 
>> I haven't tested this, but I think the issue is due to unit conversions and possibly some misleading text in the docs. From my reading of the code, I think width is in code units rather than normalized units as the docs seem to indicate.
>> 
>> I'm not sure which simulation code you're using, but if it uses CGS units then the width you're specifying would be 1.0 cm.  The docs page you link to uses an Enzo simulation - in Enzo 1.0 code length units corresponds to the entire domain.
>> 
>> -Nathan
>> 
>> 
>> On Thu, Jun 5, 2014 at 10:47 AM, Jeremy Ritter <jritter at astro.as.utexas.edu> wrote:
>> Hello YT,
>> 
>> When using annotate_particles() on a ProjectionPlot, it does not seem to respect the width field. I get a very thin slab when plotting a 2kpc x 2kpc image. The cookbook implies that a width of 1.0 would correspond to the entire 2kpc line-of-sight domain (e.g. http://yt-project.org/docs/2.6/cookbook/complex_plots.html#plotting-particles-over-fluids ). It is definitately only a thin slab (about 10pc wide) regardless of whether I use width=1.0 or width=2000.0. The slab thickness seems to be the same as in a slice plot. What would be the correct way to plot the entire 2kpc cube of particles in projection?
>> 
>> Here are some comparison plots from YT (metallicity projection and slice) and VisIt (metallicity slice).
>> 
>> YT Projection (Width 2kpc):
>> http://grapenut.org/code/yt/paper/project/project_particles_175300_Projection_z_Metallicity_Density.png
>> 
>> YT Slice:
>> http://grapenut.org/code/yt/paper/slice/slice_particles_175300_Slice_z_Metallicity.png
>> 
>> Visit (10pc slab on 2kpc x 2kpc slice):
>> http://grapenut.org/code/yt/paper/particle_slab_0000.png
>> 
>> YT example source:
>> plot = ProjectionPlot(pf, 'z', nfield, center=star_center, width=star_width, axes_unit=axunit, weight_field='Density', fontsize=32)
>> plot.annotate_particles(1.0, ptype=1.0, col='white')
>> 
>> Cheers,
>> -Jeremy
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> 
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> 
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list