From 8ad1e018441a5dad7c0a64064989103a5714754d Mon Sep 17 00:00:00 2001 From: Bryan Marfito Date: Wed, 27 Aug 2025 14:31:54 +0800 Subject: [PATCH 1/2] Update asc_desc2horz_vert.py --- src/mintpy/cli/asc_desc2horz_vert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mintpy/cli/asc_desc2horz_vert.py b/src/mintpy/cli/asc_desc2horz_vert.py index 9b3b47188..ae0fa79a8 100755 --- a/src/mintpy/cli/asc_desc2horz_vert.py +++ b/src/mintpy/cli/asc_desc2horz_vert.py @@ -57,7 +57,7 @@ def create_parser(subparsers=None): parser.add_argument('file', nargs=2, help='Ascending and descending files\n' 'Both files need to be geocoded in the same spatial resolution.') - parser.add_argument('-d', '--dset', dest='ds_name', type=str, help='dataset to use, default: 1st dataset') + parser.add_argument('-d', '--dset', dest='ds_name', type=str, nargs='+', help='dataset to use, default: 1st dataset') parser.add_argument('-g','--geom-file', dest='geom_file', nargs=2, help='Geometry files for the input data files.') # inputs - checking From c309aa6032a79a14bde115d1d0901f594f5ad05b Mon Sep 17 00:00:00 2001 From: Bryan Marfito Date: Wed, 27 Aug 2025 14:35:58 +0800 Subject: [PATCH 2/2] Update asc_desc2horz_vert.py --- src/mintpy/asc_desc2horz_vert.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mintpy/asc_desc2horz_vert.py b/src/mintpy/asc_desc2horz_vert.py index ac7cd8ea9..a76232db1 100644 --- a/src/mintpy/asc_desc2horz_vert.py +++ b/src/mintpy/asc_desc2horz_vert.py @@ -164,7 +164,7 @@ def run_asc_desc2horz_vert(inps): """ ## 1. calculate the overlapping area in lat/lon - atr_list = [readfile.read_attribute(fname, datasetName=inps.ds_name) for fname in inps.file] + atr_list = [readfile.read_attribute(fname, datasetName=inps.ds_name[0]) for fname in inps.file] S, N, W, E = get_overlap_lalo(atr_list) lat_step = float(atr_list[0]['Y_STEP']) lon_step = float(atr_list[0]['X_STEP']) @@ -176,6 +176,7 @@ def run_asc_desc2horz_vert(inps): ## 2. read LOS data and geometry num_file = len(inps.file) dlos = np.zeros((num_file, length, width), dtype=np.float32) + dataset_order = len(inps.ds_name) if inps.geom_file: los_inc_angle = np.zeros((num_file, length, width), dtype=np.float32) los_az_angle = np.zeros((num_file, length, width), dtype=np.float32) @@ -190,7 +191,12 @@ def run_asc_desc2horz_vert(inps): box = (x0, y0, x0 + width, y0 + length) # read data - dlos[i, :] = readfile.read(fname, box=box, datasetName=inps.ds_name)[0] + if dataset_order > 1: + for i in range(dataset_order): + if inps.file.index(fname) == i: + dlos[i, :] = readfile.read(fname, box=box, datasetName=inps.ds_name[i])[0] + else: + dlos[i, :] = readfile.read(fname, box=box, datasetName=inps.ds_name)[0] msg = f'{inps.ds_name} ' if inps.ds_name else '' print(f'read {msg} from file: {fname}')