Open
Conversation
Apply water mask to azimuthAngle after applying conversion factor
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideMasks the azimuthAngle dataset in the output HDF5 geometry file using the water mask after the conversion factor is applied, ensuring azimuth angles are zeroed out over water pixels. Flow diagram for applying water mask to azimuthAngle in write_geometryflowchart TD
A[Start write_geometry] --> B[Read demFile]
B --> C[Read incAngleFile]
C --> D[Optionally read azAngleFile]
D --> E[Read waterMaskFile]
E --> F[Write waterMask dataset to HDF5 as waterMask]
F --> G[Apply conversion factor to azimuthAngle]
G --> H[Multiply azimuthAngle by waterMask]
H --> I[Azimuth angles zeroed over water pixels]
I --> J[Finish writing HDF5 outfile]
J --> K[Return outfile]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- If the intent is to ensure this masking happens strictly after the azimuth angle conversion, consider moving this line adjacent to the conversion logic (or wrapping both in a small helper) rather than relying on a comment to enforce ordering.
- Confirm that zeroing masked azimuth values is consistent with how other geometry layers are masked (e.g., using 0 vs NaN or a sentinel value), and adjust the masking operation if a different fill value is expected for water pixels.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If the intent is to ensure this masking happens strictly after the azimuth angle conversion, consider moving this line adjacent to the conversion logic (or wrapping both in a small helper) rather than relying on a comment to enforce ordering.
- Confirm that zeroing masked azimuth values is consistent with how other geometry layers are masked (e.g., using 0 vs NaN or a sentinel value), and adjust the masking operation if a different fill value is expected for water pixels.
## Individual Comments
### Comment 1
<location> `src/mintpy/prep_aria.py:300` </location>
<code_context>
# write
f['waterMask'][:,:] = water_mask
+ # apply mask to azimuthAngle after coversion factor
+ f['azimuthAngle'][:,:] *= water_mask
+
</code_context>
<issue_to_address>
**nitpick (typo):** Fix small typo in the new inline comment for clarity.
In the new comment, "coversion" should be "conversion" to keep the wording clear.
```suggestion
# apply mask to azimuthAngle after conversion factor
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
yunjunz
approved these changes
Feb 25, 2026
prep_aria: mask azimuthAngle with water mask
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Apply water mask to azimuthAngle after applying conversion factor
Before:

After:

Summary by Sourcery
Bug Fixes: