You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe of interest: cubo can get Cop GLO 30 from Planetary Computer, but I don't know if that requires an access token.
The export is in UTM coordinates by default.
importosimportcubofromrasterio.enumsimportResamplingdefload_dem_data(dem_path, lat, lon, edge_size, resolution):
ifnotos.path.exists(dem_path):
print('Downloading DEM')
dem=cubo.create(
lat=lat, # Central latitude of the cubelon=lon, # Central longitude of the cubecollection="cop-dem-glo-30", # Name of the STAC collection# bands=["B02","B03","B04"],bands=["data"], # Bands to retrievestart_date="2000-01-01", # Start date of the cubeend_date="2024-01-06", # End date of the cubeedge_size=edge_size, # Edge size of the cube (px)resolution=resolution, # Pixel size of the cube (m)stackstac_kw={'resampling': Resampling.cubic}, # kwargs passed to stackstac
)
if"time"indem.dims:
dem=dem.mean(dim='time')
dem.rio.write_crs(dem.epsg.values, inplace=True)
dem.isel(band=0).rio.to_raster(dem_path)
else:
print('DEM exists')
Thanks @MarkusZehner. Using cubo for this would be overkill in pyroSAR but it is good to know how others do it and what other sources exist. As long as there are authentication-free sources I prefer sticking to them though.
The data can now be downloaded from Copernicus without authentication:
https://sentinel.esa.int/web/sentinel/-/copernicus-dem-new-direct-data-download-access
This option should be added to function pyroSAR.auxdata.dem_autoload.
The text was updated successfully, but these errors were encountered: