Hello,
There are multiple subfind halos in the TNG300-1 box with nonzero gas mass, for which the masses of the individual elements given by 'SubhaloGasMetalFractions' are either all zero or do not add up to 1. So, the mass of hydrogen gas in these subhalos is zero even though there is nonzero mass in the gas phase, which is unexpected. Could you please let me know if I am missing something and also point me to resources that describe how the fractions of these different elements are being calculated?
Dylan Nelson
3 Nov
Can you provide a specific example (snapshot number and subhalo ID)?
I found this issue in snapshot number 25 (z = 3.01). I ran this to verify:
z = '3.01'
groupcat = 25
basepath = f'z{z}/TNG300-1/output'
fields = ['SubhaloFlag','SubhaloMass','SubhaloMassType','SubhaloGasMetalFractions','SubhaloSFR','SubhaloCM','SubhaloVel']
subhalos = il.groupcat.loadSubhalos(basepath,groupcat,fields=fields)
indices = np.where(subhalos['SubhaloFlag']==1)[0]
gasmass = subhalos['SubhaloMassType'][indices][:,0]
hfrac = subhalos['SubhaloGasMetalFractions'][indices][:,0]
hmass = gasmass * hfrac
gm = np.where(gasmass>0)[0]
hm = np.where(hmass==0)[0]
common = np.intersect1d(gm,hm)
print(len(common))
This gives a large number (16480759 out of 19352269 unflagged subhalos) of subhalos with nonzero gas mass but zero hydrogen mass. I also checked whether the sums of element fractions are adding up to 1:
fracsums = np.sum(subhalos['SubhaloGasMetalFractions'][indices],axis=1)
fs = np.where(fracsums!=1)[0]
common1 = np.intersect1d(gm,fs)
print(len(common1))
This gives 16896562 such subhalos where the fractions do not add up.
Dylan Nelson
8 Nov
This is because the field SubhaloGasMetalFractions includes only gas within twice the stellar half mass radius.
If you therefore change SubhaloMassType to SubhalomassInRadType for consistency, you won't find any subhalos with non-zero gas mass (of this definition) with zero hydrogen mass fraction.
Hello,
There are multiple subfind halos in the TNG300-1 box with nonzero gas mass, for which the masses of the individual elements given by 'SubhaloGasMetalFractions' are either all zero or do not add up to 1. So, the mass of hydrogen gas in these subhalos is zero even though there is nonzero mass in the gas phase, which is unexpected. Could you please let me know if I am missing something and also point me to resources that describe how the fractions of these different elements are being calculated?
Can you provide a specific example (snapshot number and subhalo ID)?
I found this issue in snapshot number 25 (z = 3.01). I ran this to verify:
This gives 16896562 such subhalos where the fractions do not add up.
This is because the field
SubhaloGasMetalFractions
includes only gas within twice the stellar half mass radius.If you therefore change
SubhaloMassType
toSubhalomassInRadType
for consistency, you won't find any subhalos with non-zero gas mass (of this definition) with zero hydrogen mass fraction.This is working. Thank you so much.