Skip to content

Commit

Permalink
'Use nearest resampling for merging temporal coherence (#508)
Browse files Browse the repository at this point in the history
Closes #144

The `lanczos` filter was leading to pixels above 1 in the merged
temporal coherence image, despite the max being 1.0 per burst.

This is also likely the reason for negative coherences, though
we can reopen if any new instances are spotted (hasn't been seen in a
year)
  • Loading branch information
scottstanie authored Dec 3, 2024
1 parent 4c7cd31 commit 207194f
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/dolphin/workflows/stitching_bursts.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def run(
temp_coh_file_list,
outfile=stitched_temp_coh_file,
driver="GTiff",
resample_alg="nearest",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)
Expand All @@ -157,28 +158,33 @@ def run(
amp_dispersion_list,
outfile=stitched_amp_disp_file,
driver="GTiff",
resample_alg="nearest",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)
repack_raster(stitched_temp_coh_file, keep_bits=10)

stitched_shp_count_file = stitched_ifg_dir / "shp_counts.tif"
stitching.merge_images(
shp_count_file_list,
outfile=stitched_shp_count_file,
driver="GTiff",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)
if not stitched_shp_count_file.exists():
stitching.merge_images(
shp_count_file_list,
outfile=stitched_shp_count_file,
driver="GTiff",
resample_alg="nearest",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)

stitched_similarity_file = stitched_ifg_dir / "similarity.tif"
stitching.merge_images(
similarity_file_list,
outfile=stitched_similarity_file,
driver="GTiff",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)
if not stitched_similarity_file.exists():
stitching.merge_images(
similarity_file_list,
outfile=stitched_similarity_file,
driver="GTiff",
resample_alg="nearest",
out_bounds=out_bounds,
out_bounds_epsg=output_options.bounds_epsg,
)

if output_options.add_overviews:
logger.info("Creating overviews for stitched images")
Expand Down

0 comments on commit 207194f

Please sign in to comment.