-
Notifications
You must be signed in to change notification settings - Fork 85
Bugfix: STATIC Layover Shadow Mask geocoding fill not set to 255
#337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nemo794
wants to merge
2
commits into
isce-framework:develop
Choose a base branch
from
nemo794:bugfix_static_layovershadow
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+38
−6
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I mean. Presumably only the valid pixels get updated during processing, so if you initialize them all to 255 in the beginning then you don't have to muck around with temporary mask layers later.
I don't think we have a
isce3.io.Raster.fillmethod yet, but it should be easy to implement. To test the approach without committing to that, you could start withThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nemo794 Does this fix seem simpler? I can either run tests for your current commit or would you prefer to try Brian's suggestion instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhawkins Thank you for clarifying! You mentioned the word "Presumably", and that unfortunately seems to be the gotcha. :/
That said, I did test your fix in hopes it would work. Unfortunately, it did not resolve the bug -- the geocoding fill area was populated with
0values again.I had Claude sleuth around ISCE3 to determine the reason, and here's its summary:
isce3/cxx/isce3/geocode/GeocodeCov.cpp
Lines 894 to 895 in bdf1f6f
Detailed breakdown from Claude:
The C++ Geocoding Process, from GeocodeCov.cpp lines 863-877:
When you pre-fill the output raster with 255:
geocoded_layover_shadow_mask= all 255sgeoDataBlockfilled withnan_t_out(0 for uint8)_interpolate()writes radar mask values (0-3) only to pixels inside radar gridsetBlock()on the output rastergeoDataBlockcontentsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A different design could maybe be to add a new
fill_valueparameter intoGeocodeCov, so that internally it fillsgeoDataBlockwith something other thanNaN...?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Yeah, it looks like
nan_t_outends up as zero in this case (godbolt).Just to recap my suggestion from today's meeting, I'd do it in two parts:
fill_valueparameter to the function(s) that currently have a hard-codednan_t_out, allowing a motivated user to control it.That way we get the desired behavior right away and we can work on actually percolating
fill_valueup through the rest of the API as time permits.In the meeting I was thinking about using
std::optional<T> fill_value = nullptrwhich would let you choose the default with runtime logic. But you can just do it withconstexprlogic, so that's not actually necessary and you can just stick it in the header.