How to trace galaxies(subhalos) in different snapshots

Lingjian Chen
  • 13 Feb '19

Hi,

I am doing a study on radial satellite galaxy number density profiles in cluster environments. Particularly I am interested in how this profile typically change through cosmic time. Obviously to trace the same satellite galaxy systems, simulations are good to look at. The idea is to trace central galaxies in different snapshots and then measure satellite galaxy number density around them at these snapshots respectively. My question is what is the best way to trace them? I tried to use parameters in subfind merger trees, is subfindID a good parameter to use or FirstProgenitorID?

I am a little confused about how data is structured in these parameters.
For example, when I retrieve ['SubfindID'] for a particular subhalo in snapshot 72 in TNG300-1 like this:

merger_tree = il.sublink.loadTree(basePath, 72, 1010345, fields=['SubfindID','FirstProgenitorID'],onlyMPB=True)

I get an array that looks like this:

array([1010345, 992538, 972921, 955663, 938997, 686368, 673388,
899837, 877393, 659073, 640641, 623709, 712191, 679415,
653864, 634693, 472240, 470454, 596005, 590858, 579765,
573893, 602327, 595732, 629341, 608539, 587734, 563644,
540467, 506214, 477764, 447445, 403677, 384309, 347252,
313524, 273353, 237151, 212021, 181294, 165281, 148660,
130693, 112781, 103737, 90754, 100440, 88051, 69268,
56529, 47119, 36389, 31268, 25017, 22244, 15250,
12115, 10485, 8311, 7509, 4694, 4629, 5728,
4703, 5310, 4531, 20963, 8364, 3512, 26892,
84082], dtype=int32)

Does this array give me SubfindID's of the subhalo's progenitor in previous snapshots? If I instead use ['FirstProgenitorID'] then the array I get a totally different array, most entries are like [240000007300000028, 240000007300000029, ...]. What would be the correct parameter to use?

Thanks,
Lingjian

Dylan Nelson
  • 15 Feb '19

Hi Lingjian,

You should generally request e.g.

merger_tree = il.sublink.loadTree(basePath, 72, 1010345, fields=['SubfindID','SnapNum'],onlyMPB=True)

then you have the progenitor and the matching snapshot (important). Then proceed as e.g.

for i, snap in enumerate(merger_tree['SnapNum']):
    current_subhalo = il.groupcat.loadSingle(basePath, snap, subhaloID=merger_tree['SubfindID'][i])
    fof_id = current_subhalo['SubhaloGrNr']
    # load satellites of fof_id
    # calculate radial profile

you should ignore FirstProgenitorID, this is an "internal" pointer in the merger tree.

Lingjian Chen
  • 15 Feb '19

Hi Dylan,

Thanks a lot!
I was just confused what are the ID's given by 'FirstProgenitorID'.

Lingjian

Lingjian Chen
  • 11 Apr '19

Hi,

In the subfind halo tree, it seems to be designed to trace same galaxies backward in time when I extract the tree by calling the sublink.loadTree function (i.e. straightforward to track progenitors). I want to ask if there’s a way that I can track satellite galaxies toward their descendants.

I wish to see how satellite mass/position changes (i.e. migration in clusters) with time. For example, I select satellite galaxies at snap72 and ask if their progenitors exist in snap57, if they do, I count them in my sample. Then I look at distance toward central galaxy for the sample at two snapshots. In this case, I cannot account for satellite galaxies that have already merged with central or disrupted for the migration process.

Best regards,
Lingjian

Dylan Nelson
  • 11 Apr '19

Hi Lingjian,

For sublink.loadTree() with the current version there are a few options, one is onlyMPB and another is onlyMDB. The "P" is "progenitor" and the "D" is for descendant, i.e. what you need. Actually I see this is missing in the documentation, I'll add a note about it (this was a semi-recent addition).

Lingjian Chen
  • 11 Apr '19

Hi Dylan,

Thanks very much!

Lingjian

