Skip to content

Commit

Permalink
Update default topo file
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Sep 9, 2022
1 parent 387a80a commit 3b6e555
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions oggm/shop/rgitopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions oggm/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions oggm/tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions oggm/utils/_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand Down Expand Up @@ -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, *,
Expand Down

0 comments on commit 3b6e555

Please sign in to comment.