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

grdmask with region '-Rg' not recognising longitudes more than 180 #8340

Open
JonathonLeonard opened this issue Jan 31, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@JonathonLeonard
Copy link

We are having a problem where grdmask is not recognising topologies that have a longitude between 180-360 when the region is set to '-Rg'. However it seems to work fine with region set it '-Rd'.

To demonstrate I have attached a folder with a script and a sample topology file:
grdmask_issue.zip

The topology file contained in the above file (test_topology.xy) defines three polygons- two that have longitudes <180 and one >180. For completeness, here is the contents of test_topology.xy:

> An example of a polygon that works fine with grdmask
0 0
0 -5
5 -5
5 0
0 0
> This works too
170 -20
170 -25
180 -25
180 -20
170 -20
> An example of a polygon between 181 and 360 that doesn't plot
189 -20
189 -25
194 -25
194 -20
189 -20

The below line of code will not recognise the polygon >180:

gmt grdmask -Rg test_topology.xy -I0.25 -N0/0/1 -r -Vd -GRg_flat_slab_mask.nc

While the below line will recognise all polygons:

gmt grdmask -Rd test_topology.xy -I0.25 -N0/0/1 -r -Vd -GRd_flat_slab_mask.nc

A work around would be to do the grdmask command with '-Rd' then use grdedit -S -Rg to have it back to the 0-360 longitude range, however I just thought I'd report this bug to see if anyone has any idea what's going on.

Actual outcome
Only polygons that exist within longitudes <180 will be masked by grdmask

Expected outcome
All polygons that exist from 0-360 longitude should be masked.

System information

  • Operating system: MacOS Monterey (on an M1 Apple Silicon Chip)
  • GMT version (gmt --version): 6.4.0
@JonathonLeonard JonathonLeonard added the bug Something isn't working label Jan 31, 2024
Copy link

welcome bot commented Jan 31, 2024

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

Please make sure you read our Contributing Guide and abide by our Code of Conduct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant