Bug #671

grdrotater bug?

Added by Gabriel over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:2015-02-05
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:



I was trying to rotate a bouguer anomaly grid from Africa using the following commands:

gmt grdrotater af_bouguer.grd -Erotfile.txt -T120.4 -S -Faf_contour.txt -Vv > af_rot_contour.txt
gmt grdrotater af_bouguer.grd -Erotfile.txt -T120.4 -Faf_contour.txt -Gaf_rot.grd -Vv

where rotfile.txt contains:

-34.2000 50.8000 120.400 -53.6900

While the first line correctly changed the contour position, the second one didn't work as expected (see wrong.png attached)

I then ran the following command, using the same pole:

gmt grdrotater af_bouguer.grd -e-34.2/50.8/-53.69 -Faf_contour.txt -Gaf_rot.grd

which worked well (correct.png). Shouldn't these lines have produced the same results?

(forgot to say: I am running it on linux, v. 5.1.2_r14035)

wrong.png (49.6 KB) Gabriel, 2015-02-05 11:41

correct.png (149 KB) Gabriel, 2015-02-05 11:41

egm2008_africa.grd - original grid (2.41 MB) Gabriel, 2015-02-06 19:12

rotated_wrong.grd - wrong, using -E -T (386 KB) Gabriel, 2015-02-06 19:17

rotated_correct.grd - correct, using -e (1.14 MB) Gabriel, 2015-02-06 19:17

Associated revisions

Revision 14082
Added by Paul over 2 years ago

Fix issue #671


#1 Updated by Paul over 2 years ago

  • Status changed from New to Feedback

Could it be possible for you to post the af_bouguer.grd, or if not, post the output of grdinfo af_bouguer.grd so I know what domain the file cover?

#2 Updated by Gabriel over 2 years ago

Here is the grdinfo output (egm2008_africa.grd is the same as af_bouguer.grd):

egm2008_africa.grd: Title: Data gridded with continuous surface splines in tension
egm2008_africa.grd: Command: surface -T0.25 -Gegm2008_africa.grd -R-20/55/-37/40 -I5m
egm2008_africa.grd: Remark:
egm2008_africa.grd: Gridline node registration used [Cartesian grid]
egm2008_africa.grd: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
egm2008_africa.grd: x_min: -20 x_max: 55 x_inc: 0.0833333333333 name: x nx: 901
egm2008_africa.grd: y_min: -37 y_max: 40 y_inc: 0.0833333333333 name: y ny: 925
egm2008_africa.grd: z_min: -286.292175293 z_max: 407.717895508 name: z
egm2008_africa.grd: scale_factor: 1 add_offset: 0
egm2008_africa.grd: format: netCDF-4 chunk_size: 129,133 shuffle: on deflation_level: 3

#3 Updated by Paul over 2 years ago

  • Status changed from Feedback to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Thanks, fixed this bug. Will now also correctly report the rotation in the gridfile remark regardless of how the rotation is specified. In r14082.

#4 Updated by Paul over 2 years ago

Gabriel, did you verify that things work for you after the fix?

#5 Updated by Paul over 2 years ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF