@@ -388,7 +388,8 @@ def ecco_podaac_download(ShortName,StartDate,EndDate,version,snapshot_interval='
388388
389389 download_root_dir: str, defines parent directory to download files to.
390390 Files will be downloaded to directory download_root_dir/ShortName/.
391- If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/'.
391+ If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/',
392+ or '~/Downloads/ECCO_V4r5_PODAAC/' if version == 'v4r5'.
392393
393394 n_workers: int, number of workers to use in concurrent downloads. Benefits typically taper off above 5-6.
394395
@@ -417,16 +418,21 @@ def ecco_podaac_download(ShortName,StartDate,EndDate,version,snapshot_interval='
417418
418419 # set default download parent directory
419420 if download_root_dir == None :
420- download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
421+ if version == 'v4r4' :
422+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
423+ elif version == 'v4r5' :
424+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r5_PODAAC' )
421425
422426 # define the directory where the downloaded files will be saved
423427 download_dir = Path (download_root_dir ) / ShortName
424428
425- # create the download directory
429+ # create the download directory if it does not already exist
430+ if isdir (download_dir ) == True :
431+ print (f'Download to directory { download_dir } ' )
432+ else :
433+ print (f'Creating download directory { download_dir } ' )
426434 download_dir .mkdir (exist_ok = True , parents = True )
427435
428- print (f'created download directory { download_dir } ' )
429-
430436 # query CMR for granules matching the request
431437 urls ,sizes = ecco_podaac_query (ShortName ,StartDate ,EndDate ,version ,snapshot_interval )
432438
@@ -478,7 +484,8 @@ def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,version,snapshot
478484
479485 download_root_dir: str, defines parent directory to download files to.
480486 Files will be downloaded to directory download_root_dir/ShortName/.
481- If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/'.
487+ If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/',
488+ or '~/Downloads/ECCO_V4r5_PODAAC/' if version == 'v4r5'.
482489
483490 max_avail_frac: float, maximum fraction of remaining available disk space to use in storing current ECCO datasets.
484491 If storing the datasets exceeds this fraction, an error is returned.
@@ -522,7 +529,10 @@ def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,version,snapshot
522529
523530 # set default download parent directory
524531 if download_root_dir == None :
525- download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
532+ if version == 'v4r4' :
533+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
534+ elif version == 'v4r5' :
535+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r5_PODAAC' )
526536
527537 # add up total size of files that would be downloaded
528538 dataset_sizes = np .array ([])
@@ -532,8 +542,14 @@ def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,version,snapshot
532542 # get list of files
533543 urls ,sizes = ecco_podaac_query (curr_shortname ,StartDate ,EndDate ,version ,snapshot_interval )
534544
535- # create the download directory if it does not already exist
545+ # define the directory where the downloaded files will be saved
536546 download_dir = Path (download_root_dir ) / curr_shortname
547+
548+ # create the download directory if it does not already exist
549+ if isdir (download_dir ) == True :
550+ print (f'Download to directory { download_dir } ' )
551+ else :
552+ print (f'Creating download directory { download_dir } ' )
537553 download_dir .mkdir (exist_ok = True , parents = True )
538554
539555 # compute size of current dataset
@@ -718,7 +734,8 @@ def ecco_podaac_download_subset(ShortName,StartDate=None,EndDate=None,snapshot_i
718734
719735 download_root_dir: str, defines parent directory to download files to.
720736 Files will be downloaded to directory download_root_dir/ShortName/.
721- If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/'.
737+ If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/',
738+ or '~/Downloads/ECCO_V4r5_PODAAC/' if version == 'v4r5'.
722739 subset_file_id: str, identifier appended to each downloaded file to identify it as a subset.
723740 Default is to not append an identifier.
724741
@@ -1079,7 +1096,10 @@ def download_wrapper(url: str, url_append: str, download_dir: str, subset_file_i
10791096
10801097 # set default download parent directory
10811098 if download_root_dir == None :
1082- download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
1099+ if version == 'v4r4' :
1100+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r4_PODAAC' )
1101+ elif version == 'v4r5' :
1102+ download_root_dir = join (expanduser ('~' ),'Downloads' ,'ECCO_V4r5_PODAAC' )
10831103
10841104 # define the directory where the downloaded files will be saved
10851105 download_dir = Path (download_root_dir ) / ShortName
0 commit comments