Loading particle-level data for multiple subhalos . Indices in functions.

Hoang Dieu Ngan Trinh
  • 1
  • 13 Oct '23

Hello I'm a total noob here... I have 2 questions (I'm not sure if any of them have been asked before but I couldn't find them so...):

(1) Is there a way to use the function illustris_python.snapshot.loadSubhalo(basePath, snapNum, id, partType, fields=None) for multiple subhalos - meaning multiple ids?
I tried using a for loop but it's taking forever so there must be a better approach.

(2) And speaking of ids, if I want to use this function for the ids of central subhalos I found using loadHalos() for the field 'GroupFirstSub', is it possible? I'm not sure if the index in GroupFirstSub and 'id' in the function loadSubhalo() are the same. I could have misunderstood something here.

Dylan Nelson
  • 13 Oct '23

(1) This is technically possible, and of course it is essential for efficiency if you want to consider many, or all, subhalos. If the number is sufficiently large, you could (i) load the entire snapshot, (ii) use the SubhaloLenType and Offsets/Subhalo/SnapByType to find the index range (i.e. numpy slice) for each subhalo.

(2) That is correct, GroupFirstSub is a Subhalo ID i.e. index, which is the same as the input to the loadSubhalo() function.

  • Page 1 of 1