Create upsampled DEMs for InSAR processing
Project description
DEM creator
Tool for making Digital Elevation Maps (DEMs) in binary data format (16-bit integers, little endian) for use in Interferometric SAR (InSAR) processing
sardem
creates a cropped (and possibly upsampled) digital elevation map:
usage: sardem [-h] [--bbox left bottom right top] [--geojson GEOJSON] [--xrate XRATE] [--yrate YRATE] [--output OUTPUT] [--data-source {NASA,NASA_WATER,AWS}]
[--convert-to-wgs84]
[left_lon] [top_lat] [dlon] [dlat]
Setup and installation
pip install sardem
This creates the command line executable sardem
Alternatively, you can clone to build/install:
git clone https://github.com/scottstanie/sardem
cd sardem
make
which will run pip install --upgrade .
and create the command line script.
If you use virtualenv
# Optional for using virtualenv
virtualenv ~/envs/sardem && source ~/envs/sardem/bin/activate # Or wherever you store your virtual envs
# Or if you have virtualenv wrapper: mkvirtualenv sardem
pip install sardem
Command Line Interface
The full options for the command line tool in sardem/cli.py
can be found using
$ sardem --help
usage: sardem [-h] [--bbox left bottom right top] [--geojson GEOJSON] [--xrate XRATE] [--yrate YRATE] [--output OUTPUT] [--data-source {NASA,NASA_WATER,AWS}]
[--convert-to-wgs84]
[left_lon] [top_lat] [dlon] [dlat]
Stiches SRTM .hgt files to make (upsampled) DEM
Pick a lat/lon bounding box for a DEM, and it will download
the necessary SRTM1 tiles, stitch together, then upsample.
Usage Examples:
sardem --bbox -156 18.8 -154.7 20.3 # bounding box: left bottom right top
sardem -156.0 20.2 1 2 --xrate 2 --yrate 2 # Makes a box 1 degree wide, 2 deg high
sardem --geojson dem_area.geojson -x 11 -y 3
sardem -156.0 20.2 0.5 0.5 -r 10 --data-source NASA_WATER -o my_watermask.wbd # Water mask
Default out is elevation.dem for the final upsampled DEM.
Also creates elevation.dem.rsc with start lat/lon, stride, and other info.
positional arguments:
left_lon Left (western) most longitude of DEM box (degrees, west=negative)
top_lat Top (northern) most latitude of DEM box (degrees)
dlon Width of DEM box (degrees)
dlat Height of DEM box (degrees)
optional arguments:
-h, --help show this help message and exit
--bbox left bottom right top
Bounding box of area of interest (e.g. --bbox -106.1 30.1 -103.1 33.1 ).
--geojson GEOJSON, -g GEOJSON
Alternate to corner/dlon/dlat box specification:
File containing the geojson object for DEM bounds
--xrate XRATE, -x XRATE
Rate in x dir to upsample DEM (default=1, no upsampling)
--yrate YRATE, -y YRATE
Rate in y dir to upsample DEM (default=1, no upsampling)
--output OUTPUT, -o OUTPUT
Name of output dem file (default=elevation.dem for DEM, watermask.wbd for water mask)
--data-source {NASA,NASA_WATER,AWS}, -d {NASA,NASA_WATER,AWS}
Source of SRTM data (default NASA). See README for more.
--convert-to-wgs84, -c
Convert the DEM heights from geoid heights above EGM96 to heights above WGS84 ellipsoid
The code used for bilinear interpolation in the upsampling routine is in cython/upsample.c
, and is wrapped in cython to allow easier installation and ability to call the function from Python.
The installation is handled through pip install
, or by running make build
.
Functions for working with digital elevation maps (DEMs) are mostly contained in the Downloader
and Stitcher
classes within sardem/dem.py
and sardem/download.py
.
NASA SRTM Data access
The default datasource is NASA's SRTM version 3 global 1 degree data. See https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3s_v003 . The data is valid outside of artic regions (-60 to 60 degrees latitude), and is zeros over open ocean.
This data requires a username and password from here: https://urs.earthdata.nasa.gov/users/new
You will be prompted for a username and password when running with NASA data. It will save into your ~/.netrc file for future use, which means you will not have to enter a username and password any subsequent times. The entry will look like this:
machine urs.earthdata.nasa.gov
login USERNAME
password PASSWORD
If you want to avoid this entirely, you can use Mapzen's data hosted on AWS by specifying
sardem 156.0 20.0 .5 0.5 --data-source AWS
--data-source NASA
is the default.
Mapzen combines SRTM data with other sources, so the .hgt files will be slightly different (but often not noticeable)
Warning: Mapzen notes that they are discontinuing some services, which is why NASA is the default.
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 Distributions
Hashes for sardem-0.6.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12a0caeeea17cf501da0ef971d64d018aa72c5eea1520dd06e51fec6d6c4adb6 |
|
MD5 | 5a333ed0aa66e4f54cf2450e4dbf806a |
|
BLAKE2b-256 | 8f910cf2afc0c51ed3a0d39e6ac042a57aaacc50531aaa20aa6c93af1ecfc222 |
Hashes for sardem-0.6.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e282737ab7c1d9e3810d01498e837d3fea96eb537e4620f8146f036f755d3d55 |
|
MD5 | b41b0255fbbd5c7e3c27290738998a0c |
|
BLAKE2b-256 | 5b0612a0349f3d7da5241ca8e31cdb18dab3def1911e2a83f1281a23b4387f67 |
Hashes for sardem-0.6.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef47f12f84ad192b10d8c619087fdbc63e824a9261fe4ca5cf19d70a3eb337c9 |
|
MD5 | 7932153993bb38033bd5a86646389989 |
|
BLAKE2b-256 | 8903f3f72e214229bd1f78fc5315e2ab34f3bd0a56326bd680cdcefcf073f83d |
Hashes for sardem-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afee2cb86a37f8cbb50cb8def99a536d1dd3b53fcd6fed7cd8c721f2b69d5aca |
|
MD5 | abb397626d4301249e18d028b9b6efd9 |
|
BLAKE2b-256 | 803acf4b9568a475f5fa0d17bef18e120bd952d4b376e975c9be1174ff2752c9 |
Hashes for sardem-0.6.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f939f4a77f2e17f8092fa011e4e1c84c71b4d72aaca5ad940d30507c499c98 |
|
MD5 | eae470ce039af897a92766bff3e769c8 |
|
BLAKE2b-256 | bfc0546bf2c7617d12b64463b8efaa454bb142d64697d0d69178af295afefc71 |
Hashes for sardem-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4914b4079a6589ffb4a5962f1673fb985bc8b7e1b32266f6557a3d32db250f33 |
|
MD5 | 3894779aba2472ba1f8e4aeed6b66466 |
|
BLAKE2b-256 | cd10ad9942cbb0043c72bd9ee0b5e7c647ffac3ec36c58a971946c865758a11b |
Hashes for sardem-0.6.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b2de1fac165132efd29277437b6c41256c175ec6b4661e021bf2c52d8a08e6 |
|
MD5 | d8e9eea18c62f3c4564f5e8d6558fd39 |
|
BLAKE2b-256 | a030d2e10034bff8a58c78998d152686cfff49f48f823745cda5181098e6855b |
Hashes for sardem-0.6.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d855686323d064e5ce2d6846dd8cdc5c7c43518e6915f2cc94da26285e1f8c23 |
|
MD5 | 996aac53fb9aea4272080b903e155a92 |
|
BLAKE2b-256 | 06f5841acc9b196cbb59cc0d22a60a3a03ccc95d4ef202ce2d678d377945d83e |
Hashes for sardem-0.6.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 308e1056f59150270426a9d511dfc1d08eca6c4a1b1d6df20b7e16fbde035a74 |
|
MD5 | 93b2303a0e89ad506d6660dd0ff936f9 |
|
BLAKE2b-256 | c72ba327f8348806842caffee615fec78644197d0cd515a6c16e072f1e8ee6ee |
Hashes for sardem-0.6.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6a3c1c772d6feea093a79e9da571666a30c97e6afdc0efbb3f5011b929a53ba |
|
MD5 | f136f2a3d3d54963991451d0b2fe02b0 |
|
BLAKE2b-256 | 3c647bdb769edf14726872fa318f224a99ce77c947f31132402898aad1c04538 |
Hashes for sardem-0.6.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c8f4193e0b3750b0027601aae9dc2e1a0486078e8e058b801c2f84cabfb3033 |
|
MD5 | 5fae7e8e7e28656455ed8bf1ac15b970 |
|
BLAKE2b-256 | d6af23d8c61b46c5db0b886f4ce6030f9885788a9b6084a61cd201d9655ee0e5 |
Hashes for sardem-0.6.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d42b21016e8bcdc716c71f92cd6617a9f292263b86c8e6c0fc29d6fbbc9cfa9 |
|
MD5 | e25c55229590213b78d4fb45286b73e2 |
|
BLAKE2b-256 | 1f3725799065dc1cdf78e87c9b4d70ce8c8106a4f15324d8284adb21032453ea |
Hashes for sardem-0.6.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 764ad7bdc6b03c481f26b2d326360889166a1e6162f9befeaba77d17091ce998 |
|
MD5 | d6f13f13f8f2aa155401cc29baa5e765 |
|
BLAKE2b-256 | b2276e4f36db81f6f4f6762c40c6775444a3d2c334a80ed2cfd2af9fef9f7fea |
Hashes for sardem-0.6.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff91260f6037c8baa4e135c84065df43b720a5a2e1784835c60cc4a803c6f81b |
|
MD5 | 525301ebcd5ed56c0a99a4e7f0afbfec |
|
BLAKE2b-256 | 21c2a24d84650ffba9903fd6df97e38a4fc579d083eb1623319e28da6864495f |
Hashes for sardem-0.6.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a95d48847b051e9d760e136424d78ff911c67e427737486a63cb2d495f6327a8 |
|
MD5 | 33ebf81408c86966e360b8b205389d5f |
|
BLAKE2b-256 | bfb0e36e6e7422503f3974805910e3a86f1e2eeb95ebdd086989d185b03a567d |
Hashes for sardem-0.6.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b04c187075d05b30ddd7ce8c426a074cb1bc8ffb37eeb8e485068e733abd02c |
|
MD5 | 4e4cc939023195d1c6c5e7445e00d75c |
|
BLAKE2b-256 | ae968fd1d57bdd1248952fa9bfa5c777d0fbedeff7fe9b41ca55aa6005cb0797 |
Hashes for sardem-0.6.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4b572193888a7625c54c022a17c1c06907457405e1114153b810f501a6a62b8 |
|
MD5 | a2509385344f1687ac6dee8c695fda0c |
|
BLAKE2b-256 | 6ddf9f57dbe76adeec41ac9bae33cf970364e00eada31ff118185cb5728435bc |
Hashes for sardem-0.6.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50370cefcb1dba054714b315683c85dc5643c3aaed0719e820399f8568666c6f |
|
MD5 | 4ac70aefe966aa9239464111495b16b1 |
|
BLAKE2b-256 | 426c0881d403c5f9faed09c63e3780730c903cd2a8787c493a25f3c9f50be160 |