I'm writing about a problem that I'm facing while using merger trees to derive the properties of cluster's galaxies at z > 0. In particular, I'm selecting from TNG300 clusters as all halos with GroupMcrit,200 > 1e14 Msun. The galaxies inside the cluster are defined to be those within GroupMcrit,200. For each cluster, I would like to track its galaxies backward, using merger trees.
I think my problem is on the index that I'm putting as an input in il.sublink.loadTree. Here I use an index defined as follows:
cond = SubhaloGrNr == np.unique(SubhaloGrNr)[270]
270 is, for example, the last cluster found. SubhaloGrNr is red from this function: il.groupcat.loadSubhalos and masks are applied to limit it for galaxies with a mass above a threshold and for the halos defined as clusters
At this stage, plotting the coordinates of the galaxies I see them in some position of the box.
Then I use idx_inside as input id for the merger trees:
tree = il.sublink.loadTree(
basePath,
99,
id=idx_inside[i],
onlyMPB=True,
fields=fields
)
But now all the positions, for all the clusters progenitors (not only the 271th), e.g., at snapnum = 91 (but also for lower values) are on the same position in the box of the progenitors of cluster N = 0.
So I think that I'm doing something wrong in using idx_inside as an input index for loadTree. Could you help me figure out what should be the correct way to do this? Thanks a lot!
Alberto Traina
21 Dec '25
Never mind, solved!
Dylan Nelson
24 Dec '25
In general, to follow a halo with the merger trees, you follow its first (central) subhalo. So e.g.
haloIDs = np.where(Group_M_Crit200 > X)[0]
cen_subIDs = GroupFirstSub[haloIDs]
for subID in cen_subIDs:
tree = il.sublink.loadTree(basePath, snapNum, subID, ...)
Hello,
I'm writing about a problem that I'm facing while using merger trees to derive the properties of cluster's galaxies at z > 0. In particular, I'm selecting from TNG300 clusters as all halos with GroupMcrit,200 > 1e14 Msun. The galaxies inside the cluster are defined to be those within GroupMcrit,200. For each cluster, I would like to track its galaxies backward, using merger trees.
I think my problem is on the index that I'm putting as an input in il.sublink.loadTree. Here I use an index defined as follows:
cond = SubhaloGrNr == np.unique(SubhaloGrNr)[270]270 is, for example, the last cluster found. SubhaloGrNr is red from this function: il.groupcat.loadSubhalos and masks are applied to limit it for galaxies with a mass above a threshold and for the halos defined as clusters
idx = np.where(cond)[0]Then I select "galaxies" inside the cluster:
At this stage, plotting the coordinates of the galaxies I see them in some position of the box.
Then I use idx_inside as input id for the merger trees:
But now all the positions, for all the clusters progenitors (not only the 271th), e.g., at snapnum = 91 (but also for lower values) are on the same position in the box of the progenitors of cluster N = 0.
So I think that I'm doing something wrong in using idx_inside as an input index for loadTree. Could you help me figure out what should be the correct way to do this? Thanks a lot!
Never mind, solved!
In general, to follow a halo with the merger trees, you follow its first (central) subhalo. So e.g.