Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/mintpy/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,26 @@ def prepare_metadata(iDict):
gunw_files = iDict['mintpy.load.unwFile']
water_mask = iDict['mintpy.load.waterMaskFile']

if str(dem_file).lower() in ['auto', 'none', 'no', '']:
raise ValueError(
'mintpy.load.demFile is required for processor=nisar. '
'Please set it to a real DEM path in the template.'
)
dem_file = os.path.expanduser(str(dem_file))
if not os.path.isfile(dem_file):
raise FileNotFoundError(
f'No DEM file found for mintpy.load.demFile: {dem_file}'
)

if len(glob.glob(str(gunw_files))) == 0:
raise FileNotFoundError(
f'No input GUNW files found for mintpy.load.unwFile: {gunw_files}'
)

# run prep_*.py
iargs = ['-i', gunw_files, '-d', dem_file]

if os.path.exists(water_mask):
if str(water_mask).lower() not in ['auto', 'none', 'no', ''] and os.path.exists(water_mask):
iargs = iargs + ['--mask', water_mask]

if iDict['mintpy.subset.yx']:
Expand Down
Loading