-
Notifications
You must be signed in to change notification settings - Fork 110
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
new Copernicus DEM download option #239
Labels
Comments
Maybe of interest: cubo can get Cop GLO 30 from Planetary Computer, but I don't know if that requires an access token. import os
import cubo
from rasterio.enums import Resampling
def load_dem_data(dem_path, lat, lon, edge_size, resolution):
if not os.path.exists(dem_path):
print('Downloading DEM')
dem = cubo.create(
lat=lat, # Central latitude of the cube
lon=lon, # Central longitude of the cube
collection="cop-dem-glo-30", # Name of the STAC collection
# bands=["B02","B03","B04"],
bands=["data"], # Bands to retrieve
start_date="2000-01-01", # Start date of the cube
end_date="2024-01-06", # End date of the cube
edge_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" in dem.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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: