-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add tropo_local_texture.py
for tropo correction (Yang et al., 2024)
#1291
base: main
Are you sure you want to change the base?
Conversation
💖 Thanks for opening this pull request! Please check out our contributing guidelines. 💖 |
Reviewer's Guide by SourceryThis PR introduces a new tropospheric delay correction method based on local texture correlation, implementing the low-resolution component of Yang et al.'s 2024 work. The implementation includes slope estimation, interpolation, and intercept filtering steps to correct tropospheric delays in InSAR time series data. Sequence diagram for tropospheric delay correction processsequenceDiagram
participant User
participant CLI
participant TropoLocalTexture
User->>CLI: Run tropo_local_texture.py
CLI->>TropoLocalTexture: run_tropo_local_texture(inps)
TropoLocalTexture->>TropoLocalTexture: read_topographic_data(geom_file)
TropoLocalTexture->>TropoLocalTexture: estimate_local_slope(dem, ts_data, inps, n_ref, meta)
TropoLocalTexture->>TropoLocalTexture: slope_interpolation(ts_data, inps, k_htc)
TropoLocalTexture->>TropoLocalTexture: intercept_filtering(dem, ts_data, inps, k_htc_interp, meta)
TropoLocalTexture-->>CLI: Return corrected data
CLI-->>User: Output corrected timeseries file
Class diagram for the new tropospheric correction methodclassDiagram
class TropoLocalTexture {
+read_topographic_data(geom_file)
+estimate_local_slope(dem, ts_data, inps, n_ref, meta)
+slope_interpolation(ts_data, inps, k_htc)
+intercept_filtering(dem, ts_data, inps, k_htc_interp, meta)
+run_tropo_local_texture(inps)
}
class CLI {
+create_parser(subparsers)
+cmd_line_parse(iargs)
+main(iargs)
}
TropoLocalTexture <|-- CLI
note for TropoLocalTexture "This class implements the new tropospheric correction method based on local texture correlation."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR summaryThis Pull Request introduces a new method for tropospheric correction in InSAR data processing, based on local texture correlation as described in Yang et al.'s 2024 research. The new method, implemented in Suggestion
Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect. Current plan usage: 0.00% Have feedback or need help? |
…into tropo_local_texture
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.
Hey @Yohcy - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider removing commented out debug code (e.g. in smallbaselineApp.py) and resolving remaining TODO comments before merging
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
max_tmp = np.where(max_tmp > res_step, max_tmp - res_step, max_tmp) | ||
mask_std[np.abs(cor_tmp) > max_tmp] = np.nan | ||
|
||
if np.nansum(~np.isnan(mask_std)) < np.nansum(~np.isnan(mask_process)) / 10: #TODO |
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.
suggestion: Magic number 10 in threshold check should be a named constant or configurable parameter
MIN_VALID_PIXELS_RATIO = 0.1
if np.nansum(~np.isnan(mask_std)) < np.nansum(~np.isnan(mask_process)) * MIN_VALID_PIXELS_RATIO:
phase_tmp = ts_data[n, :, :] * mask_std | ||
dem_tmp = dem * mask_std | ||
valid_idx = ~np.isnan(phase_tmp) & ~np.isnan(dem_tmp) | ||
if np.nansum(valid_idx) == 0: |
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.
issue (bug_risk): The continue statement could silently skip processing without any warning
Consider logging a warning when skipping processing due to no valid pixels, as this could indicate an underlying data quality issue.
phase_ts_htc_low[n, :, :] = tmp | ||
intercept[n, :, :] = tmp_filt | ||
reference_phase = phase_ts_htc_low[:, ref_y - 1, ref_x - 1] | ||
phase_ts_htc_low = phase_ts_htc_low - reference_phase[:, np.newaxis, np.newaxis] #TODO |
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.
issue (bug_risk): TODO comment on critical reference phase correction needs to be resolved
The TODO comment on this reference phase correction operation should be resolved before production use, as it could affect the correctness of the results.
tropo_local_texture.py
for tropospheric correction based on Yang et al. (2024, TGRS)
tropo_local_texture.py
for tropospheric correction based on Yang et al. (2024, TGRS)tropo_local_texture.py
for tropo correction based on Yang et al. (2024, TGRS)
tropo_local_texture.py
for tropo correction based on Yang et al. (2024, TGRS)tropo_local_texture.py
for tropo correction based on Yang et al., 2024
tropo_local_texture.py
for tropo correction based on Yang et al., 2024tropo_local_texture.py
for tropo correction (Yang et al., 2024)
Description of proposed changes
This code is based on this work:
This code only completes the low resolution part of this work. With the help of Yang Qingyue, it successfully gets almost the same result as in the work above.
Some figures during the correction process are shown below:
Low-resolution correction in Yang' work:
Before corrections
Date: February 3, 2015 and August 21, 2017
After corrections
Date: February 3, 2015 and August 21, 2017
Reminders
Summary by Sourcery
Add a new tropospheric correction method using local texture correlation, based on Yang et al.'s 2024 research. Update the configuration and workflow to support this method, and provide documentation for its usage.
New Features:
Enhancements:
Documentation:
Summary by Sourcery
Add a new tropospheric correction method using local texture correlation, based on Yang et al.'s 2024 research. Update the configuration and workflow to support this method, and provide documentation for its usage.
New Features:
Enhancements:
Documentation: