Retrieving subhalos that are found in certain virial halos

Alexandres Lazar
  • 1
  • 4 Jun '16

I'm having some trouble retrieving the subhalos masses and position found in an selected array from of the viral group catalog.

This is my attempt to retrieve the data,

subfields = ['SubhaloMass', SubhaloPos']
halofields = ['Group_M_Crit200','GroupPos','GroupNsubs']

subhalos1 = il.groupcat.loadSubhalos(basePath1,135,fields=subfields)
halos1 = il.groupcat.loadHalos(basePath1,135,fields=halofields)

# Virial/200 Halo Masses in each FoF group Catalog
Mvir1 = halos1['Group_M_Crit200'] * 1e10 / 0.704 # in units of M_sol h^-1

# Position of Halo in group Catalog
Pos1 = halos1['GroupPos'] / 0.704 # in units of ckpc h^-1

# Position of subhalo in sub group Catalog
subPos1 = subhalos1['SubhaloPos'] / 0.704 # in units of ckpc h^-1

Nsubs1 = halos1['GroupNsubs'] 


# Selected virial masses 
mask1 = (8e+11 < Mvir1) & (Mvir1 < 2.4e+12)
submask1 = Nsubs1[mask1]

# Position of virial masses 
Vpos1 = Pos1[mask1]

# Position of subhalo found in virial masses
VSubpos1 = subPos1[submask1]

Unfortunately, the last part does not retrieve the actual subhalos found in those halos like I wanted.

How can I correct this?

Dylan Nelson
  • 1
  • 7 Jun '16

Hi Alexandres,

First just a note about the units, when you do

Mvir1 = halos1['Group_M_Crit200'] * 1e10 / 0.704

the units are solar masses (you have removed the little h factor) (likewise the positions are in ckpc).

For your subhalo question, I assume you mean you want properties from the central subhalo of each FoF group you have chosen with your Mvir selection. If so, then you should replace

halofields = ['Group_M_Crit200','GroupPos','GroupNsubs']
Nsubs1 = halos1['GroupNsubs'] 
submask1 = Nsubs1[mask1]

with

halofields = ['Group_M_Crit200','GroupPos','GroupFirstSub']
FirstSubs1 = halos1['GroupFirstSub'] 
submask1 = FirstSubs1[mask1]

In general, the GroupNsubs field tells you how many subhalos each FoF halo has. You could use this to print the positions of all subhalos of the first FoF halo in your selection like:

fofIndex = mask1[0]
firstSub = halos1['GroupFirstSub'][fofIndex]
numSubs = halos1['GroupNsubs'][fofIndex]

for subIndex in range( firstSub, firstSub+numSubs):
    print( subPos1[subIndex,:] )

Finally, perhaps a minor issue is that subPos1 is multi-dimensional. It has dimensions e.g. [Nsubhalos,3] for the x,y,z coordinates. So you should use the mask/subhalo indices only on the appropriate dimension, as in the print example.

Alexandres Lazar
  • 16 Jul '16

Sorry for the late reply. I believe I understand you said, so thank you for the clarification.

What I'm trying to wrap my head around now is the last portion. What if I wanted to individually select the 2nd, 3rd, or 4th subhalo found in that of the halo? Like the command used to select the first subhalos in the halos 'GroupFirstSub', is their not a simpler way of selected which ever number subhalo I want?

Dylan Nelson
  • 17 Jul '16

If you want say the position of the 2nd subhalo (the most massive satellite):

firstSub = halos1['GroupFirstSub'][fofIndex]
pos = subPos1[firstSub+1,:]

or the 4th subhalo (the 3rd most massive satellite):

firstSub = halos1['GroupFirstSub'][fofIndex]
pos = subPos1[firstSub+3,:]
  • Page 1 of 1