pow2ceil

sofia_redux.scan.utilities.utils.pow2ceil(x)[source]

Returns the value ceiled to the closest 2^N integer.

Parameters:
xint or float or numpy.ndarray

The input value(s).

Returns:
resultint or numpy.ndarray (int)

Examples

>>> print(pow2ceil(1023))
1024
>>> print(pow2ceil(1024))
1024
>>> print(pow2ceil(1025))
2048