scipp.geomspace#

scipp.geomspace(dim, start, stop, num, *, endpoint=True, unit=<automatically deduced unit>, dtype=None)#

Constructs a Variable with values spaced evenly on a log scale (a geometric progression).

This is similar to scipp.logspace(), but with endpoints specified directly instead of as exponents. Each output sample is a constant multiple of the previous.

Parameters
  • dim (str) – Dimension label.

  • start (TypeVar(NumberOrVar, Union[int, float], Variable)) – The starting value of the sequence.

  • stop (TypeVar(NumberOrVar, Union[int, float], Variable)) – The end value of the sequence.

  • num (int) – Number of samples to generate.

  • endpoint (bool, default: True) – If True, step is the last returned value. Otherwise, it is not included.

  • unit (Union[Unit, str, None], default: <automatically deduced unit>) – Unit of contents.

  • dtype (scipp.typing.DTypeLike) – Type of underlying data. By default, inferred from value argument.

Examples

>>> sc.geomspace('x', 1.0, 1000.0, num=4)
<scipp.Variable> (x: 4)    float64  [dimensionless]  [1, 10, 100, 1000]
>>> sc.geomspace('x', 1.0, 1000.0, num=4, endpoint=False)
<scipp.Variable> (x: 4)    float64  [dimensionless]  [1, 5.62341, 31.6228, 177.828]
>>> sc.geomspace('x', 1.0, 100.0, num=3, unit='s')
<scipp.Variable> (x: 3)    float64              [s]  [1, 10, 100]
Return type

Variable