round_values

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

Round any given value to the expected result.

The function np.round() does not round values as one might expect. If int(x) is equal to an odd number, #.5 numbers will be rounded down rather than up (as expected). This function attempts to fix that.

Parameters:
xint or float or numpy.ndarray or units.Quantity

The value to round.

Returns:
roundedint or numpy.ndarray (int) or units.Quantity