wrap_at#

gammapy.utils.units.wrap_at(value, min_value, max_value)[source]#

Wraps a value to be within the range [min_value, max_value).

Parameters:
valuefloat or Unit

The value to wrap

min_valuefloat or Unit

The minimum value of the range (inclusive).

max_valuefloat or Unit

The maximum value of the range (exclusive).

Returns:
wrapped_valfloat or Unit

Wrapped value