def guess_url(web_dir, host, user):
    """Guess the base url from the host name

    Parameters
    ----------
    web_dir: str
        path to the web directory where you want the data to be saved
    host: str
        the host name of the machine where the python interpreter is currently
        executing
    user: str
        the user that is current executing the python interpreter
    """
    ligo_data_grid = False
    if 'public_html' in web_dir:
        ligo_data_grid = True
    if ligo_data_grid:
        path = web_dir.split('public_html')[1]
        if 'raven' in host or 'arcca' in host:
            url = 'https://geo2.arcca.cf.ac.uk/~{}'.format(user)
        elif 'ligo-wa' in host:
            url = 'https://ldas-jobs.ligo-wa.caltech.edu/~{}'.format(user)
        elif 'ligo-la' in host:
            url = 'https://ldas-jobs.ligo-la.caltech.edu/~{}'.format(user)
        elif 'cit' in host or 'caltech' in host:
            url = 'https://ldas-jobs.ligo.caltech.edu/~{}'.format(user)
        elif 'uwm' in host or 'nemo' in host:
            url = 'https://ldas-jobs.phys.uwm.edu/~{}'.format(user)
        elif 'phy.syr.edu' in host:
            url = 'https://sugar-jobs.phy.syr.edu/~{}'.format(user)
        elif 'vulcan' in host:
            url = 'https://galahad.aei.mpg.de/~{}'.format(user)
        elif 'atlas' in host:
            url = 'https://atlas1.atlas.aei.uni-hannover.de/~{}'.format(user)
        elif 'iucca' in host:
            url = 'https://ldas-jobs.gw.iucaa.in/~{}'.format(user)
        elif 'hawk' in host:
            url = 'https://ligo.gravity.cf.ac.uk/~{}'.format(user)
        else:
            url = 'https://{}/~{}'.format(host, user)
        url += path
    else:
        url = 'https://{}'.format(web_dir)
    return url
