Skip to content

Commit 8860dc9

Browse files
authored
Update remap.py
test to make sure remap bit depth in allowed values 8 or 16
1 parent 5911f6a commit 8860dc9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sarpy/visualization/remap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,9 @@ def get_registered_remap(
19521952
if not _DEFAULTS_REGISTERED:
19531953
_register_defaults()
19541954

1955+
if int( bit_depth ) not in [ 8, 16 ]:
1956+
raise KeyError('Unregistered remap name `{}` with bit_depth `{}`'.format( remap_name, bit_depth ))
1957+
19551958
if int( bit_depth ) == 16:
19561959
rm_name = remap_name + '_' + str( bit_depth )
19571960
else:

0 commit comments

Comments
 (0)