Issue with BH merger catalog

Emma Weller
  • 1
  • 28 Jan

Hello! I am trying to track a set of BHs across snapshots using the TNG300-1 BH merger catalog. I found that over half of the BH IDs disappear between snapshots, but do not appear anywhere in the catalog as the “in” BH. I am wondering if you see any issues with my code? I’ve attached the relevant parts below - this is for z=2 to z=1. Or is this catalog known to be incomplete? Thank you for your help!

with h5py.File('tng300_blackhole_mergers.hdf5') as f:  
    IDs_swallowed = f['id_in'][:]
    IDs_keep = f['id_out'][:]
    masses_swallowed = f['mass_in'][:] * 1e10/hh
    masses_keep = f['mass_out'][:] * 1e10/hh
    scalefactors = f['time'][:]
redshifts = 1/scalefactors - 1

snap_old = 33 #z~2
snap_new = 50 #z~1
z_old = il.groupcat.loadHeader(basePath, snap_old)['Redshift']
z_new = il.groupcat.loadHeader(basePath, snap_new)['Redshift']

a_old = 1 / (1 + z_old)
a_new = 1 / (1 + z_new)
mask = (scalefactors >= a_old) & (scalefactors <= a_new)

IDs_swallowed = IDs_swallowed[mask]
IDs_keep = IDs_keep[mask]
masses_swallowed = masses_swallowed[mask]
masses_keep = masses_keep[mask]
redshifts = redshifts[mask]
scalefactors = scalefactors[mask]

order = np.argsort(scalefactors)
IDs_swallowed = IDs_swallowed[order]
IDs_keep = IDs_keep[order]
masses_swallowed = masses_swallowed[order]
masses_keep = masses_keep[order]
redshifts = redshifts[order]
scalefactors = scalefactors[order]

new_bhs = il.snapshot.loadSubset(basePath, snap_new, 'BHs', fields=['ParticleIDs','BH_Mass','BH_Mdot','Coordinates'])

def track_mergers(BHID):
    if not np.isfinite(BHID):
        return np.nan, np.nan, np.nan

    cur_ID = int(BHID)

    mass_add = 0
    count_add = 0
    start = 0

    while True:
        mergers_keep = np.where(IDs_keep[start:] == cur_ID)[0]
        mergers_swallowed = np.where(IDs_swallowed[start:] == cur_ID)[0]

        if (len(mergers_keep) == 0) and (len(mergers_swallowed) == 0):
            break

        if len(mergers_keep) == 0:
            earliest_merger = start + mergers_swallowed[0]
            outcome = 'swallowed'
        elif len(mergers_swallowed) == 0:
            earliest_merger = start + mergers_keep[0]
            outcome = 'keep'
        elif mergers_keep[0] > mergers_swallowed[0]:
            earliest_merger = start + mergers_swallowed[0]
            outcome = 'swallowed'
        else:
            earliest_merger = start + mergers_keep[0]
            outcome = 'keep'

        if outcome == 'keep':
            mass_add += masses_swallowed[earliest_merger]
        else:
            mass_add += masses_keep[earliest_merger]
            cur_ID = int(IDs_keep[earliest_merger])

        count_add += 1
        start = earliest_merger + 1

    bh_ind = np.where(new_bhs['ParticleIDs'] == cur_ID)[0]
    if len(bh_ind) == 0:
        return np.nan, np.nan, np.nan
    else:
        return bh_ind[0], count_add, mass_add
Dylan Nelson
  • 3 Feb

It is possible that the original data files that this catalog is generated from have missing data.

There are notes about this for Illustris-1 and TNG100-1. But I see we didn't note anything down for TNG300-1.

If you make a histogram of all the time values, are there any clear gaps?

(Unfortunately, this data is fragile and may not be, in the end, useful, if you need complete and precise information).

Emma Weller
  • 9h

Thanks for your help! I don't see any clear gaps in the time values.

Dylan Nelson
  • 8h

Can you provide one specific ID that behaves like this?

Emma Weller
  • 3h

Sure - BH ID 118691738899 exists at z=2 (snapshot 33) but not at z=1 (snapshot 50), and it does not appear in id_in in the merger catalog.

  • Page 1 of 1