How to get subhalo's ID in one group/halo?

Jinning Liang
  • 11 Aug '21

Hi!

I use ill.groupcat.loadHalos() to load halos. But there is no haloID. So I use the index as the haloID. I don't know if it is correct. And I want to know subhalos' ID in one halo, for example, the 27th halo. How can I do?

Thanks for your time and your help!

Dylan Nelson
  • 12 Aug '21

I am not entirely sure what you mean by "the index", but in general we use the terms "halo ID" and "halo index" interchangeably. So likely this is the correct approach, although it depends on what index you are using.

To obtain the subhalo IDs (or indices) of a given halo, you can use the GroupFirstSub and GroupNsubs entries. For halo ID (or index) i, then range(GroupFirstSub[i], GroupFirstSub[i]+GroupNsubs[i]) gives the list of subhalo IDs in that group.

Jinning Liang
  • 18 Aug '21

Dear Dylan

That's what I need! Thanks for your help!!

Best wishes
Jinning Liang

  • Page 1 of 1