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.9.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0538b406641b1ecc62fb8eff9ce60b4715cf56681becbde00dc0788b86b93243 |
|
MD5 | de894174ebd5af9b2e8bc72101f97cc6 |
|
BLAKE2b-256 | c17b84477e4734ef983bd85f59eebbf6e7e71a2bada735ba4a8709b7d0736fc7 |
Hashes for sardem-0.9.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bafae59aa278ba4e3bbf4ea8eb0f987d18b1c3ad709c9f4e93189019183f0ccc |
|
MD5 | edfe86d50a73f545fa35282f86b126cc |
|
BLAKE2b-256 | 54ad47fc988d7f929861b9ba4940de58e437321953125aa2ecb5883016309efa |
Hashes for sardem-0.9.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b56608f5d7ef043a3f163149e63e60044b647ab0cdc2f8e11aec7f41ff4235d6 |
|
MD5 | df6d1be477dee2b8f434341ad661430e |
|
BLAKE2b-256 | 489a6762e1c3c9983243e7659ecedd8aa2e0c383f75e20f2f01b24ca8dc78130 |
Hashes for sardem-0.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e127e6ea7c4c296cd484791bc85b6adbca5c6be39abbbec7f23cef85e690800e |
|
MD5 | 3e1ef8efc6d3942a561b79709dac94a1 |
|
BLAKE2b-256 | b62a25f9fb4a6a97d0a85fbc8c0f6e515c12179c3b3983370069eca062eb7122 |
Hashes for sardem-0.9.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7b33db71a9ab06eee50ae071b0bade7bd1bc344087cd5656ef3e8bb1ec1529 |
|
MD5 | 7eae3ef78e8941619057f02f2557b1dc |
|
BLAKE2b-256 | 2cb7551fcd0e0e38353c5d9ed65c840913e437921d88b926c2c37499243bc022 |
Hashes for sardem-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8a2f4858fa4af11954050c35e1bc20e15be11583f53e8f29c46355916f7a91 |
|
MD5 | 0f4582b7b41c13721e7431a6a6e2828c |
|
BLAKE2b-256 | 99d56508b1e53bc96a34ee9f7552c1bbb4c34becc9c5fda432ae103a35b247da |
Hashes for sardem-0.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98464f26164943da59f950c17b4ee18a671c3f3b6d42e8fa2a049ea496f59930 |
|
MD5 | d208acba08c64bef09bf176fc0ee6525 |
|
BLAKE2b-256 | a6eebc3a86b736b62ba53e56e1721bb6cd969e14228af1e8b3e2ec0a2215b1f4 |
Hashes for sardem-0.9.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2c6b2601120e860ba3e6bfe4a52588647d19ffdbc9e910d85bc970cb9fb71d2 |
|
MD5 | a5fe74909fb1d45d5210a64a7a264305 |
|
BLAKE2b-256 | 5e4971f2f978322cbda492ff51502b64ec4ef2eb2271c7d0d71d8ce65c3e48f3 |
Hashes for sardem-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6622e9137e2c23fa196ed2db88691f42ca30c2f5bd74e5d19d87bb3a9d8890a2 |
|
MD5 | 464c6024626cffcd1f4d728ddf97d743 |
|
BLAKE2b-256 | 176fc867c8641999814bce3ec049073702a9984ded7d415a06a878910852a40d |
Hashes for sardem-0.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b06cb261c36fd001b88703407dbcbd75d2901f6eb8ac4ef806aca79e97ce3faa |
|
MD5 | c728b636c8c3d75458a5b26d8afce58f |
|
BLAKE2b-256 | 0fd080e2d61a855c6d53b9d2d8fc6af9195827fe2e75db1165b94cd9828a2542 |
Hashes for sardem-0.9.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9747c9cb4cc6b92c641ea24d110022b84adc397bdee94aa53edc96d6204174bd |
|
MD5 | b99594f1a649f7e2b50e9662084ba8b3 |
|
BLAKE2b-256 | 4a38027702757ffabc5bcbf05ff9a1be1049adac4b9e703ba04f33c89a27ec5d |
Hashes for sardem-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8569e9769a60eba36c853fa34c7c9acf6b6342cfb2f2d8028676f42b9814a6 |
|
MD5 | fd97ade400a966059590821d8dc64dc4 |
|
BLAKE2b-256 | f53e982973b425e00b4549d292e8f17c6de2874f681b96a6aad90553a7eeb177 |
Hashes for sardem-0.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 379bf84e275a9ff0a6b246c13dc7c97b6df1cb8006dfa7d53abaad5f71e97598 |
|
MD5 | 2f1695d4527ab5fe84ecee1df9ea61cc |
|
BLAKE2b-256 | d852d78608d1a38fc5ddea0d5bc8d4fa1b0003ff7a53028d0c11c72edb0c75b7 |
Hashes for sardem-0.9.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8206d60ad5fdbc14180f0418529ad9315d0319d771fafd60bd58a4e4f00ac073 |
|
MD5 | fc56c31805b6a4858e37f132435ae667 |
|
BLAKE2b-256 | 7f2103b95e1dfcf63ed462eec2501c2f0039d88cacd5c55ad7e87dfea201e146 |
Hashes for sardem-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a846e8ee33a7292410b40e8441c0577eeed66cdaefc30c134d856bcd9e6ef337 |
|
MD5 | 17b8c2d67a6c2c22cacb84d699af2520 |
|
BLAKE2b-256 | 3a23e58738c7a3d1c30eb0e726e6ff23295b66796bcfe0f3d64c301c33e64d58 |
Hashes for sardem-0.9.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c0121d5457561a62789d90493c73ae9147ff321906aa9241e2d5177ccaa88d0 |
|
MD5 | 3a5aefe03e7256de589122d8b9c1cd3e |
|
BLAKE2b-256 | 9d968e8c0b0e3b403d4f4ae1361aa6fb47f14dc257e3d8eccea4e10c6b42e915 |
Hashes for sardem-0.9.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6794f6cc937458f170e3b774dbfdade853343d3590104297847cccd20062e49 |
|
MD5 | e7b7399bd6597b050b79649800bc7f75 |
|
BLAKE2b-256 | 8638f86131c4991e9654dfdfdfc511c0b6fea8da5d9a1a9218e064048f114592 |
Hashes for sardem-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ead4431d54c86afbdf9b2a46a9080617d8485e8f91b2b9f9c4df617c4f9c11c2 |
|
MD5 | a3d761548831ea344b9e4f277f5ed36d |
|
BLAKE2b-256 | 59df90c0d3b9be80b9cf12a6b357d1cae010ae628761783c8b70b2c40f98c132 |