Skip to content

Commit

Permalink
Merge pull request #83 from gshiroma/rtc_update_2024_2
Browse files Browse the repository at this point in the history
Save the zero-Doppler spacing in meters in the product's metadata
  • Loading branch information
gshiroma authored Mar 15, 2024
2 parents aa6b16e + a4f6245 commit 88bf854
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ SHELL ["conda", "run", "-n", "RTC", "/bin/bash", "-c"]
WORKDIR /home/rtc_user/OPERA

# installing OPERA s1-reader
RUN curl -sSL https://github.com/isce-framework/s1-reader/archive/refs/tags/v0.2.2.tar.gz -o s1_reader_src.tar.gz &&\
RUN curl -sSL https://github.com/isce-framework/s1-reader/archive/refs/tags/v0.2.4.tar.gz -o s1_reader_src.tar.gz &&\
tar -xvf s1_reader_src.tar.gz &&\
ln -s s1-reader-0.2.2 s1-reader &&\
ln -s s1-reader-0.2.4 s1-reader &&\
rm s1_reader_src.tar.gz &&\
python -m pip install ./s1-reader

Expand Down
2 changes: 1 addition & 1 deletion Docker/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
dependencies:
- python>=3.9,<3.10
- gdal>=3.0
- s1reader>=0.2.2
- s1reader>=0.2.4
- numpy>=1.20
- pybind11>=2.5
- pyre>=1.11.2
Expand Down
22 changes: 20 additions & 2 deletions src/rtc/h5_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,15 @@ def get_polygon_wkt(burst_in: Sentinel1BurstSlc):
'''

if len(burst_in.border) == 1:
geometry_polygon = burst_in.border[0]
geometry_polygon = shapely.geometry.Polygon(burst_in.border[0])
else:
geometry_polygon = shapely.geometry.MultiPolygon(burst_in.border)

if geometry_polygon.is_empty:
error_msg = f'empty bounding polygon for burst ID {burst_in.burst_id}'
raise RuntimeError(error_msg)
if not geometry_polygon.is_valid:
error_msg = f'invalid bounding polygon for burst ID {burst_in.burst_id}'
raise RuntimeError(error_msg)
return geometry_polygon.wkt


Expand Down Expand Up @@ -493,6 +498,13 @@ def get_metadata_dict(product_id: str,
else:
mosaic_snap_y = float(mosaic_snap_y)

# average azimuth pixel spacing
try:
average_zero_doppler_spacing_in_meters = \
burst_in.average_azimuth_pixel_spacing
except AttributeError:
average_zero_doppler_spacing_in_meters = '(UNSPECIFIED)'

# Geometric accuracy
estimated_geometric_accuracy_bias_y = \
cfg_in.groups.processing.geocoding.estimated_geometric_accuracy_bias_y
Expand Down Expand Up @@ -748,6 +760,12 @@ def get_metadata_dict(product_id: str,
ALL_PRODUCTS,
burst_in.azimuth_time_interval,
'Time interval in the along-track direction of the source data'],
'metadata/sourceData/averageZeroDopplerSpacingInMeters': # 1.6.7
['source_data_average_zero_doppler_spacing_in_meters',
ALL_PRODUCTS,
average_zero_doppler_spacing_in_meters,
'Average pixel spacing in meters between consecutive lines'
' in the along-track direction of the source data'],
'metadata/sourceData/slantRangeSpacing': # 1.6.7
['source_data_slant_range_spacing',
ALL_PRODUCTS,
Expand Down

0 comments on commit 88bf854

Please sign in to comment.