예제 #1
0
def download_atom_data(atomic_data_name=None):
    """
    Download the atomic data from the repository

    Parameters
    ----------
    atomic_data_name : str
        if None

    Returns
    -------
        : None
    """
    atomic_repo = get_atomic_repo_config()

    if atomic_data_name is None:
        atomic_data_name = atomic_repo["default"]

    if atomic_data_name not in atomic_repo:
        raise ValueError(
            "Atomic Data name {0} not known".format(atomic_data_name))
    dst_dir = os.path.join(get_data_dir(), "{0}.h5".format(atomic_data_name))
    src_url = atomic_repo[atomic_data_name]["url"]
    logger.info("Downloading atomic data from {0} to {1}".format(
        src_url, dst_dir))
    download_from_url(src_url, dst_dir)
예제 #2
0
def download_atom_data(atomic_data_name=None):
    """
    Download the atomic data from the repository

    Parameters
    ----------
    atomic_data_name : str
        if None

    Returns
    -------
        : None
    """
    atomic_repo = get_atomic_repo_config()

    if atomic_data_name is None:
        atomic_data_name = atomic_repo["default"]

    if atomic_data_name not in atomic_repo:
        raise ValueError(f"Atomic Data name {atomic_data_name} not known")

    dst_dir = os.path.join(get_data_dir(), f"{atomic_data_name}.h5")
    src_url = atomic_repo[atomic_data_name]["url"]
    mirrors = atomic_repo[atomic_data_name]["mirrors"]

    logger.info(f"Downloading atomic data from {src_url} to {dst_dir}")
    download_from_url(src_url, dst_dir, mirrors)
예제 #3
0
def download_atom_data(atomic_data_name=None):
    """
    Download the atomic data from the repository
    Parameters
    ----------
    atomic_data_name: str
        if None

    Returns
    -------
        : None

    """
    atomic_repo = get_atomic_repo_config()

    if atomic_data_name is None:
        atomic_data_name = atomic_repo['default']

    if atomic_data_name not in atomic_repo:
        raise ValueError('Atomic Data name {0} not known'.format(atomic_data_name))
    dst_dir = os.path.join(get_data_dir(), '{0}.h5'.format(atomic_data_name))
    src_url = atomic_repo[atomic_data_name]['url']
    logger.info('Downloading atomic data from {0} to {1}'.format(src_url, dst_dir))
    download_from_url(src_url, dst_dir)