[yt-users] plotting halos circles on density projection

Stephen Skory s at skory.us
Mon Nov 18 15:50:01 PST 2013


Hi Stefano,

I've kind of been out of the yt game for a bit here, but I saw that no
one answered your email. I'll give it a shot.

> I'm trying to plot halos circles on density projection. I would like to
> select with the circle only the halos on the center of the box where the
> resolution is good but it seems that my script is doing something different,
> here the script:
>
> pf = load("RD0022/RedshiftOutput0022")
> halos = HaloFinder(pf)
> p = ProjectionPlot(pf, "z", "Density", width = (4.0, 'kpc'), center='max')
> p.annotate_hop_circles(halos,max_number=5)

This may not answer your question below, but "halos" above is just a
list of halo objects. This means that you can *manually* make a new
list containing the halos you want. For example, if you knew that the
halos you wanted were 0-4, you can just select list item like any
other python list:

new_halos = halos[0:4]
p.annotate_hop_circles(new_halos)

> ii) the problem is that if I select 5 halos they are all outside the box
> center, I guess because of resolution artifacts.

max_number=5 should select the 5 most massive... so the fact that it
isn't is confusing to me.

> iii) how can I select the halos based on a mass threshold (let's assume 1e6
> solar masses)?

This last question is easy, either you can use the manual selection
method above, or you can use the "min_size" keyword of the annotate
call, which will limit the halos plotted to only those with (number of
particles) > min_size:

p.annotate_hop_circles(halos, min_size=1.e4)

Good luck!

-- 
Stephen Skory
s at skory.us
http://stephenskory.com/
510.621.3687 (google voice)



More information about the yt-users mailing list