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 range and azimuth range to source metadata #54

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Changes from 2 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
48 changes: 47 additions & 1 deletion src/rtc/h5_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ def get_metadata_dict(product_id: str,
# DEM description
dem_file_description = cfg_in.dem_file_description

# Slant range and azimuth resolution of the sensor
slant_range_resolution, azimuth_resolution = get_range_azimuth_resolution(burst_in)
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved

if not dem_file_description:
# If the DEM description is not provided, use DEM source
dem_file_description = os.path.basename(cfg_in.dem)
Expand Down Expand Up @@ -614,6 +617,16 @@ def get_metadata_dict(product_id: str,
ALL_PRODUCTS,
burst_in.range_pixel_spacing,
'Slant range spacing of the source data in meters'],
'metadata/sourceData/azimuthResolution': # 1.6.7
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
['source_data_azimuth_resolution',
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
ALL_PRODUCTS,
azimuth_resolution,
'Azimuth resolution of the source data in meters'],
'metadata/sourceData/slantRangeResolutuion': # 1.6.7
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
['source_data_slant_range_resolution',
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
ALL_PRODUCTS,
slant_range_resolution,
'Slant range resoluton of the source data in meters'],
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved

# 'metadata/sourceData/azimuthResolution': # 1.6.7
# ['source_azimuth_resolution',
Expand Down Expand Up @@ -1293,4 +1306,37 @@ def get_rfi_metadata_dict(burst_in,
path_in_rfi_dict = os.path.join(rfi_root_path, fieldname)
rfi_metadata_dict[path_in_rfi_dict] = data

return rfi_metadata_dict
return rfi_metadata_dict


def get_range_azimuth_resolution(burst: Sentinel1BurstSlc):
'''
Get the range and azimuth resolution based on the ESA documentation

seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
Paremeters
----------
burst: Sentinel1BurstSlc
Burst object to compute the resolution

seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
returns
-------
slant_range_resolution: float
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
Slant range recolution
azimuth_resolution: float
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
Azimuth resolution

Reference
---------
seongsujeong marked this conversation as resolved.
Show resolved Hide resolved
https://sentinels.copernicus.eu/web/sentinel/technical-guides/sentinel-1-sar/products-algorithms/level-1/single-look-complex/interferometric-wide-swath
'''

resolution_subswath_range_azimuth_dict = {
'IW1':[2.7, 22.5],
'IW2':[3.1, 22.7],
'IW3':[3.5, 22.6]
}

slant_range_resolution, azimuth_resolution =\
resolution_subswath_range_azimuth_dict[burst.burst_id.subswath]

return slant_range_resolution, azimuth_resolution
Loading