Time evolution of halo structure

Feiyu Quan
  • 30 Apr '23

Hi,

I was hoping to see how does the structure of parent DM halo of a galaxy evolve with time, by tracking the progenitors of a particular subhalo at z=0. The API page provided an example showing how to trace the mass of subhalo back in time:

>>> id = 109974
>>> url = "http://www.tng-project.org/api/Illustris-1/snapshots/68/subhalos/" + str(id)
>>> sub = get(url) # get json response of subhalo properties
>>> 
>>> # prepare dict to hold result arrays
>>> fields = ['snap','id','mass_gas','mass_stars','mass_dm','mass_bhs']
>>> r = {}
>>> for field in fields:
>>>     r[field] = []
>>> 
>>> while sub['desc_sfid'] != -1:
>>>     for field in fields:
>>>         r[field].append(sub[field])
>>>     # request the full subhalo details of the descendant by following the sublink URL
>>>     sub = get(sub['related']['sublink_descendant'])
>>>
>>> # make a plot (notice our subhalo falls into a much more massive halo around snapshot 105)
>>> for partType in ['gas','dm','stars','bhs']:
>>>     mass_logmsun = np.log10( np.array(r['mass_'+partType])*1e10/0.704)
>>>     plt.plot(r['snap'],mass_logmsun,label=partType)
>>> 
>>> plt.xlabel('Snapshot Number')
>>> plt.ylabel('Mass [log $M_\odot$]')
>>> plt.legend(loc='lower right');

Is there an easy way to do similar thing by modifying the above code a little bit, so that it plots the time evolution of halo structure parameters from the Supplementary Data Catalogs? Thanks!

Dylan Nelson
  • 1 May '23

Yes you can, keep in mind:

(1) Supplementary data catalogs are not within the original catalogs, they are external/separate files. So, values from such catalogs are not "in" the tree itself.

(2) Therefore, what you want to do is use the tree to obtain only two values: SnapNum, and SubfindID, i.e. the subhalo index of the progenitor at each snapshot.

(3) With this information in hand, you can download/open e.g. the "(q) Halo Structure" files, at each snapshot they are available, and take the value for the correct subhalo.

(4) If you were e.g. deriving some property of galaxies from snapshot data, the procedure would be the same.

(5) Note that instead of using the API to follow the 'sublink_descendant' or 'sublink_progenitor' links one at a time in a loop, I would always suggest to simply download/load the (main progenitor branch) of the sublink tree.

Feiyu Quan
  • 5 May '23

@Dylan Nelson said:
Yes you can, keep in mind:

(1) Supplementary data catalogs are not within the original catalogs, they are external/separate files. So, values from such catalogs are not "in" the tree itself.

(2) Therefore, what you want to do is use the tree to obtain only two values: SnapNum, and SubfindID, i.e. the subhalo index of the progenitor at each snapshot.

(3) With this information in hand, you can download/open e.g. the "(q) Halo Structure" files, at each snapshot they are available, and take the value for the correct subhalo.

(4) If you were e.g. deriving some property of galaxies from snapshot data, the procedure would be the same.

(5) Note that instead of using the API to follow the 'sublink_descendant' or 'sublink_progenitor' links one at a time in a loop, I would always suggest to simply download/load the (main progenitor branch) of the sublink tree.

Thanks for the reply! I saw that the halo structure files are available with links like "http://www.tng-project.org/api/TNG50-1/files/halo_structure.99.hdf5", which are pretty large files with GBs of size. I suppose that they contain the halo structure data for all the subhalos at that snapshot? I was wondering if there's a way to query/download the halo structure for just the subhalo we are interested in, given that we know its ID at a particular snapshot number?

Another thing is that for TNG50, it seems the halo structure files aren't available for every single snapshot from 0 to 99, is that actually the case? (please see the screenshot below)

1683311592637.png

Dylan Nelson
  • 6 May '23

There isn't any way to download a subset of one of these files, you'll need to download the file (for a given snapshot) completely.

They are available for "All twenty full snapshots (i.e. z=0,0.1,0.2,0.3,0.4,0.5,0.7,1.0,1.5,2,3,4,5,6,7,8,9,10,11,12)."

  • Page 1 of 1