insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
618 stars 260 forks source link

Add `tropo_local_texture.py` for tropo correction (Yang et al., 2024) #1291

Open Yohcy opened 2 weeks ago

Yohcy commented 2 weeks ago

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: image

Before corrections Figure_1_-_timeseries_ramp_demErr_wrap10 png Date: February 3, 2015 and August 21, 2017 Figure_1

After corrections Figure_1_-_timeseries_tropolocaltexture_wrap10 png Date: February 3, 2015 and August 21, 2017 Figure_2

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:

welcome[bot] commented 2 weeks ago

💖 Thanks for opening this pull request! Please check out our contributing guidelines. 💖 Keep in mind that all new features should be documented. It helps to write the comments next to the code or below your functions describing all arguments, and return types before writing the code. This will help you think about your code design and usually results in better code.

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This 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 process

sequenceDiagram
    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 method

classDiagram
    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

Change Details Files
Added new tropospheric correction method using local texture correlation
  • Created new module for local texture-based tropospheric correction
  • Implemented slope estimation using texture correlation
  • Added slope interpolation for full-scale coverage
  • Implemented intercept filtering for final correction
src/mintpy/tropo_local_texture.py
src/mintpy/cli/tropo_local_texture.py
Updated configuration system to support the new correction method
  • Added 'local_texture' as a new tropospheric correction method option
  • Added configuration parameters for window size and overlap ratio
  • Set default values for new parameters (window size: 141, overlap ratio: 0.4)
src/mintpy/defaults/smallbaselineApp.cfg
src/mintpy/defaults/smallbaselineApp_auto.cfg
Integrated new correction method into existing workflow
  • Added support for local texture method in timeseries filename generation
  • Updated tropospheric delay correction workflow to handle the new method
src/mintpy/smallbaselineApp.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
codeautopilot[bot] commented 2 weeks ago

PR summary

This 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 tropo_local_texture.py, aims to improve the accuracy of tropospheric delay corrections by leveraging high-frequency texture to estimate local slopes. The PR updates the configuration files and workflow to support this new method and includes documentation for its usage. The changes are expected to enhance the precision of InSAR data analysis by providing an alternative correction method that can be particularly useful in heterogeneous environments.

Suggestion

  1. Ensure comprehensive testing of the new method across various datasets to validate its effectiveness and robustness.
  2. Consider adding more detailed comments and documentation within the code to facilitate understanding and future maintenance.
  3. Evaluate the performance impact of the new method, as the additional computations for local texture correlation might increase processing time.
  4. Provide a comparison of results with existing methods to highlight the improvements or differences achieved by the new approach.