Returns geometrically spaced numbers.
Parameters: | start : float
ratio : float (optional)
stop : float (optional)
num : int (optional)
|
---|---|
Returns: | seq : array
|
Examples
To get a geometric progression between 0.01 and 3 in 10 steps
>>> import spacepy.toolbox as tb
>>> tb.geomspace(0.01, stop=3, num=10)
[0.01,
0.018846716378431192,
0.035519871824902655,
0.066943295008216955,
0.12616612944575134,
0.23778172582285118,
0.44814047465571644,
0.84459764235318191,
1.5917892219322083,
2.9999999999999996]
To get a geometric progression with a specified ratio, say 10
>>> import spacepy.toolbox as tb
>>> tb.geomspace(0.01, ratio=10, num=5)
[0.01, 0.10000000000000001, 1.0, 10.0, 100.0]