def mode_type_from_header(h: str) ->str:
    """
    Extract scan mode from the header of filter string

    :param h: header or filter string
    :return: Scan type (e.g. p = profile, c = centroid)
    """
    if ' p ' in h.lower():
        return 'p'
    elif ' c ' in h.lower():
        return 'c'
    else:
        return None
