Skip to content

Commit

Permalink
Missing polygon, fake jpeg, and turning off azimuth FM rate (#212)
Browse files Browse the repository at this point in the history
* take care of missing polygon

* take care of exception raised by GDAL

* bump the version

* revert changes regarding SET off

* Exclude azimuth FM rate from the timing correction; bump version

* catch general errors rather than specific types of error

* except: -> except Exception: to take care of codacy issue

* remove redundant parenthesis in equation

* updates on Docker base image and label

---------

Co-authored-by: Seongsu Jeong <[email protected]>
  • Loading branch information
seongsujeong and Seongsu Jeong authored Oct 6, 2023
1 parent 3f2e9d8 commit bacf177
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM oraclelinux:8
FROM oraclelinux:8.8

LABEL author="OPERA ADT" \
description="s1 cslc 0.3.2 point release" \
version="0.3.2-point"
description="s1 cslc 0.5.3 point release" \
version="0.5.3-point"

# Update the base linux image to date
# Create cache and config directory to be used for the dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/compass/utils/h5_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def metadata_to_h5group(parent_group, burst, cfg, save_noise_and_cal=True,
bool(cfg.lut_params.enabled),
"If True, bistatic delay timing correction has been applied"),
Meta('azimuth_fm_rate_applied',
bool(cfg.lut_params.enabled),
False, # NOTE: Azimuth FM rate was turned off for OPERA production
"If True, azimuth FM-rate mismatch timing correction has been applied"),
Meta('geometry_doppler_applied',
bool(cfg.lut_params.enabled),
Expand Down
9 changes: 8 additions & 1 deletion src/compass/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,17 @@ def open_raster(filename, band=1):
raise FileNotFoundError(err_str)

try:
# The pythonic execption handling for GDAL can be turned on / off
# The flag of which can be identified by `gdal.GetUseExceptions()`
# In pythonic exception halding, `gdal.Open()` will raise `RuntimeError`
# In traditional GDAL, the function does not raise exception buy will return `None`,
# and the attempts to call GDAL methods will raise `AttributeError`

ds = gdal.Open(filename, gdal.GA_ReadOnly)
arr = ds.GetRasterBand(band).ReadAsArray()
return arr
except AttributeError:

except Exception:
# GDAL reads 1st 2 bytes of ENVI binary to determine file type. If 1st
# bytes of flat binary is that of a jpeg but the binary is not then
# GDAL throws a libjpeg runtime error. Follow specifically tries to
Expand Down
9 changes: 4 additions & 5 deletions src/compass/utils/lut.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ def cumulative_correction_luts(burst, dem_path, tec_path,
rg_lut_data += dry_los_tropo

# Invert signs to correct for convention
# TO DO: add azimuth SET to LUT
az_lut_data = -(bistatic_delay.data + az_fm_mismatch.data)
#az_lut_data = -(bistatic_delay.data + az_fm_mismatch.data)
az_lut_data = -bistatic_delay.data
# NOTE: Azimuth FM rate was turned off for OPERA production

rg_lut = isce3.core.LUT2d(bistatic_delay.x_start,
bistatic_delay.y_start,
Expand Down Expand Up @@ -229,11 +230,9 @@ def compute_geocoding_correction_luts(burst, dem_path, tec_path,
height[dec_slice],
ellipsoid,
geo2rdr_params)

# Resize SET to the size of the correction grid
out_shape = bistatic_delay.data.shape
kwargs = dict(order=1, mode='edge', anti_aliasing=True,
preserve_range=True)
preserve_range=True)
rg_set = resize(rg_set_temp, out_shape, **kwargs)
az_set = resize(az_set_temp, out_shape, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions src/compass/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# release history
Tag = collections.namedtuple('Tag', 'version date')
release_history = (
Tag('0.5.3', '2023-10-05'),
Tag('0.5.2', '2023-09-21'),
Tag('0.5.1', '2023-09-09'),
Tag('0.5.0', '2023-08-25'),
Expand Down

0 comments on commit bacf177

Please sign in to comment.