Skip to content

Commit 99c9592

Browse files
authored
Merge pull request #45 from andrewdelman/v4r4_tut_updates
V4r4 tut updates
2 parents 008afec + 0e554d8 commit 99c9592

2 files changed

Lines changed: 40 additions & 43 deletions

File tree

ECCO-ACCESS/Downloading_ECCO_datasets_from_PODAAC/ecco_download.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,16 @@ def ecco_podaac_download(ShortName,StartDate,EndDate,download_root_dir=None,n_wo
3535
from platform import system
3636
from netrc import netrc
3737
from os.path import basename, isfile, isdir, join, expanduser
38+
import sys
3839
# progress bar
3940
from tqdm import tqdm
4041
# library to download files
4142
from urllib import request
4243

4344
# if no download directory specified, set directory under user's home directory
4445
if download_root_dir==None:
45-
import sys
4646
user_home_dir = expanduser('~')
47-
download_root_dir = Path(user_home_dir + '/Downloads/ECCO_V4r4_PODAAC')
48-
else:
49-
download_root_dir = Path(download_root_dir)
47+
download_root_dir = join(user_home_dir,'Downloads','ECCO_V4r4_PODAAC')
5048

5149
# Predict the path of the netrc file depending on os/platform type.
5250
_netrc = join(expanduser('~'), "_netrc" if system()=="Windows" else ".netrc")
@@ -148,11 +146,9 @@ def download_files_concurrently(dls, download_dir, force=False):
148146
print(f'total downloaded: {np.round(total_download_size_in_bytes/1e6,2)} Mb')
149147
print(f'avg download speed: {np.round(total_download_size_in_bytes/1e6/total_time,2)} Mb/s')
150148

151-
# define root directory for downloaded NetCDF files
152-
download_root_dir = Path(user_home_dir + '/Downloads/ECCO_V4r4_PODAAC')
153-
149+
154150
# define the directory where the downloaded files will be saved
155-
download_dir = download_root_dir / ShortName
151+
download_dir = Path(download_root_dir) / ShortName
156152

157153
# create the download directory
158154
download_dir.mkdir(exist_ok = True, parents=True)

0 commit comments

Comments
 (0)