Skip to content

Commit 80e997e

Browse files
authored
use .flg extension for watermask so it is ROI_PAC-compatible. (#15)
1 parent c328312 commit 80e997e

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

sardem/cli.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def positive_small_int(argstring):
2222
raise ArgumentTypeError("--rate must be positive integer < 50")
2323
return intval
2424

25+
2526
DESCRIPTION = """Stiches SRTM .hgt files to make (upsampled) DEM
2627
2728
Pick a lat/lon bounding box for a DEM, and it will download
@@ -145,23 +146,25 @@ def get_cli_args():
145146
parser.add_argument(
146147
"--cache-dir",
147148
help=(
148-
"Location to save downloaded files (Default = {})".format(utils.get_cache_dir())
149+
"Location to save downloaded files (Default = {})".format(
150+
utils.get_cache_dir()
151+
)
149152
),
150153
)
151154
parser.add_argument(
152155
"--output-format",
153156
"-of",
154157
choices=["ENVI", "GTiff", "ROI_PAC"],
155158
default="ENVI",
156-
help="Output format (for copernicus DEM option, default %(default)s)."
159+
help="Output format (for copernicus DEM option, default %(default)s).",
157160
)
158161
parser.add_argument(
159162
"--output-type",
160163
"-ot",
161-
choices=["int16", "float32"],
164+
choices=["int16", "float32", "uint8"],
162165
type=str.lower,
163166
default="int16",
164-
help="Output data type (default %(default)s)."
167+
help="Output data type (default %(default)s).",
165168
)
166169
return parser.parse_args()
167170

@@ -194,14 +197,18 @@ def cli():
194197
bbox = args.bbox
195198
else:
196199
bbox = None
197-
200+
198201
if not args.output:
199202
output = (
200-
"watermask.wbd" if args.data_source == "NASA_WATER" else "elevation.dem"
203+
"watermask.flg" if args.data_source == "NASA_WATER" else "elevation.dem"
201204
)
202205
else:
203206
output = args.output
204207

208+
# Force the water mask to be uint8
209+
if args.data_source == "NASA_WATER":
210+
args.output_type = "uint8"
211+
205212
sardem.dem.main(
206213
output_name=output,
207214
bbox=bbox,

sardem/loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
]
1919
RSC_KEYS = [tup[0] for tup in RSC_KEY_TYPES]
2020

21-
# in case only speciying rows/cols/steps, these always seem to be same
21+
# in case only specifying rows/cols/steps, these always seem to be same
2222
DEFAULT_KEYS = {
2323
"x_unit": "degrees",
2424
"y_unit": "degrees",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="sardem",
8-
version="0.11.1",
8+
version="0.11.2",
99
author="Scott Staniewicz",
1010
author_email="scott.stanie@gmail.com",
1111
description="Create upsampled DEMs for InSAR processing",

0 commit comments

Comments
 (0)