RAMSES particles - star IDs are < 0
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@gmail.com
Hi Rick,
I haven't tried it, but I think you can do this with a particle filter:
http://yt-project.org/docs/dev/analyzing/filtering.html?highlight=particle_f...
Here your particle filter will need select only particles with ID < 0. I'm
not sure what the ramses particle ID field is named, but you'll need to use
that.
Then, when you call annotate_particles, you'll need to pass the name of
your new particle filter as the "ptype" keyword argument.
Hope that's clear, let me know if you get stuck and need a worked out
example.
-Nathan
On Wed, Jan 14, 2015 at 9:03 PM, Rick Sarmento
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@gmail.com
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Particle filters are the key.
http://yt-project.org/docs/dev/cookbook/constructing_data_objects.html#creat...
http://yt-project.org/docs/dev/analyzing/filtering.html#filtering-particle-f...
On Wed, Jan 14, 2015 at 10:03 PM, Rick Sarmento
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@gmail.com
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
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_modi...
And
http://yt-project.org/doc/visualizing/callbacks.html#overplotting-particle-p...
Hooe this helps
Ben
On 17 Jan 2015 00:55, "Rick Sarmento"
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@gmail.com
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (4)
-
Ben Thompson
-
Cameron Hummels
-
Nathan Goldbaum
-
Rick Sarmento