Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dongdong001122 opened this issue Sep 27, 2023 · 4 comments
Open

Comments

@Dongdong001122
Copy link

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
Copy link
Collaborator

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
Copy link
Author

Dongdong001122 commented Sep 28, 2023

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
Copy link
Member

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

  • ASTER
  • AW3D30
  • COPDEM30
  • COPDEM90
  • DEM3
  • MAPZEN
  • NASADEM
  • SRTM
  • TANDEM.

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants