@@ -51,8 +51,13 @@ def search_stac_items_planetary_computer(collection, bbox, **kwargs) -> list:
5151
5252
5353@utils ._decorator_dataarray_to_bbox
54- def get_dem_copernicus30 (
55- bbox_WSEN : list , res : int = 30 , epsg = 32643 , smoothing_iters = 2 , smoothing_size = 3
54+ def get_dem_copernicus (
55+ bbox_WSEN : list ,
56+ res : int = 30 ,
57+ epsg = 32643 ,
58+ collection = "cop-dem-glo-30" ,
59+ smoothing_iters = 2 ,
60+ smoothing_size = 3 ,
5661) -> _xr .DataArray :
5762 """
5863 Download DEM data from the STAC catalog (default is COP DEM Global 30m).
@@ -66,6 +71,9 @@ def get_dem_copernicus30(
6671 epsg : int, optional
6772 The EPSG code of the projection of the DEM data. Default is
6873 EPSG:32643 (UTM 43N) for the Pamir region.
74+ collection : str, optional
75+ The STAC collection to search for DEM data. Default is "cop-dem-glo-30".
76+ Also supports "cop-dem-glo-90" for 90m resolution.
6977 smoothing_iters : int, optional
7078 The number of iterations to apply the smoothing filter. Default is 2.
7179 Set to 0 to disable smoothing.
@@ -83,9 +91,9 @@ def get_dem_copernicus30(
8391 check_epsg (epsg )
8492
8593 _logger .info (
86- f"Fetching COP DEM Global data from Planetary Computer (cop-dem-glo-30 @ { res :.2g} )"
94+ f"Fetching COP DEM Global data from Planetary Computer ({ collection } @ { res :.2g} )"
8795 )
88- items = search_stac_items_planetary_computer ("cop-dem-glo-30" , bbox_WSEN )
96+ items = search_stac_items_planetary_computer (collection , bbox_WSEN )
8997 da_dem = _stackstac .stack (
9098 items = items , bounds_latlon = bbox_WSEN , resolution = res , epsg = epsg
9199 )
@@ -96,7 +104,7 @@ def get_dem_copernicus30(
96104 .pipe (drop_coords_without_dim )
97105 .pipe (smooth_data , n_iters = smoothing_iters , kernel_size = smoothing_size )
98106 .rio .write_crs (f"EPSG:{ epsg } " )
99- .rename ("cop_dem_glo_30" )
107+ .rename (collection )
100108 .assign_attrs (
101109 source = items [0 ].links [0 ].href , # collection URL
102110 bbox_request = bbox_WSEN ,
0 commit comments