[yt-users] RAMSES particles - star IDs are < 0

Ben Thompson bthompson2090 at gmail.com
Fri Jan 16 17:27:22 PST 2015


Hey Rick.

Indeed, since RAMSES does not really differentiate between it's particles.
You will have to apply a filter.

Lets say that you have created a projection plot object ( in your case p )
created from the data set "halo_sphere". If you add a particle filter to it
to filter for stars by particle age ( in RAMSES dark matter has age = 0..
so this is a good way of filtering for stars).

First, you need to define your filter function early on in your script (or
in another script and import it from that)

This is the filter function I typically use

def star_filter(pfilter,data):
    filter = np.logical_and(data["particle_age"] != 0, data["particle_age"]
!= None)
    return filter


add_particle_filter("stars", function=star_filter, filtered_type="all",
requires=["particle_age"])
halo_sphere.ds.add_particle_filter("stars")

And with your plot object, you can use the key word "ptype" to plot the
stars (or any other combination of particles/stars as you please)

plt.annotate_particles((radius,units),ptype="stars",p_size=10.0,col="m",marker="*")

And you should be able to annotate your star particles to your plot.

Please don't copy and paste the code above directly since I am reaponding
to this on my phone and is probably got unequal indentation.

For more info about the overplot particles, see

http://yt-project.org/doc/reference/api/generated/yt.visualization.plot_modifications.ParticleCallback.html#yt.visualization.plot_modifications.ParticleCallback

And

http://yt-project.org/doc/visualizing/callbacks.html#overplotting-particle-positions

Hooe this helps

Ben
On 17 Jan 2015 00:55, "Rick Sarmento" <rsarment at asu.edu> wrote:

> So I’m trying to “p.annotate_particles” with RAMSES star particles (over a
> temperature projection plot) …. But everything in RAMSES is a particle, so
> when I do
>
> p.annotate_particles
>
> I end up with a solid black plot… How do I tell annotate_particles to just
> use the particles with ID < 0 (these are the star particles)??
>
> Thx!
>
> *Cheers,*
>
> *Rick Sarmento*
> earnric at gmail.com
>
>
> _______________________________________________
> 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/20150117/131357de/attachment.html>


More information about the yt-users mailing list