diff --git a/src/disp_s1/main.py b/src/disp_s1/main.py index 66da7aa..87f4f56 100644 --- a/src/disp_s1/main.py +++ b/src/disp_s1/main.py @@ -153,6 +153,7 @@ class ProductFiles(NamedTuple): conncomp: Path temp_coh: Path correlation: Path + shp_counts: Path ps_mask: Path troposphere: Path | None ionosphere: Path | None @@ -235,6 +236,7 @@ def process_product( temp_coh_filename=files.temp_coh, ifg_corr_filename=files.correlation, ps_mask_filename=files.ps_mask, + shp_count_filename=files.shp_counts, unwrapper_mask_filename=files.unwrapper_mask, los_east_file=los_east_file, los_north_file=los_north_file, @@ -315,6 +317,7 @@ def create_displacement_products( temp_coh=out_paths.stitched_temp_coh_file, correlation=cor, ps_mask=out_paths.stitched_ps_file, + shp_counts=out_paths.stitched_shp_count_file, troposphere=tropo, ionosphere=iono, unwrapper_mask=mask_f, diff --git a/src/disp_s1/product.py b/src/disp_s1/product.py index 3783dd9..c2d6e1a 100644 --- a/src/disp_s1/product.py +++ b/src/disp_s1/product.py @@ -83,6 +83,7 @@ def create_output_product( temp_coh_filename: Filename, ifg_corr_filename: Filename, ps_mask_filename: Filename, + shp_count_filename: Filename, unwrapper_mask_filename: Filename | None, pge_runconfig: RunConfig, dolphin_config: DisplacementWorkflow, @@ -110,6 +111,8 @@ def create_output_product( The path to the input interferometric correlation image. ps_mask_filename : Filename The path to the input persistent scatterer mask image. + shp_count_filename : Filename + The path to statistically homogeneous pixels (SHP) counts. unwrapper_mask_filename : Filename, optional The path to the boolean mask used during unwrapping to ignore pixels. pge_runconfig : Optional[RunConfig], optional @@ -264,12 +267,13 @@ def create_output_product( temp_coh_filename, ifg_corr_filename, ps_mask_filename, + shp_count_filename, unwrapper_mask_filename, ] for info, filename in zip(product_infos[2:], data_files): if filename is not None and Path(filename).exists(): - data = io.load_gdal(filename) + data = io.load_gdal(filename).astype(info.dtype) else: data = np.full(shape=shape, fill_value=info.fillvalue, dtype=info.dtype) diff --git a/src/disp_s1/product_info.py b/src/disp_s1/product_info.py index fbc3fd9..3dc4a59 100644 --- a/src/disp_s1/product_info.py +++ b/src/disp_s1/product_info.py @@ -53,7 +53,6 @@ class DisplacementProducts: dtype=np.float32, ) ) - connected_component_labels: ProductInfo = field( default_factory=lambda: ProductInfo( name="connected_component_labels", @@ -63,7 +62,6 @@ class DisplacementProducts: dtype=np.uint16, ) ) - temporal_coherence: ProductInfo = field( default_factory=lambda: ProductInfo( name="temporal_coherence", @@ -75,7 +73,6 @@ class DisplacementProducts: dtype=np.float32, ) ) - interferometric_correlation: ProductInfo = field( default_factory=lambda: ProductInfo( name="interferometric_correlation", @@ -90,7 +87,6 @@ class DisplacementProducts: dtype=np.float32, ) ) - persistent_scatterer_mask: ProductInfo = field( default_factory=lambda: ProductInfo( name="persistent_scatterer_mask", @@ -103,7 +99,18 @@ class DisplacementProducts: dtype=np.uint8, ) ) - + shp_counts: ProductInfo = field( + default_factory=lambda: ProductInfo( + name="shp_counts", + description=( + "Number of statistically homogeneous pixels (SHPs) used during" + " multilooking." + ), + fillvalue=0, + attrs={"units": "unitless"}, + dtype=np.int16, + ) + ) unwrapper_mask: ProductInfo = field( default_factory=lambda: ProductInfo( name="unwrapper_mask",