Skip to content

Commit

Permalink
Only give annoying -p message if elevation is not 90 (#8041)
Browse files Browse the repository at this point in the history
We dont need to get

image [WARNING]: The -p option works best in consort with -J (and -R or a grid)

for simple rotations about z.  This PR restricts that message to el < 90.
  • Loading branch information
PaulWessel authored Nov 15, 2023
1 parent 5737716 commit 274eb0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2817,8 +2817,6 @@ GMT_LOCAL int gmtinit_parse_p_option (struct GMT_CTRL *GMT, char *item) {

if (!GMT->common.J.active) {
gmt_set_missing_options (GMT, "J"); /* If mode is modern and -J exist in the history, and if an overlay we may add these from history automatically */
if (!GMT->common.J.active)
GMT_Report (GMT->parent, GMT_MSG_WARNING, "The -p option works best in consort with -J (and -R or a grid)\n");
}
switch (item[0]) {
case 'x': GMT->current.proj.z_project.view_plane = GMT_X + GMT_ZW; l++; break;
Expand Down Expand Up @@ -2874,6 +2872,8 @@ GMT_LOCAL int gmtinit_parse_p_option (struct GMT_CTRL *GMT, char *item) {
else
GMT->common.p.z_rotation = az;

if (!GMT->common.J.active && el < 90.0)
GMT_Report (GMT->parent, GMT_MSG_WARNING, "The -p option works best in consort with -J (and -R or a grid)\n");
return (error);
}

Expand Down

0 comments on commit 274eb0d

Please sign in to comment.