Skip to content
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 support for InSAR Explorer #1330

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mahmud1
Copy link

@mahmud1 mahmud1 commented Mar 11, 2025

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

  • Pass Pre-commit check (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • 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.

Copy link

welcome bot commented Mar 11, 2025

💖 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.

Copy link

sourcery-ai bot commented Mar 11, 2025

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
Loading

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mahmud1 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a test case to verify the functionality of the new save_explorer.py script.
  • It would be helpful to include a note about the expected data format (e.g., GeoTIFF, HDF5) for the mask file.
Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

mahmud1 and others added 5 commits March 11, 2025 13:39
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant