Skip to content

Commit c2a7172

Browse files
jungkyoJungGitHub Enterprise
authored andcommitted
Merge pull request #1016 from jungkyoj/debug_h5prep_multipol
Debug h5prep multipol
2 parents f8b915d + 05ac0fd commit c2a7172

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

python/packages/nisar/workflows/h5_prep.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ def cp_geocode_meta(cfg, output_hdf5, dst):
153153
f'{ident_path}/{dst_data}')
154154

155155
# Delete flag isGeocoded if exist, and assign it again
156+
ident = dst_h5[ident_path]
157+
if 'isGeocoded' in ident:
158+
del ident['isGeocoded']
156159
is_geocoded = dst in ['GCOV', 'GSLC', 'GUNW', 'GOFF']
157-
158160
dst_h5[ident_path].create_dataset('isGeocoded',
159161
data=np.string_(str(is_geocoded)))
160162
desc = "Flag to indicate radar geometry or geocoded product"
@@ -476,7 +478,7 @@ def prep_ds_insar(pcfg, dst, dst_h5):
476478
'RUNW'] else 'grids'
477479
product_path = f'{common_path}/{dst}'
478480
freq_path = f'{product_path}/{grid_swath}/frequency{freq}'
479-
dst_h5[product_path].create_group(grid_swath)
481+
dst_h5[product_path].require_group(grid_swath)
480482
dst_h5[f'{product_path}/{grid_swath}'].create_group(
481483
f'frequency{freq}')
482484

@@ -939,17 +941,17 @@ def prep_ds_insar(pcfg, dst, dst_h5):
939941
'crossCorrelationMethod',
940942
descr=descr, units=None, data=lay_cfg.get('cross_correlation_method'),
941943
long_name='cross correlation method')
942-
# Add perpendicular and parallel baseline
943-
descr = "Perpendicular component of the InSAR baseline"
944-
_create_datasets(dst_h5[grid_path], igram_shape, np.float64,
945-
"perpendicularBaseline",
946-
descr=descr, units="meters",
947-
long_name='perpendicular baseline')
948-
_create_datasets(dst_h5[grid_path], igram_shape, np.float64,
949-
"parallelBaseline",
950-
descr=descr.replace('Perpendicular', 'Parallel'),
951-
units="meters",
952-
long_name='parallel baseline')
944+
# Add perpendicular and parallel baseline
945+
descr = "Perpendicular component of the InSAR baseline"
946+
_create_datasets(dst_h5[grid_path], igram_shape, np.float64,
947+
"perpendicularBaseline",
948+
descr=descr, units="meters",
949+
long_name='perpendicular baseline')
950+
_create_datasets(dst_h5[grid_path], igram_shape, np.float64,
951+
"parallelBaseline",
952+
descr=descr.replace('Perpendicular', 'Parallel'),
953+
units="meters",
954+
long_name='parallel baseline')
953955

954956

955957
def get_off_params(pcfg, param_name, is_roff=False, pattern=None,

0 commit comments

Comments
 (0)