Download and merge DEM tiles for processing interferograms with ISCE2.
Project description
dem-stitcher
This tool aims to (a) provide a continuous raster of Digital Elevation Raster over an area of interest and (b) perform some standard transformations for processing. Such transformations include:
- converting the vertical datum from a reference geoid to the WGS84 ellipsoidal
- ensuring a coordinate reference system centered at either the upper-left corner (
Area
tag) or center of the pixel (Point
tag).
We utilize the GIS formats from rasterio
. This tool was developed to support cloud SAR processing using ISCE2 and various research. The early work of this repository was done by Charlie Marshak, David Bekaert, Michael Denbina, and Marc Simard.
The API can be summarized as
bounds = [-119.085, 33.402, -118.984, 35.435]
X, p = stitch_dem(bounds,
dem_name='glo_30',
dst_ellipsoidal_height=False,
dst_area_or_point='Area')
# X is an m x n numpy array
# p is a dictionary (or a rasterio profile) including relevant GIS metadata
To save the DEM, would then be:
with rasterio.open('dem.tif', 'w', **p) as ds:
ds.write(X, 1)
Installation with pip
Install dem stitcher: pip install dem-stitcher
For Development
- Clone this repo
git clone https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher.git
- Navigate with your terminal to the repo.
- Create a new environment and install requirements using
conda env update -f environment.yml
- Install the package from cloned repo using
pip install -e .
Credentials
The accessing of NASADEM and SRTM require earthdata login credentials to be put into the ~/.netrc
file. If these are not present, the stitcher will
fail with BadZipFile Error
as the request is made behind the secnes with rasterio
. Specifically,
machine urs.earthdata.nasa.gov
login <username>
password <password>
Notebooks
We have notebooks to demonstrate common usage:
- Basic Demo
- Comparing DEMs
- Staging a DEM for ISCE2 - this notebook requires the installation of a few extra libraries including ISCE2 via
conda-forge
We also demonstrate how the tiles used to organize the urls for the DEMs were generated for this tool were generated in this notebook.
DEMs
The DEMs that can currently be used with this tool are:
In [1]: from dem_stitcher.datasets import DATASETS; DATASETS
Out[1]: ['srtm_v3', 'nasadem', 'glo_30', '3dep', 'ned1']
glo-30
: Copernicus GLO-30 DEM 30 meter [link]- The USGS DEMSs:
srtm_v3
: SRTM v3 [link]nasadem
: Nasadem [link]
Transformations
- All DEMs are resampled to
epsg:4326
(most DEMs are in this CRS) - All DEMs are resampled to match the bounds specified and align with the original DEM pixels
- Rasters can be transformed into reference system either referring to upper-left corners of pixels or their centers (i.e.
Point
andArea
tags ingdal
, respectively, and seen as{'AREA_OR_POINT: 'Point'}
. Note thatArea
is the default pixel reference forgdal
as indicated here. Some helpful resources about this book-keeping are below.- SRTM v3 and TDX are Pixel-centered, i.e.
{'AREA_OR_POINT: 'Point'}
. - The USGS DEMs are not, i.e.
{'AREA_OR_POINT: 'Area'}
.
- SRTM v3 and TDX are Pixel-centered, i.e.
- Transform geoid heights to WGS84 Ellipsoidal height. This is done using the rasters here. We generally resample the geoids and into the DEM reference frame before adjusting the vertical datum.
Testing
- Install
pytest
. - Run pytest.
There are automatic github actions that run the said tests as well. Many more tests are still needed.
Contributing
- Create an GitHub issue ticket desrcribing what changes you need (e.g. issue-1)
- Fork this repo
- Make your modifications in your own fork
- Make a pull-request in this repo with the code in your fork and tag the repo owner / largest contributor as a reviewer
Support
Create an issue ticket.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dem_stitcher-1.0.0.tar.gz
.
File metadata
- Download URL: dem_stitcher-1.0.0.tar.gz
- Upload date:
- Size: 25.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6fd429fd3237479187afd754555c4b618d7e0d7835fa73bb4d6685567ced68c |
|
MD5 | f69f0073cf426f063b9d6c98ddde64a8 |
|
BLAKE2b-256 | 2bc6ee0ba0f2ae979dda289df1b9f05816173af12b357945ad66f3fdd574e7d0 |
File details
Details for the file dem_stitcher-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: dem_stitcher-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19390cebc714a92a87882e6ddc7c6804caaf636c88a8fee72ead86700f106d9b |
|
MD5 | 79e93a5f2eaf83c3f050bd4b7484eca4 |
|
BLAKE2b-256 | afaed0659caa0b1bfcf9d15a69a20ec99cf7c36a7b1ddba8959a248633844be2 |