Skip to content

Commit 609507a

Browse files
seismangithub-actions[bot]
authored andcommitted
pssac: Use Cartesian projection by default unless -S is used (#4088)
For most GMT modules, if -J is not given, GMT uses -JX15c for Cartesian data, and -JQ15c for Geographic data. pssac can either plot seismograms as time series (Cartesian data) or plot seismograms on maps (Geographic data). Currently, pssac always uses -JQ15c when -J is not given. Plotting seismograms as time series gives the following error: ``` gmt sac seis.SAC -R9/20/-2/2 -Baf -Fr -Gp+gblack -Gn+gred -pdf single sac [ERROR]: -S option is needed in geographic plots. ``` because GMT sets the default -JQ15c. But for geographic plots, -S (controling the waveform time scaling) is required. Obviously, the -JQ15c is the wrong choice. This PR fixes the issue. In this PR, pssac always use Cartesian projection, unless -S is used. All tests still pass. With this PR, the command ``` gmt sac seis.SAC -R9/20/-2/2 -Baf -Fr -Gp+gblack -Gn+gred -pdf single ``` plots seismograms using -JX15c, and command (with -S option) ``` gmt sac *.z -R-120/-40/35/65 -Baf -M1i -S300c -pdf map ``` plots seismograms on maps, using -JQ15c.
1 parent c4495d3 commit 609507a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gmt_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13314,7 +13314,8 @@ GMT_LOCAL bool gmtinit_is_region_geographic (struct GMT_CTRL *GMT, struct GMT_OP
1331413314
if (!strncmp (module, "pscoupe", 7U)) return true;
1331513315
if (!strncmp (module, "psmeca", 6U)) return true;
1331613316
if (!strncmp (module, "pspolar", 7U)) return true;
13317-
if (!strncmp (module, "pssac", 5U)) return true;
13317+
/* pssac: Cartesion by default, unless -S option is used */
13318+
if (!strncmp (module, "pssac", 5U) && (opt = GMT_Find_Option (GMT->parent, 'S', options)) != NULL) return true;
1331813319
if (!strncmp (module, "psvelo", 6U)) return true;
1331913320
if (!strncmp (module, "mgd77track", 10U)) return true;
1332013321
if (!strncmp (module, "grdpmodeler", 11U)) return true;

0 commit comments

Comments
 (0)