Question about ART Gas cell_mass Calculation (and other fields)
Hello All, I have a question regarding how yt finds the cell_mass of a sphere in ART simulations. I am currently doing an analysis of the mass profiles within the virial radius of a galaxy, finding the masses using these commands: sp_new_rvir = ds.sphere(center, (float(new_rvir.in_units('kpc')), 'kpc')) sp_new_rvir_010 = ds.sphere(center, (float(new_rvir.in_units('kpc'))*.1, 'kpc')) sp_new_rvir_015 = ds.sphere(center, (float(new_rvir.in_units('kpc'))*.15, 'kpc')) sp_new_rvir_020 = ds.sphere(center, (float(new_rvir.in_units('kpc'))*.2, 'kpc')) stellar_mass_rvir, darkmatter_mass_rvir, gas_mass_rvir = sp_new_rvir.quantities.total_quantity([('stars', 'particle_mass'),\ ('darkmatter', 'particle_mass'),\ ('gas', 'cell_mass')]) stellar_mass_010, gas_mass_010 = sp_new_rvir_010.quantities.total_quantity([('stars', 'particle_mass'),\ ('gas', 'cell_mass')]) stellar_mass_015, gas_mass_015 = sp_new_rvir_015.quantities.total_quantity([('stars', 'particle_mass'),\ ('gas', 'cell_mass')]) stellar_mass_020, gas_mass_020 = sp_new_rvir_020.quantities.total_quantity([('stars', 'particle_mass'),\ ('gas', 'cell_mass')]) These work just fine, and return results, but when I compare these values to ones collected by a collaborator, I disagree on the total masses within each sphere by a small amount. I imagine that there might be a difference in how yt calculates these quantities compared to the other methodology, which I would like to understand, as both are probably acceptable methods, but understanding the difference seems important. I have a gut feeling that gas mass is probably the cause of this difference, as I dont see how a difference in the particle fields could arise. I was looking through the yt fields list page (https://yt-project.org/doc/reference/field_list.html) to see how the cell_mass paramater was defined to compare to this other method, and saw that it is multiplying the density and cell volume field. On that page, it lists the method for the density field as follows: def _TranslationFunc(field, data): # We do a bunch of in-place modifications, so we will copy this. return data[field_name].copy() I am not sure where to look to see where the method for the density field calculation is stored. I looked a bit around the ART frontend here https://github.com/yt-project/yt/tree/master/yt/frontends/art but could not find anything. I was wondering if anyone could point me to where this is?
participants (2)
-
Matthew Turk
-
sflarkin@ucsc.edu