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!
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.
That's what I need! Thanks for your help!!