def _get_struct_endian_str(endian):
    """
    DM4 header encodes little endian as byte value 1 in the header.  However when that convention is followed the wrong values are read.  So this implementation is reversed.
    :return: '>' or '<' for use with python's struct.unpack function
    """
    if isinstance(endian, str):
        if endian == 'little':
            return '>'
        else:
            return '<'
    elif endian == 1:
        return '>'
    else:
        return '<'
