obspy.imaging.spectrogram._nearest_pow_2

_nearest_pow_2(x)[source]

Find power of two nearest to x

>>> _nearest_pow_2(3)
2.0
>>> _nearest_pow_2(15)
16.0
Parameters:

x (float) – Number

Return type:

int

Returns:

Nearest power of 2 to x