### Confusion between subhalos and halos

Stephanie Tonnesen
• 19 Apr '18

Hi,

I am trying to understand how the data is organized. In looking at the documentation and example I am a bit confused. As I understand it, the GroupFirstSub is the most massive subhalo in a halo. Yet, in the example there looks to be more GroupFirstSub entries than subhalo entries. First

subhalos = il.groupcat.loadSubhalos(basePath,135,fields=fields) shows that there are 121209 total subhalos. However,

GroupFirstSub = il.groupcat.loadHalos(basePath,135,fields=['GroupFirstSub']) indicates that there are 131727 primary subhalo IDs.

I would like to use all subhalos to get a stellar mass - DM mass plot for all halos in the simulation (primary and secondary). How do I get that list?

Thank you! Stephanie

Stephanie Tonnesen
• 21 Apr '18

Okay, I have been trying a few different things and thought I could solve the problem by finding the stellar mass of all the GroupFirstSub subhalos and the rest of the "secondary" subhalos. I am using Illustris-1.

So in trying to get the dm and stellar mass of the GroupFirstSub subhalos, I have:

GroupFirstSub = il.groupcat.loadHalos(basePath,135,fields=['GroupFirstSub']) stars_massa = np.zeros(len(GroupFirstSub),float) dm_massa = np.zeros(len(GroupFirstSub),float) i = 0 while i < len(GroupFirstSub): all_fields = il.groupcat.loadSingle(basePath,135,subhaloID=GroupFirstSub[i]) stars_massa[i] = all_fields['SubhaloMassType'][ptNumStars] dm_massa[i] = all_fields['SubhaloMassType'][ptNumDM]
i = i+1

But I get an error:

Traceback (most recent call last): File "Illustris_plots_dmmass_amfit_rank_edges_divsort.py", line 86, in all_fields = il.groupcat.loadSingle(basePath,135,subhaloID=GroupFirstSub[i]) File "/Users/stonnesen/Desktop/Cen/Jerry/illustris_python/groupcat.py", line 154, in loadSingle result[haloProp] = f[gName][haloProp][groupOffset] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/Users/stonnesen/Desktop/yt-conda/lib/python3.6/site-packages/h5py/hl/dataset.py", line 476, in _getitem selection = sel.select(self.shape, args, dsid=self.id) File "/Users/stonnesen/Desktop/yt-conda/lib/python3.6/site-packages/h5py/_hl/selections.py", line 94, in select sel[args] File "/Users/stonnesen/Desktop/yt-conda/lib/python3.6/site-packages/h5py/hl/selections.py", line 261, in _getitem start, count, step, scalar = _handle_simple(self.shape,args) File "/Users/stonnesen/Desktop/yt-conda/lib/python3.6/site-packages/h5py/_hl/selections.py", line 451, in _handle_simple x,y,z = _translate_int(int(arg), length) File "/Users/stonnesen/Desktop/yt-conda/lib/python3.6/site-packages/h5py/_hl/selections.py", line 471, in _translate_int raise ValueError("Index (%s) out of range (0-%s)" % (exp, length-1)) ValueError: Index (4291146569) out of range (0-545819)

I am not sure what is going on here. Listing the GroupFirstSub array certainly shows values like 4291146569. Can I only trust values up to a certain number?

Thanks!

Stephanie

• Page 1 of 1