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.10.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 | 8bb80e1b306757d9bbe93c0967e079297a52784942f0d6b32607ed05abd64930 |
|
MD5 | d6fd164d52f0c1cea24b92840ebc6d69 |
|
BLAKE2b-256 | 54a7239e5278ea0b7a623d1051fa7134a3d69763d3f1cb8eda4f725b4b764d0f |
Hashes for sardem-0.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8decafd6012d0a1b1d415c0aca356f55e256fb4ff219a27b5aae207390cc112 |
|
MD5 | 09a0ab7eae7d7baed1adecef5d9c0193 |
|
BLAKE2b-256 | 34b76038bf49e55feb943e015ea2e34f225ffb7f858bf00fdd2047965c3fc744 |
Hashes for sardem-0.10.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb28c65331118d8ae4e9ccca06b838d73cdc9074945bc5671e29cc30223b953 |
|
MD5 | 96319a6cfa097517ddaf7e0cf4a8c08f |
|
BLAKE2b-256 | a2ae869e1cb07f15c62e08dd508ba0a0ad24c9fbe9bf4184a80670f36ea55556 |
Hashes for sardem-0.10.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07745806ef40190db40abd07c691b96d2b828f0587ba08e3b70fb948423c8f20 |
|
MD5 | 90e4a72becbe29ede4f4f81fe7954849 |
|
BLAKE2b-256 | b625798c60f30ec4a48e43e50af7faeb4a379549c8f7eb10637c9c7e9fe20c8c |
Hashes for sardem-0.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29baebd9ba31438257f8e1cc2d0298ef1ff46b5313b629acc6e5108273499261 |
|
MD5 | 81d8064f9ff8c265d129ba6a930d5a1f |
|
BLAKE2b-256 | e18fab3d8f8746b1ef1846bdc99648666b3ed105cae1688c9e97bf3202bf8bf2 |
Hashes for sardem-0.10.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad372a253827600c16c5c53c02489a60e7120440ae3c2d9ffbc47c67e415fd60 |
|
MD5 | 90b7a51c906e07c1637622323f1bd6f2 |
|
BLAKE2b-256 | a3569a84d98969e4eb93cb983048e394b7705cfdf403cd54ea47af28f4e9b60d |
Hashes for sardem-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e576781f1eac24d2ff5eb6a27f7cd6ee141737519633db6ed675cb4cadc26ae1 |
|
MD5 | 5dfa26d62dd7b8c9837583b16e67400c |
|
BLAKE2b-256 | d262bb1792650b0587cc5dc7c5fb62cfab9a7df42a5a130659e3f00b6db182b4 |
Hashes for sardem-0.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24d808942821288b448bdf949f469bad1b25dfecc06ff6f0cf2ed8cacc78874d |
|
MD5 | 94f81fdeeaa118717246e6250d3074e8 |
|
BLAKE2b-256 | ecf2d004d305057a56c24d7c96a51487322475ef1b020b1ad29ff123f0098486 |
Hashes for sardem-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb9d32a374cfc89085f76d94eb2285ab875d506fbc5316d7c698212e47219dac |
|
MD5 | e3430e767ec05b2a9ab78a40db006153 |
|
BLAKE2b-256 | d19249a05891f556940075041be1d09a07cf0e32f13d7b478255c38936cbdcae |
Hashes for sardem-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1013771bbe87a639f767db17a2a2d9e69b31d69339dea750c210d800a9dde580 |
|
MD5 | 207d5969ea498f85256db22783af8d6f |
|
BLAKE2b-256 | eb852eee9d041da7552797881849c699b0fde6540edb560704350710ee02afa2 |
Hashes for sardem-0.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698e0d5d241096bf444a24ad721f51964675ebd34f53c8d70a20c1058e68c6ef |
|
MD5 | dfb1ffaa6ebb32363da2318cd886cc70 |
|
BLAKE2b-256 | 96ac6a18ea361b02c015d67e39e6a380f9f9664c1a67dbb013954d399c3eeb72 |
Hashes for sardem-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ab05a5d54123fa7f495465f668698176a1d1bf98e9152b61682eb7ca5efce3 |
|
MD5 | 17d7f9f2f98af4c84b4676cf96d8930e |
|
BLAKE2b-256 | ba3fed8749a0689558b45c7a7401694113a097b8e4747ac09832b54dfbf88391 |
Hashes for sardem-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 180eca4404cab8f6e54f454eadbbb5fa5cbc6aafd4d712f0e1946bfd24c82623 |
|
MD5 | 337f3b71e16f517af6750bd53a7c00f4 |
|
BLAKE2b-256 | 825168b8342f748006ed22d2dda3ff985373fdab2ac88aa33b1f2bb0721ccef0 |
Hashes for sardem-0.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9a71048346f14c8719bc2ac94aa612342c3424d050f8bebefaf836cce29654d |
|
MD5 | 7b10ed691d2610157cf532854b411065 |
|
BLAKE2b-256 | d22f6de1f91f3e73deb213316c3cc8b62c6d9407cef9ef6a6a049f37cea9e698 |
Hashes for sardem-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 738fdf4d32d732f501fb6d2b1ddcf36d8e6c86bf1bf90c9161d920658ef2a8c3 |
|
MD5 | b74a138f8960f1018bd5b39ac6076a4b |
|
BLAKE2b-256 | 6f26c53f5074d26d0c70ec987bce3e38b8a82e8d855aaf2c4990d08cc04e159b |
Hashes for sardem-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 566c90a516af3cfeecf6ba0749b8fa8ae594aa3391d9dc13e37ef9ca11ca5b29 |
|
MD5 | a21cf2fbd1bc4c87c26b80b8d3f122c2 |
|
BLAKE2b-256 | 6458652091d51fc0658e2c700cab7fe99c99c51b2f3975e44658785175fc6e74 |
Hashes for sardem-0.10.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7109c2bb1fd04c5ce78a88d721b5f343774e0e45efe3e062ae32a3e9b471025 |
|
MD5 | 0746bc8fc74735beba063c92e3d074fd |
|
BLAKE2b-256 | c06e8091fa856c7b07817592b509da06d29189bb88c7e57e991507c2f166bebc |
Hashes for sardem-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410221dd5a74a60bb58989e62feaa3e936f80056b8ff91faf72825b87ef8495f |
|
MD5 | 0db6f4be849c02d2e3cd9614fcaf17ec |
|
BLAKE2b-256 | 73606248d582de67bad4c6d3a4056d15bae598bb7a8e900fa2495d61150469da |