Thread: Re: sac patches are being prepared

Started: 2009-09-16 00:49:15
Last activity: 2009-09-16 00:49:15
Topics: SAC Help
Arthur Snoke
2009-09-16 00:49:15
There have been some traffic on sac-help about SAC bugs. Brian Savage has
found fixes and is preparing patches for some of these. I give a list
below. I also describe a bug and a fix I found in the utility program
sgftops. As this program is a "stand-alone" program (does not require
anything more than a compile/install line), I give the patch at the end.

The current plan is to send IRIS the patches to post on the SAC software
Web site in a month or so. Please share with sac-help any other bugs you
find (and solutions, if you find them).

Arthur Snoke

Here is the list of problems for which Brian has patches

- do file wild (Arthur Snoke )
- Q appears on component name ( Bob Hancock )
- segy read on 64 bit machines ( Gilberto Saccorotti )
- getline() conflicts with libc.a, Fedora 11 Only ( Derek Schutt )
- beginwindow 2 fails ( Susan Bilek )
- vertical plane rotations ( George Helffrich )

- Python code for read sac files ( Sebastian Heimann )
- Debugging facilities, command line option --gdb-debug


On several newer operating systems, all lines on .ps files produced by
sgftops have the minimum possible line thickness. Operating systems
include (at least some) Linux systems, Mac OS5 and OS6. If these .ps
files are converted to PDF files or (on the MAC) read into an application
like Preview, they print with the "normal" line thicknesses. (The program
has a switch for changing the base line thickness. However, this switch
has no effect on these operating systems.)

The fix is quite simple: moving one line

fprintf(ofp, "\n%d setlinewidth", base_width);

down several lines so that it is now after rescaling.

Here is the diff file produced comparing the new (sgftops.c) and old

--- sgftops.c 2009-09-12 18:02:29.000000000 -0400
+++ sgftops_090505.c 2009-05-05 13:44:17.000000000 -0400
@@ -9,8 +9,6 @@
* sgftox.csh: Script (using gs) produces screen plot.
- * 20090912: snoke<at> moved setlinewdith from prologue.
- * problem with some print drivers that did not see
* 20090505: snoke<at> added endian check. If inconsistent,
* 20090311: rwg<at> prevented the output of redundant "move"
* "setrgbcolor" commands; other cleanups
@@ -260,6 +258,7 @@

base_width = (int)(15 * width_in);
+ fprintf(ofp, "\n%d setlinewidth", base_width);
fprintf(ofp, "\n");
fprintf(ofp, "%%%%EndProlog\n");
fprintf(ofp, "%%%%Page: 1 1\n");
@@ -319,8 +318,6 @@
/* set the scale flag on or off */
if (argc > 5 && strncmp(argv[5], "no", 2) == 0)
scale_flag = FALSE;
- fprintf(ofp, "\n%d setlinewidth", base_width);

/* look for colortable file */
ict = 0;

09:25:41 v.ad6b513c