OGGM / tutorials

Notebook tutorials for the Open Global Glacier Model (OGGM)
https://tutorials.oggm.org
BSD 3-Clause "New" or "Revised" License
17 stars 18 forks source link

Some bugs about file path after RGI dataset updated from v6 to v7 #110

Open Dongdong001122 opened 11 months ago

Dongdong001122 commented 11 months ago

There is some error when I run the OGGM workflow after inputting the RGI version 7. For example, get_filepath("dem") went error during to dem.tif file saved as /tmp/OGGM/OGGM-GettingStarted-10m/per_glacier/RGI2000-v7.0-G-13/RGI2000-v7.0-G-13-53/RGI2000-v7.0-G-13-53637/DEM3/dem.tif which cannot be get the path correctly. Maybe the source code is outdated.

anoukvlug commented 11 months ago

I haven't been able to reproduce an error. Could you provide us with a some information? e.g. what code do you use and which error does it result in? And what OGGM version are you using?

Dongdong001122 commented 11 months ago

The version of OGGM I use is 1.6.1 and the version of python is 3.10.12. The code I use is as the following. `from oggm import cfg, utils cfg.initialize(logging_level='WARNING') cfg.PARAMS['melt_f'], cfg.PARAMS['ice_density'], cfg.PARAMS['continue_on_error'] cfg.PARAMS['use_multiprocessing'] = True from oggm import workflow cfg.PATHS['working_dir'] = utils.gettempdir(dirname='OGGM-GettingStarted-10m', reset=True) cfg.PATHS['working_dir'] rgi_ids = ["RGI2000-v7.0-G-13-53637" , "RGI2000-v7.0-G-13-53597"]

the pre-processed directories

base_url = 'https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/rgitopo/2023.1/' gdirs = workflow.init_glacier_directories(rgi_ids, from_prepro_level=1, prepro_border=10, prepro_rgi_version='70', prepro_base_url=base_url) type(gdirs), type(gdirs[0]) gdir = gdirs[0] # take Unteraar glacier print('Path to the DEM:', gdir.get_filepath('dem')) from oggm import graphics graphics.plot_domain(gdir, figsize=(6, 5))`

pat-schmitt commented 11 months ago

Hi, the preprocessed directories you are using for RGi7 contain 9 different DEM sources:

For an overview of the different datasets see https://rgitools.readthedocs.io/en/latest/dems.html and the current default DEMs of OGGM are listed here https://docs.oggm.org/en/latest/shop.html#topography-data.

Therefore you need to select one DEM before you can graphics.plot_domain. Here is the code example when selecting NASADEM:

from oggm.shop.rgitopo import select_dem_from_dir

workflow.execute_entity_task(select_dem_from_dir, gdirs,
                             dem_source='NASADEM',
                             keep_dem_folders=False)

After this you can do graphics.plot_domain.

pat-schmitt commented 11 months ago

related this section of the turorials to see which DEMs are available for a specific gdir https://oggm.org/tutorials/stable/notebooks/others/rgitopo_rgi7.html#read-the-dems-and-store-them-all-in-a-dataset