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.8.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 | 284e5f80befac3a936a2432c1d3121b877c48a9c183709fa1b07e44953358018 |
|
MD5 | 123a9145823dc514f45021af1182bd26 |
|
BLAKE2b-256 | 53b51beb547589143d55cdb9d904e4689418e05ff79d33223bfdebe9e85f9f29 |
Hashes for sardem-0.8.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfe7fe0402cfc0c26bf528111f9cbb8d07dfa7b262f3a0c37ed494763cdb5cc9 |
|
MD5 | 534f737ba4c3457ffe9b614aa655ad38 |
|
BLAKE2b-256 | aa7ca9dcc085b2b492428a5fcacefa49871de2b5ae2d67d8c71a1e83d402f558 |
Hashes for sardem-0.8.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f57bcf0b246ccb278232815f0d24fcfd2f362edb0cc05dd2103ed596ec4ad29 |
|
MD5 | a1d164bf81c5d2ab7f60152e4b483000 |
|
BLAKE2b-256 | fb4156c37a2a8365ac33879cc8d4bd649f3e3844723113a6b730185128e33a19 |
Hashes for sardem-0.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e48bfd4f646004abbad8827905d346f53d091fd572a6888327774a86486c2e1 |
|
MD5 | b786fb5aa8cc7e3fd695954adbfc0102 |
|
BLAKE2b-256 | 88d97716ba87acaeca6b4f7980109be4ca3d86feb29ed019d6957554b616b247 |
Hashes for sardem-0.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5882a5357be3f67bb4e78272a51b59fe201d97f4a7ce045ae48e2217e187ce90 |
|
MD5 | 46eae61f13cf5d36cbf77eb034eb4c79 |
|
BLAKE2b-256 | a84dfc0c91b423317586ac3cf030398f61fd96907087af0166da1e9055997a46 |
Hashes for sardem-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5f8c270cc95ccc65866ab6c192bdc3816bd16f6eb4be3114ad5e0b05e9a382 |
|
MD5 | 98159bb60c427d4367b40b5c0466ef49 |
|
BLAKE2b-256 | 4726e50852274f041d0a6962d89f81284e65f8458b87bbf1d581a55bee156296 |
Hashes for sardem-0.8.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8137219ee854f1f28fc43bd5b36a2af6af970d88d412a28ebba9e61c9fff159 |
|
MD5 | 3755c4c61af5900c57f79af31d46ae5f |
|
BLAKE2b-256 | 0c602116fadc81d6c1b6e429826c0180a99c8f5d88e30f49f5fd9da51988725a |
Hashes for sardem-0.8.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28399c6a8af4d70ba2e59ade38894274d0d8e8c73a0810f6d76f9a62b9fdcec1 |
|
MD5 | 22b83341369da10a3b9de57b4d1787e8 |
|
BLAKE2b-256 | 26e2f5ab702e065331a533725f9d02919075d2d96461dabc2ff3bf65afcf6d16 |
Hashes for sardem-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48303bfa740f2e749416a825697cd6aa3e29a04ac502618e7b13d25c3874cb5 |
|
MD5 | 28804d677ada9f1d5670474098c7bfb8 |
|
BLAKE2b-256 | 5f822cea435a0907ee63289db8811c9ec504d549e8e403f979f431098c115cb4 |
Hashes for sardem-0.8.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a252c480d9cf4013a8f5d57aa41c44ab0121053aab98cc5d6093b0c1da03cd2d |
|
MD5 | 3a4ac74b03d4fe58a658b8ec44087cd1 |
|
BLAKE2b-256 | 142158b74084136d6dcf8f09ba1045f62c1600586b748a4f10cfb351c6476856 |
Hashes for sardem-0.8.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a61774123394b8c02d64050d905804e4ef35c7a9caffccd8bf413c45f5b95e9 |
|
MD5 | 1a6455804b2ef04f8eca34a2df7dab66 |
|
BLAKE2b-256 | f0833ac2a44d0acd932e5beafbf61818f8a6fbb47b006eaba94bee748344523d |
Hashes for sardem-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1589bd3c8f184f0e73f410c3a8cac3435b1f434c16a0b8247910cf1fbc7d77e |
|
MD5 | dc9cd1c633573caec5fa2b6c502088f0 |
|
BLAKE2b-256 | 662182c76e7c821dece618ddf28a351a2e04a92a6a87bf062fc09c5cd30965a3 |
Hashes for sardem-0.8.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf80ddffc71d70e341a92c710d0bcbbb414c5a2f57d4334dafc981e436872d2 |
|
MD5 | 0f11b038d35668db336e99133500746b |
|
BLAKE2b-256 | 69757f4c75576cea905ccb609b4fd986e42eca6c1d837110a06149c655dc8744 |
Hashes for sardem-0.8.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f42507872a2d496ba51e1b2088c0e4b5e7a5ca4a21fae6abb5235567aaa4b8 |
|
MD5 | 71765d4b037a6b3da52fa10f0f8e49ac |
|
BLAKE2b-256 | 279e136dfac5b10e3fcd201103d738589a478288d399ab8b99df670167426839 |
Hashes for sardem-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0820ec4602681ad279ce85bc9d4a64f1326f09eee28f1f4b7cb6862a851be5d |
|
MD5 | c6d3a5f477cf5a139219028a1282f78d |
|
BLAKE2b-256 | 50223b1d6fbb842e14ee1562177c9802baaa1afa92a27989bc9b3e6ef729ab2b |
Hashes for sardem-0.8.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac3ca666ac7301e6c1d876155f230c753600b24ebbb759db6bb088435b66f75 |
|
MD5 | 39bb54fe101a947a0b54cf0d309e8505 |
|
BLAKE2b-256 | 0c5a9e9560571b57d5276f341cd98fe607132da0f04a4b0742e7dca867702180 |
Hashes for sardem-0.8.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de0137796b32181c0e54d7df6f19da8f9ba46f8ab127f26783fe8d663b2ca6d3 |
|
MD5 | d5cd1f718a4126f50031c8181b9997f1 |
|
BLAKE2b-256 | fa238da91d56b267e57354293f9ecaa4dd9a792dc92fce143c1f03c95ea17e20 |
Hashes for sardem-0.8.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cb1776ac8d8f9354b87e17a896f0070db837eb4a1775a791f65ea6ca0e73650 |
|
MD5 | a0a72350be6dc2891079a241430bdfe1 |
|
BLAKE2b-256 | 4cb6e7c8b821e1f968fdf04137e6f1c7a3500c63f6ff3fc9d1ee35f3d4b9c092 |