diff --git a/oggm/shop/rgitopo.py b/oggm/shop/rgitopo.py index 300fc2655..42561b8ce 100644 --- a/oggm/shop/rgitopo.py +++ b/oggm/shop/rgitopo.py @@ -23,6 +23,7 @@ DEMS_URL = 'https://cluster.klima.uni-bremen.de/data/gdirs/dems_v2/default' DEMS_HR_URL = 'https://cluster.klima.uni-bremen.de/data/gdirs/dems_v1/highres/' + def init_glacier_directories_from_rgitopo(rgidf=None, dem_source=None, resolution='default', keep_dem_folders=False, diff --git a/oggm/tests/test_utils.py b/oggm/tests/test_utils.py index 62b6b9496..81add04c1 100644 --- a/oggm/tests/test_utils.py +++ b/oggm/tests/test_utils.py @@ -2509,6 +2509,8 @@ def test_find_dem_zone(self): assert utils.default_dem_source('RGI60-11.00897') == 'NASADEM' assert utils.default_dem_source('RGI60-11.00897_merged') == 'NASADEM' assert utils.default_dem_source('RGI60-19.01251') == 'COPDEM90' + assert utils.default_dem_source('RGI60-06.00483') == 'COPDEM90' + assert utils.default_dem_source('RGI60-19.01405') == 'COPDEM90' assert utils.default_dem_source('RGI60-19.00970') == 'REMA' assert utils.default_dem_source('RGI60-05.10315') == 'GIMP' assert utils.default_dem_source('RGI60-19.01820') == 'MAPZEN' diff --git a/oggm/tests/test_workflow.py b/oggm/tests/test_workflow.py index 9a51d542d..6d69271a0 100644 --- a/oggm/tests/test_workflow.py +++ b/oggm/tests/test_workflow.py @@ -52,10 +52,10 @@ def up_to_climate(reset=False, use_mp=None): cfg.initialize() # Use multiprocessing - # if use_mp is None: - # cfg.PARAMS['use_multiprocessing'] = use_multiprocessing() - # else: - # cfg.PARAMS['use_multiprocessing'] = use_mp + if use_mp is None: + cfg.PARAMS['use_multiprocessing'] = use_multiprocessing() + else: + cfg.PARAMS['use_multiprocessing'] = use_mp # Working dir cfg.PATHS['working_dir'] = _TEST_DIR diff --git a/oggm/utils/_downloads.py b/oggm/utils/_downloads.py index deb57d67f..2968dd712 100644 --- a/oggm/utils/_downloads.py +++ b/oggm/utils/_downloads.py @@ -69,7 +69,7 @@ # The given commit will be downloaded from github and used as source for # all sample data SAMPLE_DATA_GH_REPO = 'OGGM/oggm-sample-data' -SAMPLE_DATA_COMMIT = 'f94ba47fc7c3d0355b806e622e330106e08cc16f' +SAMPLE_DATA_COMMIT = '8a3c41a36d190c6c78029b5032648ce94ee2026c' GDIR_L1L2_URL = ('https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/' 'L1-L2_files/centerlines/') @@ -2206,17 +2206,15 @@ def default_dem_source(rgi_id): rgi_id = rgi_id[:14] if cfg.DEM_SOURCE_TABLE.get(rgi_reg) is None: fp = get_demo_file('rgi62_dem_frac.h5') - cfg.DEM_SOURCE_TABLE[rgi_reg] = pd.read_hdf(fp, key=rgi_reg) + cfg.DEM_SOURCE_TABLE[rgi_reg] = pd.read_hdf(fp) sel = cfg.DEM_SOURCE_TABLE[rgi_reg].loc[rgi_id] - for s in ['NASADEM', 'COPDEM', 'GIMP', 'REMA', 'TANDEM', 'MAPZEN']: + for s in ['NASADEM', 'COPDEM90', 'COPDEM30', 'GIMP', 'REMA', + 'RAMP', 'TANDEM', 'MAPZEN']: if sel.loc[s] > 0.75: - # this can go as soon as 'rgi62_dem_frac.h5' is updated: - if s == 'COPDEM': - s = 'COPDEM90' return s - - return None + # If nothing works, try COPDEM again + return 'COPDEM90' def get_topo_file(lon_ex=None, lat_ex=None, rgi_id=None, *,