Re: Rotating a grid

Remko Scharroo <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Hi Michael.

Probably the easiest way is the write out the grid to ascii, flip the x and y, and change the sign of one of the coordinates.

For example, if you have a grid.nc on the domain -R0/100/0/200 with spacing 1/2, then rotating 90º counterclockwise:

$ grd2xyz grid.nc | awk ‘{print -$2,$1,$3}’ | xyz2grd -R-200/0/0/100 -I2/1 -Gnewgrid.nc

With GMT5 you can even avoid using awk:

$ grd2xyz grid.nc | xyz2grd -R-200/0/0/100 -I2/1 -Gnewgrid.nc -i1s-1,0,2

Regards,
Remko

On 23 Nov 2013, at 19:07, Michael Anenburg <[email protected]> wrote:

> I have a grid with xy coordinates (not geographic, cartesian) and I want to rotate it 90 degrees, or find some way to display it rotated using grdimage.
> grdrotater does not seem like the solution I need, or maybe it is - I just don't know how to adapt it for cartesian coordinates.
> Any ideas?
> 
> Michael.                                         
> 
> To unsubscribe, send the message "signoff gmt-help" to [email protected]
> 

To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.