astropy/halotools

NFWProfile.mc_generate_nfw_radial_positions

reevesAstronomy opened this issue · 1 comments

NFWProfile.mc_generate_nfw_radial_positions does not allow changing the truncation radius for simulated radii to go beyond the radius corresponding to a provided halo_mass parameter (eg: R200c if you specified M500c). In other words, the current functionality of NFWProfile.mc_generate_nfw_radial_positions will not allow drawing samples from beyond the specified radius (either specified through the mass or directly with the halo_radius parameter), which seems like it should be allowed, since the NFW profile is a simple analytic function.

My particular use case is simulating radial positions of group galaxies, given R200/R500. I've already moved on to writing my own function to do this without using halotools, but thought I'd file the issue, since it would make for a good improvement, assuming others actually use this NFWProfile.mc_generate_nfw_radial_positions function.

NFW_example_simulation
Example plot of 1,000,000 binned samples. I've drawn on an NFW profile normalized to the data-points, for illustration.

Thanks for raising this issue @reevesAstronomy. I originally thought it was a good idea to enforce that halo mass and halo radius are defined in terms of a consistent definition, but in hindsight this degree of freedom should be left up to the user. If all you need is the spatial positions then it should be relatively trivial to rescale xyz according to R_desired/R_vir. I will make a note to relax this requirement in the API before releasing v0.7.