MintPy icon indicating copy to clipboard operation
MintPy copied to clipboard

add support for InSAR Explorer

Open mahmud1 opened this issue 8 months ago • 2 comments

Description of proposed changes

save_explorer.py implemented to convert time series and velocity to GRD files compatible with QGIS InSAR Explorer plugin (https://insar-explorer.readthedocs.io/). The documentation is updated accordingly.

Reminders

  • [x] Pass Pre-commit check (green)
  • [x] Make sure that your code follows our style. Use the other functions/files as a basis.
  • [x] If adding new functionality, add a detailed description to the documentation and/or an example.

Summary by Sourcery

New Features:

  • Adds a new command-line tool save_explorer.py to convert time series and velocity data to GRD files for use with the QGIS InSAR Explorer plugin.

mahmud1 avatar Mar 11 '25 12:03 mahmud1

šŸ’– 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.

welcome[bot] avatar Mar 11 '25 12:03 welcome[bot]

Reviewer's Guide by Sourcery

This pull request introduces a new tool, save_explorer.py, to convert MintPy time series and velocity data into GRD files compatible with the QGIS InSAR Explorer plugin. It also includes comprehensive documentation on how to use the new tool and integrate MintPy with the QGIS InSAR Explorer plugin for enhanced visualization of displacement time series.

Sequence diagram for save_explorer.py execution

sequenceDiagram
    participant User
    participant save_explorer.py
    participant readfile.py
    participant save_gmt.py

    User->>save_explorer.py: Executes save_explorer.py with input files and options
    save_explorer.py->>readfile.py: Reads mask file (optional)
    alt velocity file provided
        save_explorer.py->>readfile.py: Reads velocity file
        save_explorer.py->>save_explorer.py: Converts velocity data to mm
        save_explorer.py->>save_gmt.py: Writes velocity data to GRD file
    end
    loop for each timeseries slice
        save_explorer.py->>readfile.py: Reads timeseries data for slice
        save_explorer.py->>save_explorer.py: Converts timeseries data to mm
        save_explorer.py->>save_gmt.py: Writes timeseries data to GRD file
    end
    save_explorer.py-->>User: Completion message

File-Level Changes

Change Details Files
Implemented a new command-line tool save_explorer.py to convert time series and velocity data into GRD files, which are compatible with the QGIS InSAR Explorer plugin.
  • Added a new command-line tool save_explorer.py in the mintpy.cli module.
  • Implemented the core logic for converting time series and velocity data to GRD format in the mintpy.save_explorer module.
  • Added argument parsing and handling for input files (time series, velocity, mask) and output directory.
  • Included a function to convert the unit of displacement from meter or centimeter to millimeter.
  • Implemented masking functionality to handle masked data points.
  • Integrated the new tool into the main mintpy command-line interface.
src/mintpy/__main__.py
src/mintpy/cli/save_explorer.py
src/mintpy/save_explorer.py
pyproject.toml
Updated the documentation to include instructions on how to use the new save_explorer.py tool and integrate MintPy with the QGIS InSAR Explorer plugin.
  • Added a new documentation page insar_explorer.md with detailed instructions on setting up QGIS and the InSAR Explorer plugin.
  • Documented the usage of save_explorer.py for converting MintPy results to GRD files.
  • Included instructions on how to load and visualize the exported data in QGIS using the InSAR Explorer plugin.
  • Added a reference to the InSAR Explorer plugin in the QGIS.md documentation page.
  • Updated the mkdocs.yml file to include the new insar_explorer.md page in the navigation menu.
docs/QGIS.md
mkdocs.yml
docs/insar_explorer.md

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. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the 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 exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard 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 for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Mar 11 '25 12:03 sourcery-ai[bot]

šŸŽ‰ šŸŽ‰ šŸŽ‰ Congrats on merging your first pull request! We here at behaviorbot are proud of you! šŸŽ‰ šŸŽ‰ šŸŽ‰

welcome[bot] avatar Jul 06 '25 14:07 welcome[bot]

Thank you @yunjunz for reviewing and approving the PR. I’m glad to hear that you found InSAR Explorer easy to use.

mahmud1 avatar Jul 06 '25 15:07 mahmud1