Skip to content

Commit

Permalink
add isce example to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Aug 10, 2022
1 parent 70e7df7 commit c3dcf9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
9 changes: 6 additions & 3 deletions sardem/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def positive_small_int(argstring):
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
sardem --bbox -156 18.8 -154.7 20.3 --data-source COP # Copernicus DEM
sardem --geojson dem_area.geojson -x 11 -y 3 # Use geojson file to define area
sardem --bbox -156 18.8 -154.7 20.3 --data-source NASA_WATER -o my_watermask.wbd # Water mask
sardem --bbox -156 18.8 -154.7 20.3 --data COP -isce # Generate .isce XML files as well
Default out is elevation.dem for the final upsampled DEM.
Also creates elevation.dem.rsc with start lat/lon, stride, and other info."""
Expand Down Expand Up @@ -107,7 +110,7 @@ def get_cli_args():
choices=Downloader.VALID_SOURCES,
type=str.upper,
default="NASA",
help="Source of SRTM data (default %(default)s). See README for more.",
help="Source of DEM data (default %(default)s). See README for more.",
)
parser.add_argument(
"-isce",
Expand Down
15 changes: 8 additions & 7 deletions sardem/cop_dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ def download_and_stitch(

gdal.UseExceptions()
geoid = "egm08"
if download_vrt:
cache_dir = utils.get_cache_dir()
vrt_filename = os.path.join(cache_dir, "copernicus_GLO_30_dem.vrt")
if not os.path.exists(vrt_filename):
make_cop_vrt(vrt_filename)
else:
vrt_filename = "/vsicurl/https://raw.githubusercontent.com/scottstanie/sardem/master/sardem/data/copernicus_GLO_30_dem.vrt" # noqa
# TODO: does downloading make it run any faster?
# if download_vrt:
# cache_dir = utils.get_cache_dir()
# vrt_filename = os.path.join(cache_dir, "cop_global.vrt")
# if not os.path.exists(vrt_filename):
# make_cop_vrt(vrt_filename)
# else:
vrt_filename = "/vsicurl/https://raw.githubusercontent.com/scottstanie/sardem/master/sardem/data/cop_global.vrt" # noqa
egm_file = conversions.EGM_FILES[geoid]
if not os.path.exists(egm_file):
conversions.download_egm_grid(geoid=geoid)
Expand Down

0 comments on commit c3dcf9c

Please sign in to comment.