def _get_endian_str(endian):
    """
    DM4 header encodes little endian as byte value 1 in the header
    :return: 'big' or 'little' for use with python's int.frombytes function
    """
    if isinstance(endian, str):
        return endian
    assert isinstance(endian, int)
    if endian == 1:
        return 'little'
    return 'big'
