Skip to content

grdmath [ERROR]: Cannot use -I together with -R<gridfile> #8987

Closed

Description

@anbj

Very brief; I'll give more detail if necessary.

grdmath complains about giving -I when I never did.
grid.tif just contains a bounding box in UTM coordinates.

$ gmt grdmath -Rgrid.tif 0 = trash.nc

$ gmt grdmath -Rgrid.tif 1 trash.nc ADD = trash.nc
grdmath [ERROR]: Cannot use -I together with -R<gridfile>

Activity

  1. added
    bug
    on Apr 17, 2026
  2. joa-quim commented on Apr 20, 2026

    @joa-quim
    Member

    I don't think this is a bug. When when use -R, we are setting both the region and the increment.

  3. anbj commented on Apr 21, 2026

    @anbj
    ContributorAuthor

    Ok, but it gives the impression that I, the user, gave an -I, so a bit confusing. Closing then.

  4. joa-quim commented on Apr 21, 2026

    @joa-quim
    Member

    Yes, confusing and don't see why setting that constrain. Removed it in #8994

  5. anbj commented on Apr 21, 2026

    @anbj
    ContributorAuthor

    Edit: Forget this! I forgot to build from the PR.

    Hmm, still getting (and now better bug report)

    # create dummy grid
    $ gmt grdmath -I1 -R0/10/0/10 0 = grid.nc
    
    # make new grid based on grid.nc
    $ gmt grdmath -Rgrid.nc 0 = trash.nc
    
    # test
    $ gmt grdmath -Rgrid.nc 1 trash.nc ADD = trash.nc
    grdmath [ERROR]: Cannot use -I together with -R<gridfile>
    
  6. joa-quim commented on Apr 21, 2026

    @joa-quim
    Member

    grdmath [ERROR]: Cannot use -I together with -R

    Can't be. I removed those lines from code.

  7. anbj commented on Apr 21, 2026

    @anbj
    ContributorAuthor

    Yes - I forgot to build from the PR, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions