loadTree question

Neda Stojkovic
  • 1
  • 15 Mar '19

Hello,

Thank you for all your help so far. I have a question about using loadTree function. I have subfind IDs of some very small subhalos (stellar mass above 10^7Msun), stored in subfindIDs.csv, and I would like to find out their merger history, but on the very first subhalo I get the error message: "Warning, empty return. Subhalo [372] at snapNum [135] not in tree." The program won't continue to next subhalo too.
So my first question is what does that error mean. My second question is how to stop my program from not continuing to next subhalo; I tried using those loops without success:

for k in range(len(subIDs)):
    tree=il.sublink.loadTree(basePath,135,subIDs[k],fields=fields,onlyMPB=False)

    if tree.empty:
        continue

    a lot of other code...

and this one:

for k in range(len(subIDs)):
    tree=il.sublink.loadTree(basePath,135,subIDs[k],fields=fields,onlyMPB=False)

    if len(tree)==0:
        continue

    a lot of other code...

Both times I have TypeError. What is the correct type of data of the tree? I would like to skip anomalous subhalos which are not (somehow ) in the tree, and consider merger trees of the rest.

Dylan Nelson
  • 19 Mar '19

Hi Neda,

Yes it is always possible that a subhalo is not "in" the tree, i.e. it does not have a merger tree. This should be common only for very small subhalos near the resolution limit - you can imagine that their progenitor, at earlier times, was below the 20 particle limit to be identified as a Subfind subhalo, thus it does not exist in the group catalogs, and so cannot be connected via a tree.

In the source code of illustris_python/sublink.py you can see directly where this message is printed. It looks like None is the typical return, so you can check e.g.

if tree is None:
    continue
Neda Stojkovic
  • 21 Mar '19

That works perfectly. Thank you, as always, so much for your help.

  • Page 1 of 1