* comfirm that downloaded files match md5 checksum on server
    * if md5 is False, only check path for the download

def md5check(f, ftp, md5, exclude):
    """
    * comfirm that downloaded files match md5 checksum on server
    * if md5 is False, only check path for the download
    """
    files = glob(f)
    # if no md5 file is specified: download files if path does not exist
    if md5 is False:
        if len(files) == 0:
            return False
        print('## already downloaded:', f)
        return True
    # get md5s from server
    ## path to md5 file on ftp server
    md5 = '%s/%s' % (ftp.rsplit('/', 1)[0], md5)
    ## read md5 table from server
    try:
        md5 = pd.read_csv(md5, delim_whitespace = True, names = ['ftp md5', 'file'])
    except:
        return False
    ## filter for md5 files that match file type
    md5 = md5[md5['file'].str.endswith(f.rsplit('*', 1)[-1])]
    ## remove preceding characters from file paths
    md5['file'] = [i.replace('./', '') for i in md5['file']]
    ## exclude md5s for sub directories
    md5 = md5[~md5['file'].str.contains('/')]
    ## exclude files
    md5 = md5[~md5['file'].str.contains(exclude.replace('*', ''))]
    # get local md5s
    md5['local md5'] = [[j for j in calcMD5(i)][0] for i in md5['file']]
    # return false if md5s do not match
    for i, File in md5.iterrows():
        if File['ftp md5'] != File['local md5']:
            try:
                os.remove(File['file'])
                return False
            except:
                return False
    print('## already downloaded:', f)
    return True