def query_ebv(ra, dec, size=2, thresh=0.25, verbose=False):
    """
    Take ra,dec and return the E(B-V) number
    URL query, see https://irsa.ipac.caltech.edu/applications/DUST
    """
    import urllib2
    import xmltodict
    url = 'https://irsa.ipac.caltech.edu/cgi-bin/DUST/nph-dust?'
    url += 'locstr=%.2f+%.2f+equ+j2000' % (ra, dec)
    if size < 2:
        size = 2
    if size > 37.5:
        size = 37.5
    url += '&regSize=%.2f' % size
    _file = urllib2.urlopen(url)
    data = _file.read()
    _file.close()
    _dict = xmltodict.parse(data)
    _ebv = _dict['results']['result'][0]['statistics']['meanValueSFD']
    ebvalue = float(_ebv.split('(mag)')[0])
    if ebvalue < thresh:
        if verbose:
            print('ra=%.2f dec=%.2f:\tebv=%.2f\tOK' % (ra, dec, float(_ebv.
                split('(mag)')[0])))
        return ebvalue
    else:
        if verbose:
            print('ra=%.2f dec=%.2f:\tebv=%.2f\tNo' % (ra, dec, float(_ebv.
                split('(mag)')[0])))
        return
