emcf
GeneralSettings
dataclass
Settings associated with breaking data into tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_tiles
|
bool
|
Tile up data spatially. |
True
|
intermediate_folder
|
str
|
Path to folder where intermediate outputs are created. |
'./emcf_tmp'
|
output_folder
|
str
|
Path to output folder. |
'./emcf'
|
Source code in src/spurt/workflows/emcf/_settings.py
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 134 135 136 137 | |
tile_filename(num)
Input index is zero-based.
Source code in src/spurt/workflows/emcf/_settings.py
112 113 114 | |
MergerSettings
dataclass
Class for holding tile merging settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_overlap_points
|
int
|
Minimum number of pixels in overlap region for it to be considered valid. |
25
|
method
|
str
|
Currently, only "dirichlet" is supported. |
'dirichlet'
|
bulk_method
|
str
|
Method used to estimate bulk offset between tiles. Supported methods are 'integer' and 'L2'. |
'L2'
|
num_parallel_ifgs
|
int
|
Number of interferograms to merge in one batch. Use zero to merge all interferograms in a single batch. |
1
|
Source code in src/spurt/workflows/emcf/_settings.py
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 | |
Solver
Implementation of the EMCF algorithm.
Implements the Extended Minimum Cost Flow (EMCF) algorithm for phase unwrapping [Pepe and Lanari, 2006]. We only implement the solver framework [Olsen et al., 2023] as the graph generation and cost function implementations are not exactly replicable without more details.
| Pepe and Lanari, 2006 | Pepe A. and Lanari R., 2006. On the Extension of the Minimum Cost Flow Algorithm for Phase Unwrapping of Multitemporal Differential SAR Interferograms. IEEE Transactions on Geoscience and Remote Sensing. 44, pp.2374--2383. 10.1109/TGRS.2006.873207 |
| Olsen et al., 2023 | Olsen K.M., Calef M.T. and Agram P.S., 2023. Contextual uncertainty assessments for InSAR-based deformation retrieval using an ensemble approach. Remote Sensing of Environment. 287, pp.113456. |
Source code in src/spurt/workflows/emcf/_solver.py
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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
link_model
property
Retrieve the link model for the workflow.
nepochs
property
Number of points in the temporal network.
nifgs
property
Number of links in the temporal network.
nlinks
property
Number of links in the spatial network.
npoints
property
Number of points in the spatial network.
settings
property
Retrieve settings for the workflow.
__init__(solver_space, solver_time, settings, link_model=None)
Spatio-temporal unwrapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solver_space
|
MCFSolverInterface
|
MCF Solver interface for spatial graph connecting the stable points. Typically a Delaunaytriangulation. |
required |
solver_time
|
MCFSolverInterface
|
MCF Solver interface for temporal graph usually representing interferograms in time-Bperp space. Typically a Delaunay triangulation. |
required |
settings
|
SolverSettings
|
Settings to be used for setting up the solver like number of workers, link batch size etc. |
required |
model
|
Per-link model in time used to correct the gradients before unwrapping. |
required |
Source code in src/spurt/workflows/emcf/_solver.py
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 | |
unwrap_cube(wrap_data)
Unwrap a 3D cube of data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrap_data
|
Irreg3DInput
|
2D array of size (nslc, npoints) or (nifg, npoints). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
uw_data |
ndarray
|
2D float32 array of size (nifg, npoints). |
Source code in src/spurt/workflows/emcf/_solver.py
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 | |
unwrap_gradients_in_space(grad_space)
Spatially unwrap each interferogram sequentially.
Source code in src/spurt/workflows/emcf/_solver.py
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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |
unwrap_gradients_in_time(wrap_data, *, input_is_ifg)
Temporally unwrap links in parallel.
The output of this step is the temporally unwrapped phase gradients on each link of the spatial graph.
Source code in src/spurt/workflows/emcf/_solver.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 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 | |
SolverSettings
dataclass
Settings associated with Extended Minimum Cost Flow (EMCF) workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t_worker_count
|
int
|
Number of workers for temporal unwrapping in parallel. Set value to <=0 to let workflow use default workers (ncpus - 1). Must be set when num_parallel_tiles > 1. |
0
|
s_worker_count
|
int
|
Number of workers for spatial unwrapping in parallel. Set value to <=0 to let workflow use (ncpus - 1). Must be set when num_parallel_tiles > 1. |
1
|
links_per_batch
|
int
|
Temporal unwrapping operations over spatial links are performed in batches and each batch is solved in parallel. |
10000
|
t_cost_type
|
str
|
Temporal unwrapping costs. Can be one of 'constant', 'distance', 'centroid'. |
'constant'
|
t_cost_scale
|
float
|
Scale factor used in computing edge costs for temporal unwrapping. |
100.0
|
s_cost_type
|
str
|
Spatial unwrapping costs. Can be one of 'constant', 'distance', 'centroid'. |
'constant'
|
s_cost_scale
|
float
|
Scale factor used in computing edge costs for spatial unwrapping. |
100.0
|
num_parallel_tiles
|
int
|
Number of tiles to process in parallel. Set to 0 for all tiles. |
1
|
Source code in src/spurt/workflows/emcf/_settings.py
9 10 11 12 13 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 | |
TilerSettings
dataclass
Class for holding tile generation settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_points_per_tile
|
int
|
Target points per tile when generating tiles. |
800000
|
max_tiles
|
int
|
Maximum number of tiles allowed. |
16
|
target_points_for_generation
|
int
|
Number of points used for determining tiles based on density. If input has a lot of points, tiling can take a really long time. We use this as a guide to downsample inputs to generate tile boundaries. The tile boundaries are then used with full set of inputs. |
120000
|
dilation_factor
|
float
|
Dilation factor of non-overlapping tiles. 0.05 would lead to 10 percent dilation of the tile. |
0.05
|
Source code in src/spurt/workflows/emcf/_settings.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
compute_phasediff_deciles(gen_settings, mrg_settings)
Compute overlap phase difference stats and save to h5.
We compute histograms of phase difference between overlapping tiles. While we only use a constant bulk offset for reconciling differences, these histograms can be used for debugging and assessing quality of consistency betwen unwrapped results of individual tiles.
Source code in src/spurt/workflows/emcf/_overlap.py
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 | |
get_bulk_offsets(stack, gen_settings, mrg_settings)
Compute bulk phase offsets between overlapping tiles.
We compute the bulk offset used to adjust individually unwrapped tiles in the merge process. While we computed phase difference deciles, we only use the median phase difference here for adjusting tiles.
Source code in src/spurt/workflows/emcf/_bulk_offset.py
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 | |
get_tiles(stack, gen_settings, tile_settings)
Generate tiles based on settings.
Create a JSON file with tile information in the intermediate folder. Tiles are not regenerated if the JSON file is already present.
Source code in src/spurt/workflows/emcf/_tiling.py
12 13 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 | |
merge_tiles(stack, g_time, gen_settings, mrg_settings)
Merge the different tiles.
Source code in src/spurt/workflows/emcf/_merge.py
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 | |
unwrap_tiles(stack, g_time, gen_settings, solv_settings)
Unwrap each tile and save to h5.
Source code in src/spurt/workflows/emcf/_unwrap.py
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 | |