HaloMass

Yeimy dallana Camargo camargo
  • 13 Jun

Hello Dylan,

I'm asking you because I have a problem, I want obtain the mass of all halos (Group_M_Crit200?), it's positions (GroupPos?) and its formation time on Illustris-3, my actual code is:

import groupcat as GC
import sublink as SL
import numpy as np
import lhalotree as LH

GroupFirstSub = GC.loadHalos(basePath,135,fields=['GroupFirstSub'])
Halos=GC.loadHalos(basePath,135,fields=['Group_M_Crit200','GroupPos'])

for i in range(start,start+5):
tree = SL.loadTree(basePath,135,GroupFirstSub[i],fields=fields,onlyMPB=True)
def find_formation_time(sublinktree):
.
.
.
.
.

fields = ['SnapNum','Group_M_Crit200']

start = 0
n_halos = len(Halos['Group_M_Crit200'])
formation_time = []
final_mass = []
for i in range(start,start+n_halos):
tree = SL.loadTree(basePath,135,GroupFirstSub[i],fields=fields,onlyMPB=True)
formation_time.append(find_formation_time(tree))
final_mass.append(tree['Group_M_Crit200'][0])

len(Halos['Group_M_Crit200'])= 131727, then in Illustris-3 simulation have 131727 halos, but an error occurs: ValueError: Index (4294906691) out of range (0-60604).

I don't understand whats happen, can you help me please?
Thanks in advance

Dylan Nelson
  • 13 Jun

Hi Yeimy,

I think you hit a little annoying detail, which is described under the description of GroupFirstSub: "Index into the Subhalo table of the first/primary/most massive Subfind group within this FoF group. Note: This value is signed (or should be interpreted as signed)! In this case, a value of -1 indicates that this FoF group has no subhalos."

This large value of 4294906691 is actually -1, indicating the group has no subhalos. You could load also GroupNsubs and do e.g. if GroupNsubs==0: continue before you try to load the tree.

Yeimy dallana Camargo camargo
  • 13 Jun

Hi,
don't works,

fields = ['SubhaloMass','SnapNum','Group_M_Crit200']
start = 0
n_halos =len(Halos['Group_M_Crit200'])
formation_time = []
final_mass = []
for i in range(start,start+n_halos):
if GroupNsubs.all()==0:
tree = SL.loadTree(basePath,135,GroupFirstSub[i],fields=fields,onlyMPB=True)
formation_time.append(find_formation_time(tree))
final_mass.append(tree['Group_M_Crit200'][0])

Again, an error occurs: ValueError: Index (4294906691) out of range (0-60604).

Dylan Nelson
  • 13 Jun

Hi,

I'm not sure about GroupNsubs.all()==0, I meant more like:

for i in range(start, start+n_halos):
    if GroupNsubs[i] == 0:
        continue
     tree = ...
  • Page 1 of 1