def sxpar (header, key, default=None) :
    """ Check weather the key is in header, if yes, return value, else return default
    args:
        header: fits head, get from hdulist[x].header
        key: key of the card you want to visit
        default: default value if key not in header, and if key exists, but value is empty
    returns:
        value of key, if not exists or empty, return default value
    """
    if key in header.keys() :
        v = header[key]
        if v == "" :
            v = default
        if type(v) == str :
            v = v.strip()
    else :
        v = default
    return v