cratermaker.utils.montecarlo_utils.get_random_location

cratermaker.utils.montecarlo_utils.get_random_location#

cratermaker.utils.montecarlo_utils.get_random_location(size=1, rng=None, rng_seed=None, rng_state=None, **kwargs)[source]#

Computes random longitude and latitude values.

Generates a set of latitude and longitude values that are uniformly distributed on the surface of a sphere.

Parameters:
  • size (int or tuple of ints, optional) – The number of samples to generate. If size is None (the default), a single tuple is returned. If size is greater than 1, then a structured array with fields ‘lon’ and ‘lat’ is returned.

  • rng (numpy.random.Generator | None) – A numpy random number generator. If None, a new generator is created using the rng_seed if it is provided.

  • rng_seed (Any type allowed by the rng_seed argument of numpy.random.Generator, optional) – The rng_seed for the RNG. If None, a new RNG is created.

  • rng_state (dict, optional) – The state of the random number generator. If None, a new state is created.

  • **kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.

Returns:

A structured numpy array with the location data in the format [(‘lon’, ‘f8’), (‘lat’, ‘f8’)].