sample_sphere#

gammapy.utils.random.sample_sphere(size, lon_range=None, lat_range=None, random_state='random-seed')[source]#

Sample random points on the sphere.

Reference: http://mathworld.wolfram.com/SpherePointPicking.html

Parameters:
sizeint

Number of samples to generate.

lon_rangeAngle, optional

Longitude range (min, max).

lat_rangeAngle, optional

Latitude range (min, max).

random_state{int, ‘random-seed’, ‘global-rng’, RandomState}, optional

Defines random number generator initialisation. Passed to get_random_state. Default is “random-seed”.

Returns:
lon, lat: Angle

Longitude and latitude coordinate arrays.