diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d7743e..a75a33de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Split apart the `dolphin.workflows.stitch_and_unwrap` module into `stitching_bursts` and `unwrapping` - Switched output filename from `tcorr` to `temporal_coherence` for the temporal coherence of phase linking. - Also added the date span to the `temporal_coherence` output name +- The default extension for conncomps is now `.tif`. Use geotiffs instead of ENVI format for connected components. # [v0.7.0](https://github.com/isce-framework/dolphin/compare/v0.6.1...v0.7.0) diff --git a/src/dolphin/unwrap.py b/src/dolphin/unwrap.py index de6af998..16f74b99 100644 --- a/src/dolphin/unwrap.py +++ b/src/dolphin/unwrap.py @@ -23,7 +23,7 @@ gdal.UseExceptions() -CONNCOMP_SUFFIX = ".unw.conncomp" +CONNCOMP_SUFFIX = ".unw.conncomp.tif" @log_runtime @@ -283,15 +283,14 @@ def unwrap( dtype=np.float32, options=opts, ) - # Always use ENVI for conncomp conncomp_filename = str(unw_filename).replace(unw_suffix, CONNCOMP_SUFFIX) io.write_arr( arr=None, output_name=conncomp_filename, - driver="ENVI", + driver="GTiff", dtype=np.uint32, like_filename=ifg_filename, - options=io.DEFAULT_ENVI_OPTIONS, + options=io.DEFAULT_TIFF_OPTIONS, ) if use_snaphu: @@ -513,19 +512,19 @@ def _get_cb_and_nodata(unwrap_method, unwrap_callback, nodata): conncomp_filename = str(unw_filename).replace(unw_suffix, CONNCOMP_SUFFIX) # SUFFIX=ADD - envi_options = dict(opt.lower().split("=") for opt in io.DEFAULT_ENVI_OPTIONS) + # Convert to something rasterio understands + gtiff_options = dict(opt.lower().split("=") for opt in io.DEFAULT_TIFF_OPTIONS) logger.debug(f"Saving conncomps to {conncomp_filename}") conncomp_rb = tophu.RasterBand( conncomp_filename, height=height, width=width, dtype=np.uint16, - driver="ENVI", + driver="GTiff", crs=crs, transform=transform, - **envi_options, + **gtiff_options, ) - gtiff_options = dict(opt.lower().split("=") for opt in io.DEFAULT_TIFF_OPTIONS) unw_rb = tophu.RasterBand( unw_filename, height=height, diff --git a/tests/test_unwrap.py b/tests/test_unwrap.py index 5ccace12..5ec1e899 100644 --- a/tests/test_unwrap.py +++ b/tests/test_unwrap.py @@ -46,7 +46,9 @@ def test_unwrap_snaphu(tmp_path, raster_100_by_200, corr_raster): init_method="mst", ) assert unw_path == unw_filename - assert str(conncomp_path) == str(unw_filename).replace(".unw.tif", ".unw.conncomp") + assert str(conncomp_path) == str(unw_filename).replace( + ".unw.tif", ".unw.conncomp.tif" + ) assert io.get_raster_xysize(unw_filename) == io.get_raster_xysize(raster_100_by_200) # test other init_method