As a stopgap so we don't have a completely different set of output files from one unwrapping method, create connected component labels ~as just a 0/1 mask based on what we pass to spurt~:
Recreate the binary mask that spurt uses
Dilate if by dilate_by pixels, by default 25 (or about 750 meters of expansion for 30 m pixels)
Run ndimage.label on the dilated
Reset the pixels which were 0 to have 0 label
I'm avoiding the snaphu connected component grower because
the different cost function of snaphu may not align with what spurt considers good,
the unwrapping errors on an irregular grid seem to manifest differently than what snaphu's errors look like,
I believe that if we actually had sparse pixels (which may be good, just disconnected from immediate neighbors), unwrapped them correctly on an irregular grid, then asked snaphu for connected components, the "minimum size" constraint would label them 0
Related issue number
Closes #347
Checklist
[x] The pull request title is a good summary of the changes - it will be used in the changelog
[x] Unit tests for the changes exist
[x] Tests pass on CI
[x] Documentation reflects the changes where applicable
Change Summary
As a stopgap so we don't have a completely different set of output files from one unwrapping method, create connected component labels ~as just a 0/1 mask based on what we pass to
spurt
~:spurt
usesdilate_by
pixels, by default 25 (or about 750 meters of expansion for 30 m pixels)ndimage.label
on the dilatedI'm avoiding the snaphu connected component grower because
spurt
considers good,Related issue number
Closes #347
Checklist