silmarel.utils.funcs module¶
Generate a random position using the flux per pixel for probabilities.
Useful e.g. to generate random BBH source positions given host profile image.
- silmarel.utils.funcs.random_position_generator(image, nrand)¶
Generate a random position within the image weighted by the pixel values.
- Parameters:
image (2D numpy array) – The image to generate random positions from.
nrand (int) – The number of random positions to generate.
- Returns:
rand_pos – The random positions generated.
- Return type:
2D numpy array