Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HDF-EOS5 metadata for HyP3 products #1180

Merged
merged 6 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
20 changes: 18 additions & 2 deletions src/mintpy/prep_hyp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,27 @@ def add_hyp3_metadata(fname, meta, is_ifg=True):
meta['P_BASELINE_BOTTOM_HDR'] = hyp3_meta['Baseline']

# HDF-EOS5 metadata
if hyp3_meta['ReferenceGranule'].startswith('S1'):
ref_granule = hyp3_meta['ReferenceGranule']
if ref_granule.startswith('S1'):
# beam_mode / relative_orbit
meta['beam_mode'] = 'IW'

if ref_granule.startswith('S1A'):
meta['relative_orbit'] = ((int(hyp3_meta['ReferenceOrbitNumber']) - 73) % 175) + 1
elif ref_granule.startswith('S1B'):
meta['relative_orbit'] = ((int(hyp3_meta['ReferenceOrbitNumber']) - 202) % 175) + 1
else:
raise ValueError('Un-recognized Sentinel-1 satellite from {ref_granule}!')

# first/last_frame [from start/stopUTC]
t0, t1 = ref_granule.split('_')[-5:-3]
meta['startUTC'] = dt.datetime.strptime(t0, '%Y%m%dT%H%M%S').strftime('%Y-%m-%d %H:%M:%S.%f')
meta['stopUTC'] = dt.datetime.strptime(t1, '%Y%m%dT%H%M%S').strftime('%Y-%m-%d %H:%M:%S.%f')

# unwrap_method
meta['unwrap_method'] = hyp3_meta['Unwrappingtype']

return(meta)
return meta


#########################################################################
Expand Down
3 changes: 0 additions & 3 deletions tests/configs/RidgecrestSenDT71.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ mintpy.save.hdfEos5 = yes
mintpy.save.hdfEos5.subset = yes
mintpy.plot = no
mintpy.plot.maxMemory = 2

##————————————————————————————— HDF-EOS5 Attributes -—————————————————————————##
relative_orbit = 71