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:
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?
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:
<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
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).
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:
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
Hi Lingjian,
You should generally request e.g.
then you have the progenitor and the matching snapshot (important). Then proceed as e.g.
you should ignore
FirstProgenitorID
, this is an "internal" pointer in the merger tree.Hi Dylan,
Thanks a lot!
I was just confused what are the ID's given by 'FirstProgenitorID'.
Lingjian
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
Hi Lingjian,
For
sublink.loadTree()
with the current version there are a few options, one isonlyMPB
and another isonlyMDB
. 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).Hi Dylan,
Thanks very much!
Lingjian
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
Can you provide a specific example (simulation, snapshot, id)? Thanks!
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
This seems to work ok for me:
are you sure you have all the correct files, etc?
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?
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).Hi Dylan,
Thanks! I can try that now.