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.7.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 | 4239002ab6f672cf803b9e015a706f0d2c5374aff23baa52709c44d7dbd33fb1 |
|
MD5 | 3f888ae34ee56b45e9e0c4141b609532 |
|
BLAKE2b-256 | 13898c512e938372109920e98ce2e6fcb58c46fe912dd2497ab32cc700fb9ad3 |
Hashes for sardem-0.7.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5a80bc029b43d78c46520e87742a91a02907130e4ba2f87a74c26488751b3d6 |
|
MD5 | 1b91033e383d1edac9a4607632b6c0d3 |
|
BLAKE2b-256 | 3d39825632789d49352fbd2ea9f89c771af2685f87ea096fa2f9796bc8aa0728 |
Hashes for sardem-0.7.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5da9d2e034f4c63fc784418e462bc0fa0dbc6f43a4b3a7478267c3fcef08925 |
|
MD5 | 1656af00084a45b6708cbf55387be862 |
|
BLAKE2b-256 | 761619958a16d56c1370dbbbd00b1fd6c1ac99f18074d1e83045cdbba57b02f6 |
Hashes for sardem-0.7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e365453cbcdac063041944b9f2380b68d481f3cd3903ef0110d64acc763dbe72 |
|
MD5 | 78eedf737f7ddb441b78e4a2814b2954 |
|
BLAKE2b-256 | 99a5d3fe4372b8feda134413d9c3fe048cc19cf49acd4eed998172ff55dd3c65 |
Hashes for sardem-0.7.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd868a11b299494075ee5be1c4d4c99726d3efd980c98381ef914c218d1f32c |
|
MD5 | 1a10794c4d40eb0cd98fa5bf0125fdf5 |
|
BLAKE2b-256 | c98e3d44d8fd21219c7d78b30aa5f9c51610fcfc1b83662d19da2e7edf0569c2 |
Hashes for sardem-0.7.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c9cde4a52ed937fe68bea5a9679fe48d6ed2061ab606a1fb3ce9ef18bfa3a8 |
|
MD5 | b1a0ab2c0d85a0c87f22e602d4fa1f4a |
|
BLAKE2b-256 | 66a2cd12bc8205b1dffa398c2366c7de2d9a8a25e78b5fe1ae8739a7da0fbe82 |
Hashes for sardem-0.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498ebccdd3316fe59a69eeebd499f3399fa7445e0d74e164ae37a432736e96b4 |
|
MD5 | c666d08f65394118cbdc31d49b5d3801 |
|
BLAKE2b-256 | a5d4caa4bc3364dc13ab945acf3cc64473712b25c2d6e638370d164817299d41 |
Hashes for sardem-0.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfde5ef16ab8a660c10a6906c4afec5c14710acb0f76302bf8e7f37d0f01f4ef |
|
MD5 | 83f7a73d15a4a7610e0116526eaf1e50 |
|
BLAKE2b-256 | 4efd60bcb7bcbb465c8a77e072b3a3a6a0a2da7d2c2d0a42e044712e28d709f1 |
Hashes for sardem-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588d037a878c676f0635cae948853e14c882dd8bf9aa5f11b237d9a822e83d84 |
|
MD5 | 44a695795dba2936c9eae3fd60add1c4 |
|
BLAKE2b-256 | 95ed13fa62d632ae56615ede9b24a31e50eb2bbd4b4d37d35449ff0fb5140a7f |
Hashes for sardem-0.7.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b3cb31871584a40160e042d326037ade16758cbb250742472035612459a6b8c |
|
MD5 | 50ece303303f7a73b61c0abd4a05f193 |
|
BLAKE2b-256 | 6bf311244a7c1dc873348ae9f24cd413a3111b5f31cf23a4416ae1c08fb4ec4c |
Hashes for sardem-0.7.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c379d7121bfb01e620dcd261d756ffc22670f7b072f091c9c7073b29aef2e17c |
|
MD5 | 662df53a776d4d7eb41001ed5d86d9ef |
|
BLAKE2b-256 | 5f8e39fda87c47ab275a0155d250b78533cba61045a1b9c0dca0b1dce25864a7 |
Hashes for sardem-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a49a69f4fb26655b957fd40c28863e72aee6c0e63929fc16a5fa053b0fffbde |
|
MD5 | 73da466171a9004115088ec02921c803 |
|
BLAKE2b-256 | 5e52dd085ef76fa4d1db199b20a6802630cf63dbfb5e8f7ee1f4e713c6f143f9 |
Hashes for sardem-0.7.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aba54b5f055e0a889e1cba113e99951d322919fd3f91bd104f0afb972001264f |
|
MD5 | 233d46eceda828821501775a094133af |
|
BLAKE2b-256 | 3a22858dfd30e4295f5adaf85db42bc6079fdcfa4b84b8011ea06e297ebb44e2 |
Hashes for sardem-0.7.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4278a203fe76aeadb541dc0cd7b8efbb4ca5ef75e706ab1c6da63d89fd9399c5 |
|
MD5 | eafd4a341b44ff2a7e1d1a77ff715750 |
|
BLAKE2b-256 | e52818c36e0839362e3b2c793b8e4ef6980432bc80fa1d03fbca0e51daa3d740 |
Hashes for sardem-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08bc8dac6451181aa241f0235b9705ba7919da2362e7ed04fe5a662fdc075239 |
|
MD5 | 528be4635b8a499e2839c0bbd71c5e7b |
|
BLAKE2b-256 | 66000d6ea66b5e82d400172b483e2adcbc1754ecabc8e91ac9954f7378d8609f |
Hashes for sardem-0.7.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46f307b3b7db56a0c1b70568a2b990664bcc48150f8a78b474c8e093f768004 |
|
MD5 | 874a36109f8368b72f86a8f02efabf83 |
|
BLAKE2b-256 | f801388a157b29d0327f860c99b5a278afd6a81afaea8f7b0a3197ccfe058a92 |
Hashes for sardem-0.7.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224bf13b4ac94fd2a2deb870a88914ec18bb6a4c862c2609d4420541c57443ed |
|
MD5 | ff7e7310bbc87993a4210a8ac88498ad |
|
BLAKE2b-256 | 7c52f924b8a38526bac2a6e5ef56cf282fb63299d79996d8ad8920487430f64b |
Hashes for sardem-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d9440fcfae167dd9b11b725cac6b4c8d1ac470ff618a9d8bfd94d5331d87280 |
|
MD5 | 87be34c70a02fad89eecc359bec76117 |
|
BLAKE2b-256 | 5e53eb20a8c85169881506c890ecd390f4929226f2e00a0acdbb67e80273d659 |