summing dark matter and star particles

Daniel McKeown
  • 26 Mar '16

Hello, I am creating radial profiles of the masses of dm,gas,bh,and stars. My counts add up perfectly for bh, and close for gas. However, I know that dm doesn't have a mass field, so I was using SubfindDensity, however, when I try to divide by the scale factor's I don't get the right numerical answer for the total dm mass content of the subhalo. What I wanted to do was to multiply by the volume to ensure that the units of the dm density are the same as those of gas, stars, and bh, but I don't know the volume of each dm unit cell.

Dylan Nelson
  • 30 Mar '16

Hi Daniel,

The DM is treated purely as particles (as are the stars), and they have no concept of an associated volume.

The mass of all DM particles is constant, you can get the exact value from the MassTable entry of the snapshot Header, under entry 1 for PartType1.

So, in making a radial profile, if you just get a count of how many DM particles are within a radius or radial bin, then that count multiplied by their constant mass gives the total DM mass within that radius, or in that radial bin. You shouldn't use SubfindDensity for this, as it means something a little different.

Daniel McKeown
  • 1
  • 1 Apr '16

Hello Dr. Nelson,

this makes sense. What I can do is use the coordinate dx to count the number of coordinates denoted in each sphere and then multiply the len of this coordinate count by the mass of each dark matter particle, and do the same procedure for the stars.

Thanks for your help.

Dylan Nelson
  • 1 Apr '16

While this is formally correct for the DM, it is only an approximation for the stars, since they do have individually variable masses (although roughly within a factor of plus/minus 2.0 times their mean, so the approximation should generally be ok). To be more precise for the stars, you'd want to do something e.g.

h = cosmo.load.snapshotHeader()

w_dm = np.where( (dm['rad'] > rad_min) & (dm['rad'] <= rad_max) )
dm_mass_inside = len(w_dm[0]) * h['MassTable'][1]

w_stars = np.where( (stars['rad'] > rad_min) & (stars['rad'] <= rad_max) )
stars_mass_inside = np.sum( stars['Masses'][w_stars] )
Daniel McKeown
  • 1
  • 1 Apr '16

ok great, that's cleaner than my method of averaging over the star masses. Thanks for the script. Oh, one quick question. Is the cosmo function script on the script example page? I didn't see it there but then again I might have missed it.

Dylan Nelson
  • 2 Apr '16

Sorry, that was just meant to be an example. You just need to load the MassTable field from the Header group of any snapshot file.

Yossi Cohen
  • 1
  • 29 Jul '20

Dear Dr. Nelson,

Sorry to barge into this 4 year old discussion, but I have a relevant question:
Is the DM particle mass independent of snapshot? Meaning, can I take it from here:

https://www.tng-project.org/data/downloads/TNG100-1/

and it's equivalents for any different version of the simulation?

Thanks in advance.

Dylan Nelson
  • 29 Jul '20

Hello,

Yes that's correct, unlike gas, stars, or BHs, the DM particle mass is constant (across particles and snapshots) for a given run. Those numbers should match to the table of runs.

Melika Sarrami
  • 10 Dec '23

Hello Dylan,
What is the issue causing this file to lack any members --> with h5py.File('./cutout_108014.hdf5', 'r') as f :
print(f['Header'].keys) and as a result I could not open MassTable.

Thank you

Dylan Nelson
  • 10 Dec '23

The Header group has only hdf5 attributes, so you need to read the attributes (not datasets) to see MassTable.

Melika Sarrami
  • 11 Dec '23

Could you explain how 'SubfindDMDensity' in PartType1 is computed, or could you refer me to a paper or tab that explains this? I want to know the difference between this and the amount in MassTable.

Dylan Nelson
  • 11 Dec '23

You'll find the definition of each in the documentation. They aren't directly related.

"SubfindDMDensity" would be better called just "DMDensity", it is the local DM density. This changes with location.

MassTable[1] is the mass of each DM particle.

  • Page 1 of 1