def to_math_type(arr):
    """Convert an array from native integer dtype range to 0..1
    scaling down linearly
    """
    max_int = np.iinfo(arr.dtype).max
    return arr.astype(math_type) / max_int