diff --git a/oggm/tests/test_utils.py b/oggm/tests/test_utils.py index 2a6b9f4c7..26302beca 100644 --- a/oggm/tests/test_utils.py +++ b/oggm/tests/test_utils.py @@ -2225,8 +2225,7 @@ def test_copdem90(self): # Make a fake topo file deep_path = os.path.join(self.dldir, - 'DEM1_SAR_DGE_90_20110517T170701_20140817T170857' - '_ADS_000000_3682.DEM', + 'COP-DEM_GLO-90-DGED__2022_1', 'Copernicus_DSM_30_N46_00_E010_00', 'DEM') utils.mkdir(deep_path) upper_path = os.path.dirname(os.path.dirname(deep_path)) @@ -2237,14 +2236,13 @@ def test_copdem90(self): archive='tar', extension='.tar') def down_check(url, *args, **kwargs): - expected = ('ftps://cdsdata.copernicus.eu:990/datasets/' - 'COP-DEM_GLO-90-DGED/2022_1/' - 'DEM1_SAR_DGE_90_20110517T170701_20140817T170857_ADS_' - '000000_3682.DEM.tar') + expected = ('https://prism-dem-open.copernicus.eu/pd-desk-open-access/prismDownload/' + 'COP-DEM_GLO-90-DGED__2022_1/' + 'Copernicus_DSM_30_N46_00_E010_00.tar') self.assertEqual(expected, url) return tf - with FakeDownloadManager('download_with_authentication', down_check): + with FakeDownloadManager('file_downloader', down_check): of, source = utils.get_topo_file([10.5, 10.8], [46.6, 46.8], source='COPDEM90') @@ -2255,8 +2253,7 @@ def test_copdem30(self): # Make a fake topo file deep_path = os.path.join(self.dldir, - 'DEM1_SAR_DGE_30_20110517T170701_20140817T170857' - '_ADS_000000_bma2.DEM', + 'COP-DEM_GLO-30-DGED__2022_1', 'Copernicus_DSM_10_N46_00_E010_00', 'DEM') utils.mkdir(deep_path) upper_path = os.path.dirname(os.path.dirname(deep_path)) @@ -2267,14 +2264,13 @@ def test_copdem30(self): archive='tar', extension='.tar') def down_check(url, *args, **kwargs): - expected = ('ftps://cdsdata.copernicus.eu:990/datasets/' - 'COP-DEM_GLO-30-DGED/2022_1/' - 'DEM1_SAR_DGE_30_20110517T170701_20140817T170857_ADS_' - '000000_bma2.DEM.tar') + expected = ('https://prism-dem-open.copernicus.eu/pd-desk-open-access/prismDownload/' + 'COP-DEM_GLO-30-DGED__2022_1/' + 'Copernicus_DSM_10_N46_00_E010_00.tar') self.assertEqual(expected, url) return tf - with FakeDownloadManager('download_with_authentication', down_check): + with FakeDownloadManager('file_downloader', down_check): of, source = utils.get_topo_file([10.5, 10.8], [46.6, 46.8], source='COPDEM30') diff --git a/oggm/utils/_downloads.py b/oggm/utils/_downloads.py index 5b644da0e..26b426e3d 100644 --- a/oggm/utils/_downloads.py +++ b/oggm/utils/_downloads.py @@ -1163,12 +1163,9 @@ def _download_copdem_file_unlocked(cppfile, tilename, source): return demfile # Did we download it yet? - ftpfile = ('ftps://cdsdata.copernicus.eu:990/' + - 'datasets/COP-DEM_GLO-{}-DGED/2022_1/'.format(source[-2:]) + - cppfile) - - dest_file = download_with_authentication(ftpfile, - 'spacedata.copernicus.eu') + url = (f"https://prism-dem-open.copernicus.eu/pd-desk-open-access/prismDownload" + f"/COP-DEM_GLO-{source[-2:]}-DGED__2022_1/{tilename}.tar") + dest_file = file_downloader(url) # None means we tried hard but we couldn't find it if not dest_file: