ArtificialStellarPopulations / ArtPop

✨ ArtPop – Building artificial galaxies one star at a time.
https://artpop.readthedocs.io/en/latest/
MIT License
61 stars 10 forks source link

smarter sersic grid sampling #1

Closed johnnygreco closed 3 years ago

johnnygreco commented 3 years ago

Currently, the Sersic spatial sampling uses xy_from_grid, with the parameter num_r_eff setting how large of a grid to use. There are three downsides of this approach:

One simple way to solve the second and third issues is to use the input Sersic distribution to calculate the fraction of stars that will fall outside the image and reduce the number of sampled stars by this factor.

Note: the implementation may require some more thought when total_mass given instead of num_stars.