sqrt_space

gammapy.utils.nddata.sqrt_space(start, stop, num)[source]

Return numbers spaced evenly on a square root scale.

This function is similar to numpy.linspace and numpy.logspace.

Parameters:

start : float

start is the starting value of the sequence

stop : float

stop is the final value of the sequence

num : int

Number of samples to generate.

Returns:

samples : ndarray

1D array with a square root scale

Examples

>>> from gammapy.utils.nddata import sqrt_space
>>> samples = sqrt_space(0, 2, 5)
array([ 0.        ,  1.        ,  1.41421356,  1.73205081,  2.        ])