I am studying the satellites fraction (Nsat/(Nsat+Ncentral)) as a function of the total satellites mass, at a given redshift.
I am not sure that I am disentangling correclty central subhalo and satellites.
This is my procedure:
At a given redshift, the number of satellites is given by len(SubhaloField) - len(GroupFirstSub). Is it correct?
The total mass of satellites is given by the sum of the SubhaloMass for those galaxies that don't match their ID i with the IDs given by GroupFirstSub.
Am I correctly disentangling satellites and central subhalo?
Thanks for your answer,
First, every halo (except for the very small, essentially unresolved halos near the simulation resolution limit and containing just ~32 particles) has one, and exactly one, central. So your fraction as defined is really Nsat/(Nsat+1). Perhaps a different quantity related to satellites would have more information, e.g. the number of satellites above a given mass (or luminosity), which would often be called "richness".
To obtain the number of satellites in a given halo, you can use the GroupNsubs field (subtract one to remove the central).
Please see also the FAQ question How do I find the parent halo of a subhalo? How do I find the subhalos of a halo?