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:
the xy positions are discrete integers (works okay if your PSF is well-sampled)
the number of sampled stars is fixed regardless of the size of the sampling grid (e.g., you could have all the stars packed into one effective radius if num_r_eff = 1)
the memory requirements can become extreme if r_eff is large in pixel space
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.
Currently, the Sersic spatial sampling uses
xy_from_grid
, with the parameternum_r_eff
setting how large of a grid to use. There are three downsides of this approach:xy
positions are discrete integers (works okay if your PSF is well-sampled)num_r_eff = 1
)r_eff
is large in pixel spaceOne 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 ofnum_stars
.