I do understand that the FoF catalogs have not been created for the subboxes. Is it however possible to use the FoF catalogs from the full box when making sure that the snapshot ID is the same for the subbox as for the FoF catalog of the full simulation volume? In other words; are the subbox snapshots just extracted from the full simulation run at runtime? I basically want to get around running FoF on one of the subboxes.
It's a good point, I think this should be technically possible. The subboxes are written once per timestep (say), and the full snapshots at only specific timesteps, those which are the closest to a fixed list of desired output redshifts.
So I think it should be true (for Illustris-1) that each full snapshot has a corresponding subbox which was written at the exact same time, and here you can take the spatial subset of the group catalog.
For example I see snapshot 110 has z=0.360688 and subbox 3296 matches.
You could verify by re-doing one of the easier computations in the group catalog (i.e. stellar mass enclosed in the half mass radius), and verifying the result. I'd be curious.
Okay thanks. I will do what you suggest!
I am a bit confused. I took PartType4/Coordinates and PartType4/Masses within Subhalo/SubhaloHalfmassRadType (4), and sum these masses for all subhalos that lie completely in the subbox. I do not get the same numbers if I compare with Subhalo/SubhaloMassInHalfRadType (4). Am I missing something here? The Snaps I use are 659 for Subbox 1 and the catalog for snap 38 for the big box, both Illustris 1. They both have redshift 8.012172.
You mean within a distance of SubhaloHalfmassRadType(4) from SubhaloPos?
If you just do this calculation for the actual subhalo in the full snapshot 38, does it work?
Yes, I take all the Type4 particles with distance(Coordinates,SubHaloPos)< SubhaloHalfmassRadType(4) and sum them up for each subhalo within the subvolume. I compare the mass I get for each subhalo with the values in SubhaloMassInHalfRadType (4).
I do not have the full snapshot on disk, and haven't used the WebAPI so much yet that I can do the latter calculation quickly. I was hoping I misunderstood something in the data specifications. The specifications for SubhaloMassInHalfRadType says: "Sum of masses of all particles/cells (split by type) within the stellar half mass radius.", which I thought to be a typo. Is it? If not, what is the stellar half mass radius (it should not be the same as SubhaloMassInHalfRadType(4), because that includes wind particles, right?)?
I checked and this seems fine. Most likely, you are getting messed up by including wind particles in your calculation for the stellar mass. These are not included in e.g. SubhaloMassInRadType, and can be filtered out as having negative GFM_StellarFormationTime.
Specifically, subhalo 13391 has 56 real stars and total stellar mass 0.0047439896 as in the group catalog for snapshot 38, and also based on the particle information in subbox1 number 659.
In : sP = simParams(res=1820,run='illustris',snap=38)
In : x=cosmo.load.groupCat(sP, fieldsSubhalos=['SubhaloPos','SubhaloMassInRadType','SubhaloHalfmassRadType'])
In : s=4000.0
In : cen=[43100,53600,60800]
In : pos=x['subhalos']['SubhaloPos']
In : pos.shape
Out: (3436820, 3)
In : w = np.where( (np.abs(pos[:,0]-cen) < s) & (np.abs(pos[:,1]-cen) < s) & (np.abs(pos[:,2]-cen) < s) )
In : w.size
In : w[0:10]
Out: array([13391, 15344, 19352, 19353, 19354, 19355, 19356, 19357, 19358, 19359])
In : sP_sub = simParams(res=1820,run='illustris',snap=659,variant='subbox1')
In : stars_pos = cosmo.load.snapshotSubset(sP_sub, 'stars', 'pos')
In : stars_mass = cosmo.load.snapshotSubset(sP_sub, 'stars', 'mass')
In : dist = cosmo.util.periodicDists( pos[w,:], stars_pos, sP )
In : dist.shape
In : mass=x['subhalos']['SubhaloMassInRadType'][w,4]
In : mass[0:100]
array([[ 0.00474399, 0.00235048, 0.00046931, ..., 0. ,
0. , 0. ]], dtype=float32)
In : w_dist = np.where(dist <= 2*x['subhalos']['SubhaloHalfmassRadType'][w,4])
In : np.sum(stars_mass[w_dist])
In : ages = cosmo.load.snapshotSubset(sP_sub, 'stars', 'sftime')
In : w_dist = np.where( (dist <= 2*x['subhalos']['SubhaloHalfmassRadType'][w,4]) & (ages>0.0) )
In : w_dist
(array([816, 819, 827, 828, 855, 856, 857, 859, 869, 870, 871, 874, 875,
876, 878, 882, 883, 885, 886, 887, 888, 890, 895, 896, 897, 898,
899, 900, 902, 903, 904, 905, 906, 907, 909, 910, 911, 913, 916,
922, 923, 925, 927, 929, 930, 931, 932, 933, 936, 938, 939, 941,
942, 945, 956, 983]),)
In : np.sum(stars_mass[w_dist])
Thanks... I was indeed missing the negative age. Sorry for that!