Bug #733

Mixing UTM data and UTM gmt projection in perspective view with psbasemap

Added by Fred about 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:2015-07-31
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.1.1 Platform:Mac OS X


I am trying to plot 3D perspective views of a seamount from various angles using both UTM and latlon annotations (as in example 28 from the GMT Historical collection - http://gmt.soest.hawaii.edu/doc/5.1.0/gallery/ex28.html#example-28).

To specify each coordinate system I am using two psbasemap calls, specifying the desired annotation with -B commands and perspective view with -p. However, while this works ok from some angles, there is an 180° range over which the UTM annotations plot upside-down whereas latlon equivalents flip into correct orientation.

Would it be at all possible to fix this so that the both types of annotation plot in a consistent orientation across for all azimuths/perspectives?

See attached plots and code below for illustration of issue:


for ((j=0; j<=3; j++)); do
a_arr=(45 135 225 315)
gmt psbasemap -R${gfold}/Seamount1_50m_merge.grd -Ju56J/1:500000 \
-Bpx0.05f0.025g0.05 -Bpy0.1f0.05g0.1 -BNE --FONT_ANNOT_PRIMARY=10p -V $p -K -P -Xc -Yc > $ps
gmt psbasemap -R${gfold}/Moreton_50m_redone_merge_extadj.grd+Uk -Jx1:500 $p -BWS \
":8:000m" -Bpy10g5+u":6:000m" -Jz0.00075c -V --FONT_ANNOT_PRIMARY=10p \
gmt ps2raster $ps -Tf -E720 -A -P
open ${pfold}/basemap_${a_arr[$j]}_35_test.pdf

basemap_315_35_test.pdf (6.66 KB) Fred, 2015-07-31 08:01

basemap_135_35_test.pdf (6.86 KB) Fred, 2015-07-31 08:01

basemap_225_35_test.pdf (6.92 KB) Fred, 2015-07-31 08:01

basemap_45_35_test.pdf (6.71 KB) Fred, 2015-07-31 08:01

Moreton_50m_redone_merge_extadj.grd (972 KB) Fred, 2015-07-31 13:19


#1 Updated by Paul about 6 years ago

Could you please post the command for one of the failing angles, e.g., 45, and show me what -R -J etc are so I can build a test script that demonstrates the problem?

#2 Updated by Fred about 6 years ago

For latlon psbasemap the command is:
gmt psbasemap -R680095/712095/7105528/7140578 -Ju56J/1:500000 \
-Bpx0.05f0.025g0.05 -Bpy0.1f0.05g0.1 -BNE --FONT_ANNOT_PRIMARY=10p -V -p45 > $ps

The same region (-R680095/712095/7105528/7140578) applies for the UTM psbasemap command:
gmt psbasemap -R${gfold}/Moreton_50m_redone_merge_extadj.grd+Uk -Jx1:500 -p45 -BWS \
:8:000m" -Bpy10g5+u":6:000m" -Jz0.00075c --FONT_ANNOT_PRIMARY=10p \

but it will not plot unless I specify the region in -Rgrdfile+Uk format as above; if I use"-R680095/712095/7105528/7140578+Uk" the error message I receive is:
psbasemap: Syntax error -R option. Correct syntax:
Append r if giving lower left and upper right coordinates
-Rg or -Rd for global domain
-R<grdfile> to take the domain from a grid file

I can attach the gridfile if that would be helpful?

#3 Updated by Paul about 6 years ago

  • Status changed from New to In Progress

Sure, please to to make sure I get the test right.

#4 Updated by Fred about 6 years ago

Gridfile attached.

Many thanks!

#5 Updated by Paul about 6 years ago

  • Status changed from In Progress to Resolved
  • Assignee set to Paul
  • % Done changed from 0 to 100

Should be working now in r14671. Thanks for pointing it out and helping with the test.

#6 Updated by Remko about 6 years ago

  • Status changed from Resolved to Closed

Closed by verification

Also available in: Atom PDF