Lingjian Chen
  • 15 Apr '19

When I track the descendant branch using the "onlyMDB" option like this:

merger_tree = il.sublink.loadTree(basePath, SnapNum, gal_id, fields=['SubfindID','FirstProgenitorID'],onlyMDB=True)

I sometimes get this error:
ValueError: Reverse-order selections are not allowed

This usually happens when I have a large SnapNum value (e.g. 70), what does this mean?

Thank you!
Lingjian

Dylan Nelson
  • 15 Apr '19

Can you provide a specific example (simulation, snapshot, id)? Thanks!

Lingjian Chen
  • 15 Apr '19

Hi,

Here's an example

basePath = './sims.TNG/TNG300-1/output'
merger_tree = il.sublink.loadTree(basePath,49,0,fields=['SubfindID','FirstProgenitorID'],onlyMDB=True)

Full Error Message:

ValueError Traceback (most recent call last)

<ipython-input-20-29ddf4045819> in
----> 1 merger_tree = il.sublink.loadTree(basePath,49,0,fields=['SubfindID','FirstProgenitorID'],onlyMDB=True)

~/illustris_python/sublink.py in loadTree(basePath, snapNum, id, fields, onlyMPB, onlyMDB, treeName, cache)
164
165 # read
--> 166 result[field] = f[field][fileOff:fileOff+nRows]
167
168 # only a single field? then return the array instead of a single item dict

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

/opt/conda/lib/python3.6/site-packages/h5py/_hl/dataset.py in getitem(self, args)
474
475 # Perform the dataspace selection.
--> 476 selection = sel.select(self.shape, args, dsid=self.id)
477
478 if selection.nselect == 0:

/opt/conda/lib/python3.6/site-packages/h5py/_hl/selections.py in select(shape, args, dsid)
92
93 sel = SimpleSelection(shape)
---> 94 sel[args]
95 return sel
96

/opt/conda/lib/python3.6/site-packages/h5py/_hl/selections.py in getitem(self, args)
259 return self
260
--> 261 start, count, step, scalar = _handle_simple(self.shape,args)
262
263 self._id.select_hyperslab(start, count, step)

/opt/conda/lib/python3.6/site-packages/h5py/_hl/selections.py in _handle_simple(shape, args)
445 for arg, length in zip(args, shape):
446 if isinstance(arg, slice):
--> 447 x,y,z = _translate_slice(arg, length)
448 s = False
449 else:

/opt/conda/lib/python3.6/site-packages/h5py/_hl/selections.py in _translate_slice(exp, length)
486 raise ValueError("Step must be >= 1 (got %d)" % step)
487 if stop < start:
--> 488 raise ValueError("Reverse-order selections are not allowed")
489
490 count = 1 + (stop - start - 1) // step

ValueError: Reverse-order selections are not allowed

Dylan Nelson
  • 15 Apr '19

This seems to work ok for me:

basePath = 'sims.TNG/L205n2500TNG/output/'
x = il.sublink.loadTree(basePath,49,0,fields=['SubfindID','FirstProgenitorID'],onlyMDB=True)
In [9]: x
Out[9]:
{'count': 50,
 'SubfindID': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0], dtype=int32),
 'FirstProgenitorID': array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
        18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
        35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50])}

are you sure you have all the correct files, etc?

Lingjian Chen
  • 15 Apr '19

In my jupyterLab interface, I used to have an older version of illustris_python package. I replaced sublink.py in illustris_python/ but did not replace other files, maybe that's why? If so, is there an official/correct way to update the files in JupyterLab?

Dylan Nelson
  • 16 Apr '19

Hi Lingjian,

My fault, sorry about that, there is a small bugfix for loadMDB = True which I had never pushed.

If you get the now current version of sublink.py this should all work fine (you can download the single file, or the zip of the repository, from bitbucket).

Lingjian Chen
  • 16 Apr '19

Hi Dylan,

Thanks! I can try that now.

  • Page 1 of 1