Hi,
Is there a method to quickly get a list of all halo IDs for all clusters at z=1 (or any snapshot that is not 99)?
I'm trying to get a list of all central subhalos (BCGs) at z=1 and classify them based on their SFR as a function of halomass and based on their star-forming gas fraction as a function of stellar mass. If possible I would also like to identify if the CC classification of their host cluster.
At z=0 I can extract the haloID list from the hdf5 file containing the CC classification.
filename = '/virgotng/mpia/TNG-Cluster/TNG-Cluster/postprocessing/released/CCcriteria.hdf5'
with h5py.File(filename, "r") as f:
id_group_key = list(f.keys())[0]
HaloIDs_list = list(f[id_group_key]) # List of Halo IDs
However, the same IDs are not all valid for other snapshots so I tried using the merger tree to follow the MBP of each central subhalo:
for BCG_id in BCG_subhaloIDs_z0:
try:
# Load the merger tree for the current BCG
tree = il.sublink.loadTree(basePath, snap_z0, BCG_id, fields=fields, onlyMPB=True)
# Find the main progenitor at z=1 (SnapNum = snap_z1)
progenitors = tree['SnapNum'] == snap_z1
if np.any(progenitors):
subhalo_z1 = tree['SubhaloID'][progenitors][0] # Subhalo at z=1
BCGs_at_z1.append(subhalo_z1)
haloIDs_at_z1.append(il.groupcat.loadSingle(basePath, snap_z1, subhaloID=subhalo_z1)['SubhaloGrNr']) # Get the halo ID
else:
print(f"No progenitor found for BCG {BCG_id} at z=1")
except Exception as e:
print(f"Error processing BCG {BCG_id}: {e}")
Doing this however I get a list of IDs where the majority have the format "60000009300000049" which is "out of range for (0-6158)" when trying to use it with il.groupcat.loadSingle()
In the end I settled for the following method: I first load all catalog halos with
and then filtered them using 'Group_M_Crit200 > 10^14 #Solar masses' to identify the clusters at z=1 and then extract the central subhalos.
Is there a different hdf5 file for z=1 that I could use to identify the CC classification for the clusters at snap=50 or would /virgotng/mpia/TNG-Cluster/TNG-Cluster/postprocessing/released/CCcriteria.hdf5 work too?
For some additional context, I'm trying to generate synthetic images of the BCGs in order to perform optical morphological analysis. Based on previous work done on the IllustrisTNG simulation (Rodriguez-Gomez et al. 2019), for galaxies with a star-forming gas fraction above 1/100, it is important to account for radiative transfer so a different method is used (more specifically SKIRT) to generate the images than for those below the aforementioned threshold (GALAXEV).
Hi,
Is there a method to quickly get a list of all halo IDs for all clusters at z=1 (or any snapshot that is not 99)?
I'm trying to get a list of all central subhalos (BCGs) at z=1 and classify them based on their SFR as a function of halomass and based on their star-forming gas fraction as a function of stellar mass. If possible I would also like to identify if the CC classification of their host cluster.
At z=0 I can extract the haloID list from the hdf5 file containing the CC classification.
However, the same IDs are not all valid for other snapshots so I tried using the merger tree to follow the MBP of each central subhalo:
Doing this however I get a list of IDs where the majority have the format "60000009300000049" which is "out of range for (0-6158)" when trying to use it with
il.groupcat.loadSingle()
In the end I settled for the following method: I first load all catalog halos with
and then filtered them using 'Group_M_Crit200 > 10^14 #Solar masses' to identify the clusters at z=1 and then extract the central subhalos.
Is there a different hdf5 file for z=1 that I could use to identify the CC classification for the clusters at snap=50 or would
/virgotng/mpia/TNG-Cluster/TNG-Cluster/postprocessing/released/CCcriteria.hdf5
work too?For some additional context, I'm trying to generate synthetic images of the BCGs in order to perform optical morphological analysis. Based on previous work done on the IllustrisTNG simulation (Rodriguez-Gomez et al. 2019), for galaxies with a star-forming gas fraction above 1/100, it is important to account for radiative transfer so a different method is used (more specifically SKIRT) to generate the images than for those below the aforementioned threshold (GALAXEV).