filtering
filter_long_wavelength(unwrapped_phase, bad_pixel_mask, wavelength_cutoff=25 * 1000.0, pixel_spacing=30, workers=1, fill_value=None, scratch_dir=None)
Filter out signals with spatial wavelength longer than a threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unwrapped_phase
|
ArrayLike
|
Unwrapped interferogram phase to filter. |
required |
bad_pixel_mask
|
ArrayLike
|
Boolean array with same shape as |
required |
wavelength_cutoff
|
float
|
Spatial wavelength threshold to filter the unwrapped phase. Signals with wavelength longer than 'wavelength_cutoff' are filtered out. The default is 25*1e3 (meters). |
25 * 1000.0
|
pixel_spacing
|
float
|
Pixel spatial spacing. Assume same spacing for x, y axes. The default is 30 (meters). |
30
|
workers
|
int
|
Number of |
1
|
fill_value
|
float
|
Value to place in output pixels which were masked.
If |
None
|
scratch_dir
|
Path
|
Directory to use for temporary files. If not provided, uses system default for Python's tempfile module. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filtered_ifg |
2D complex array
|
filtered interferogram that does not contain signals with spatial wavelength longer than a threshold. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If wavelength_cutoff too large for image size/pixel spacing. |
Source code in src/dolphin/filtering.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
filter_rasters(unw_filenames, cor_filenames=None, conncomp_filenames=None, temporal_coherence_filename=None, wavelength_cutoff=25000, correlation_cutoff=0.5, output_dir=None, max_workers=4)
Filter a list of unwrapped interferogram files using a long-wavelength filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unw_filenames
|
list[Path]
|
List of paths to unwrapped interferogram files to be filtered. |
required |
cor_filenames
|
list[Path] | None
|
List of paths to correlation files Passing None skips filtering on correlation. |
None
|
conncomp_filenames
|
list[Path] | None
|
List of paths to connected component files, filters any 0 labeled pixels. Passing None skips filtering on connected component labels. |
None
|
temporal_coherence_filename
|
Path | None
|
Path to the temporal coherence file for masking. Passing None skips filtering on temporal coherence. |
None
|
wavelength_cutoff
|
float
|
Spatial wavelength cutoff (in meters) for the filter. Default is 50,000 meters. |
25000
|
correlation_cutoff
|
float
|
Threshold of correlation (if passing |
0.5
|
output_dir
|
Path | None
|
Directory to save the filtered results. If None, saves in the same location as inputs with .filt.tif extension. |
None
|
max_workers
|
int
|
Number of parallel images to process. Default is 4. |
4
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
Output filtered rasters. |
Notes
Remove long-wavelength components from each unwrapped interferogram. It can optionally use temporal coherence, correlation, and connected component information for masking.
Source code in src/dolphin/filtering.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
gaussian_filter_nan(image, sigma, mode='constant', **kwargs)
Apply a gaussian filter to an image with NaNs (avoiding all nans).
The scipy.ndimage gaussian_filter will make the output all NaNs if
any of the pixels in the input that touches the kernel is NaN
Source: https://stackoverflow.com/a/36307291
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
ndarray
|
Image with nans to filter |
required |
sigma
|
float
|
Size of filter kernel. passed into |
required |
mode
|
str
|
Boundary mode for |
= "constant"
|
**kwargs
|
Any
|
Passed into |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Filtered version of |
Source code in src/dolphin/filtering.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |