Seismology Resources and SAC/BRIS for MacOS X and other systems



Resources

SAC on MacOS X 10.3-10.9+

MacSAC (SAC/BRIS built for a Mac) runs on 10.3 (Panther), 10.4 and later systems. When installing on a 10.3 system (click on SAC.pkg), the Installer reports that SAC cannot be installed on your system. Ignore the warning by clicking "OK" in the dialog box, and then clicking on "Continue" in the Installer. The rest of the installation will proceed OK. When installing on a 10.4 or later system, download the package for PPC or Intel installs.

If you do a default install of SAC for the first time, you'll get a warning about the Installer needing to create the /usr/local directory. This is not an error, only information about a change to be made to the system. Acknowledge it and continue.

If you have other problems with installs, I would be interested to see the Installer log file to understand how to fix it. While in the Installer, choose File -- Show Log (10.2 & 10.3) or Window - Installer Log (10.4 & higher), and then Save or Print the result and send it to me (address at bottom of page).

SAC/BRIS, XML and gfortran/Fortran 90

SAC/BRIS is built with either the g77 or gfortran compilers, depending on the release. Unless you use the SAC I/O library routines to read and write SAC files, you don't need to worry about this. If you do write programs that manipulate SAC files, read on.

From release grh-108, the SAC library, libsacio.a, is multi-arch on Macs. It contains both 32- and 64-bit versions of the library routines. Consequently, building and linking external programs that read and write SAC files is simpler.

If you use the default install, a command like this will make the SAC libraries available to your program:

gfortran -o prog prog.f -lsacio
or
g77 -o prog prog.f -lg77-sacio
. If you do not use the default install, you will need to tell your compiler where the SAC libraries reside. To do this use the -L option. For example, if your SAC libraries are located in /sw/lib (as the files called /sw/lib/libsacio.a or /sw/lib/libg77-sacio.a), then invoke the compiler as follows:
gfortran -o prog prog.f -L/sw/lib -lsacio
.

If you use the subroutine interface in the SAC library to handle SAC XML datasets, you must also include the MacOS CoreServices framework (one of the system libraries) for parsing the markup language. Link them with your program like so:

gfortran -o prog prog.f -lsacio -framework CoreServices
or
g77 -o prog prog.f -lg77-sacio -Wl,-framework -Wl,CoreServices
.

gfortran is now almost a replacement to g77. If SAC/BRIS is built with gfortran, a g77 version of the library will be available as /usr/local/lib/libg77-sacio.a for support of the older compiler. (If there is no file called libg77-sacio.a, then libsacio.a is built with g77.)

For historical reference, the linking instructions for older distribution of MacSAC follow.

MacSAC includes the SAC library, libsacio.a (originally just called sac.a), which you can link to your programs. There are 32- and 64-bit versions of the SAC library routines provided with SAC. gfortran, a free software replacement for the g77 compiler, is evolving to generating 64-bit code by default, so you need to be alert to this detail. Problems will show up when you try to link your files into an executable version of the program (when you use the -o option to create the executable), so there is never any danger of creating incorrect code, just puzzlement.

If you use the default install, a command like this will make the SAC libraries available to your program:

gfortran -m32 -o prog prog.f /usr/local/lib/libsacio-32.a (32-bit compiles)
or
gfortran -m64 -o prog prog.f /usr/local/lib/libsacio-64.a (64-bit compiles)
or
g77 -o prog prog.f /usr/local/lib/libg77-sacio.a (g77 is a 32-bit only compiler)
.

Buland and Kennett Tau-P

The Buland and Kennett tau-p routines are a suite of programs that calculate seismic wave travel times through a radial earth model specified as velocity as a function of depth. They use the methods described in Buland and Chapman (1983), BSSA 73, 1271-1302 to calculate tables of tau to quickly determine all arrivals at a particular range for an earthquake at a particular depth. The original package provided a command line interface to the tables, and tables for one model, iasp91 by Kennett and Engdahl (1991), GJI 105, 429-465.

The package is useful and versatile, but lacked tables for other wavespeed models and a simple, well-documented subroutine interface to the tables so that programs could take advantage of the rapid calculations the method affords. Consequently, I extended the package to include other earth models, defined a simple subroutine interface to it, and built a configuration-based compilation method that makes the program, subroutines and tables easy to build and install. The general changes are:

The current version's code may be downloaded here... (version 9, updated 14 June 2017). See the INSTALL file for installation instructions.

SAC Bug list and patches

This is a list of the bugs I have fixed in SAC. These fixes apply to version numbers 10.6d and 10.6f. Most of these were forwarded to the group at LLNL working on SAC, but at some point, the original Fortran code was automatically translated into the C version of SAC that LLNL and IRIS now distribute, SAC2000. Consequently, most bugs reported and fixed here also exist in IRIS's SAC. Check the log of changes to SAC2000 to see whether they've been fixed there.

I'm no longer distributing individual patches. A list of all the fixes is here.

Highlights in recent SAC/BRIS releases

Some previous releases are available through the release name in the list below. Changes potentially incompatible with previously-working SAC macros indicated in italics.

grh-113
Catalina-compatible (MacOSX 10.15 and later releases - no required 32 bit components). Downloads prior to 08:00 23 Oct. 2019 (GMT) contained utilities that could fail to run properly on some systems; re-install if you suspect problems.
SAVEIMG command implemented for compatibility with SAC2000. Virtually eliminates need for using SGF files to make publication-quality plots of SAC traces. PDF, Xfig, EPS and PostScript output available; see HELP SAVEIMG for details.
SYNCHRONIZE BEGIN option implemented for SAC2000 compatibility. See HELP SYNCHRONIZE for more details.
SAC will retain sub-millisecond resolution on any SAC, GSE, MSEED and GCF data read in. Not all internal operations will, so check your processing steps carefully if you require or rely on this resolution level.
MERGE command semantics expanded to be compatible with SAC2000. SAC is now able to take any collection of files and string them together into a continuous data stream. (This previously involved more user work to do.) See HELP MERGE for more details.
TRANSFER POLEZERO parses and handles EVALRESP pole-zero response descriptions properly. See HELP TRANSFER for more information.
SPECTROGRAM messages now pithier.
Clipping of trace data improved in time series plots with windows smaller than the sample interval.
READALPHA recovers gracefully from improperly-formatted input; previously this led to freeze-up of SAC.
PLOTRECORDSECTION record section plotting in landscape mode now works; it was inadvertently broken in the previous release, but portrait worked. Default trace selection/deselection documented better now, too.
PDF files produced from SGF files by sgftopdf are displayed correctly by Apple's Preview app now. Previously, raster images weren't rendered properly.
SAC's MAC device runs in 64 bit mode. Previously the app was 32 bit only and elicited complaints about being outdated on startup. The device will also terminate gracefully even if SAC doesn't (for any reason).
SAC's MAC device renders graphics much faster than it previously did -- now as fast as the X device.
Documentation for HILBERT and READ commands improved.
Various Y2K bugs fixed (nearly 20 years after the fact -- GULP), mostly involving leap year determination (2000 was not one, but SAC thought it was).
MacOS source builds are a bit easier, involving more appropriate default configuration choices.
grh-112
CUT N xxx option failed in some cases; now fixed, along with mis-formatted error messages.
CUTIM increases number of simultaneous allowed cuts.
SYNCHRONIZE command doesn't require data (only headers) to work.
FILTERDESIGN plots place impulse response peak at zero on graphical trace.
PPK fixed for windowing of multi-trace plots; previously worked only if cursor in topmost trace in window. Also fixed PPK to not change line styles in between different time windows.
P1 report of OFFSET in each trace plot made more concise.
Fixed clipping of plots at left and right margins.
Source code builds succeed on more system types (internal improvements).
grh-111
PPK RELATIVE implemented properly.
Plotting and picking of files with large numbers of points now possible. Previously SAC gradually lost time precision if point count was > 10**5 points, and wouldn't even properly plot magnified data if > 10**6 points (bug reported by Igor Stubailo).
Improve checking of IF/ELSEIF/ELSE/ENDIF nesting, and dangling ELSE/ENDIF.
BBFK default file name now matches documentation.
DIF command results in files of correct size (used to be one point too long; bug reported by Andy Nowacki).
Fix labels on FILTERDESIGN plots (bug reported by Milton Plasencia).
CORRELATE command trace length restrictions removed.
Read of files with wildcards from home directory possible, e.g. READ ~/FILE* will return files FILE* from your home directory. Previously, this would not return anything.
Reads of wildcarded files would not return the files in alphabetical order on some systems (MacOS 10.13 [High Sierra], in particular). Now alphabetical order is guaranteed (bug reported by James Wookey).
Distance and azimuth calculations improved for stations and events exactly at the poles(!).
Utility to convert SAC binary file formats (sactosac) fixed to handle XY files properly.
grh-110
Interplanetary SAC -- range calculations (distance, azimuth) provided for Sun, Mercury, Venus, Earth, the Moon, Mars. See HELP SETIHV for info.
Added built-in travel time tables (ss97) for Mars models (Sohl & Spohn, 1997).
TRAVELTIME command parsing improvement.
PLOTPK RELATIVE implemented.
Add spectral resolution to PSPE plots.
SEG-style SEGY files (with character and binary reel headers) now handled properly. PASSCAL-style SEGY files readable (bug reported by Doug Baumgardt).
CSS 3.0 files from CTBTO now handled properly (by recognizing format violations of CSS3.0 standard). Also can cope with s3/i3 data format.
BBFK bug fix (contributed by Yanlu Ma).
grh-109
Add ABOUT command for SAC2000 compatibility.
Add NULL command for SAC2000 compatibility; document it, too.
Improve parsing of DO command to relax syntax restrictions.
MAP command implemented for SAC2000 compatibility. See HELP MAP for details.
Graphical demo added for LINE and WIDTH commands.
SPECTROGRAM bug fixed - no blowup on zero trace segments if MLM and MEM used.
BEAM REFERENCE bug fixed -- spatial offsets calculated incorrectly.
BBFK bugs fixed -- polar plot labels improved, peak azimuth search over 0-360 degrees, TITLE parsing bug fixed.
WRITESP no longer writes corrupted files.
PRS finds travel time curve properly for portrait plot orientations.
Build numbers added to pre-release versions.
Bad numbers in pole/zero files now reported when encountered.
Macro lines and arguments may now be unlimited in length.
Relax restrictions on format of GSE2.0 files so that more file types may be successfully read by READGSE. See HELP READGSE for details.
Fix CSS file reading. READCSS now works with the .wfdisc file rather than the (more cumbersome) names of the data files. See HELP READCSS.
GCF file reading checks for time discontinuities and reports any found.
MSEED file reading improved; IEEE float data readable, single blockette files readable, endian checks more robust.
DELETECHANNEL command option EXCEPT added; see HELP DELETECHANNEL.
PLOTC bugs fixed (rarely-used border tick marks option handling).
RGLITCHES AVERAGE method implemented for SAC2000 compatibility.
Missing axis labels plotted when PLOT1 used with tick marks off.
Parsing bug fixed when unterminated blackboard variable at end of line used.
Fix bug in TRANSCRIPT command when ~/ used in transcript name (64 bit bug).
Fix bug in sactosac utility program (64 bit bug).
grh-108
64-bit executable. libsacio.a is now a multi-arch library, so only need to compile auxiliary programs with libsacio.a independent of whether they are 32- or 64-bit programs. 32- and 64-bit libraries retained for compatibility, though.
Macro variables can be expanded inside of a blackboard variable name. This makes it easier to create temporary variables in SAC macros. For example, expressions like "%$n$xxx%" will expand to a BB var called "5xxx" and its value will be retrieved, if macro variable n is 5. See HELP EXPRESSIONS for further info.
BEGINWINDOW n will explicitly display window n on the screen if it is not yet open.
Fixed PLOTRECORDSECTION documentation, clarifying REDUCED and ORIGIN.
XAPIIR routines available in libxapiir.a; see HELP XAPIIR for details. These let you access SAC's filtering routines from your own programs.
Travel time curves plotted more smoothly in PLOTRECORDSECTION.
Added surpport for EVALRESP version 3.3.3.
Hardware text in SGF files now decoded properly.
Some macro commands would fail on PPC builds; now fixed.
Fixed bug in 64-bit SAC I/O library. Use of rsac1, wsac0, etc. would result in undefined symbols (but 32 bit libraries were OK).
Note: SYSTEMCOMMAND TO ... didn't work for versions downloaded before 20:35 BST 11 Apr. 2012; now fixed.
grh-107
WRITE command option FILE N added to write out a single file in a collection of files in SAC memory. See HELP WRITE for details.
IMAGE command implemented for compatibility with SAC2000.
HELP and SYNTAX command descriptions given in a uniform Unix-like syntax. See HELP SYNTAX for a description.
CHNHDR accepts dates in year-month-day format rather than only in year-julian day format. See HELP CHNHDR for details.
APK bug fixed which led to corrupted output in HPF file.
Filtering bug fixed whereby some filter parameter combinations would lead to corrupt data traces. This generally involved long time series with high sample rates.
PLORECORDSECTION plotting in portrait mode implemented.
EVALUATE AS {FLOAT|INTEGER} documented. This is an original feature of SAC, but undocumented.
KSTCMP option on WRITE implemented for SAC2000 compatibility.
New functions implemented: CHANGECASE, EXISTBB, EXISTMV, QUOTEHV and QUOTEMV. See HELP EXPRESSIONS for details.
Travel time curves labeled on margin of record section plots in the SSS subprocess.
X- and Y-axis grids properly implemented; in some cases grid requests were ignored, or provided when not requested.
sgftoeps, sgftopdf and sgftops default to RGB colors. CMYK output available by command line option. Bounding box calculation also improved. See HELP UTILITIES.
64-bit library provided for SAC file and dataset I/O. Alternative versions available in lib/libsacio-64.a and lib/libsacio-32.a.
grh-106
HELP APROPOS will provide information about commands in other subprocesses, not just the current one.
MACRO command documentation improved to describe keyword and positional argument processing.
Restrictions on FFT sizes removed from many commands.
SYMBOL command documentation improved with graphical demo.
READCOR command implemented for compatibility with SAC2000.
SETDEVICE now reliably opens your default graphics device if used in startup file.
New line ornamentation options added to PLOTC: symbol choice, size, and spacing. See HELP PLOTC for table.
Reversed moveout curves now handled properly with SSS's TRAVELTIME TAUP command.
grh-105
CONVOLVE command implemented for compatibility with SAC2000.
TRAVELTIME TAUP command option implemented for compatibility with SAC2000.
New command option PREVIOUS implemented for ZCOLORS, ZLABELS, ZLINES and ZTICKS commands. For details, see online documentation for relevant commands.
Color output now possible from GRAYSCALE and SPECTROGRAM commands into SGF files for plotting as EPS, PDF and PS files. If the SGF device is active, the raster images for the displays will be placed there. Use the utility programs sgftoeps, stftopdf, etc. to print them or incorporate them into plots for publication.
SAC's utility programs (sgftoeps, sgftopdf, etc.) are also documented in the online help. See HELP UTILITIES for info.
New command line utility program provided: sachdrinfo. This extracts information from SAC file headers to be used in shell scripts. See online documentation for HELP UTILITIES.
Improved documentation for WINDOW and CONTOUR commands. Now supplied with graphical demos. See HELP WINDOW and HELP CONTOUR for details.
You don't need gfortran for parallel operation use, which was a restriction in the previous release (and grh-105 versions downloaded before 09:00 22 Mar 2010 GMT).
grh-104
Parallel SAC. SAC/BRIS will use all N available CPUs on your multi-processor machine to operate on files in memory, leading to a factor of N reduction in processing of large datasets. Commands affected: INTERPOLATE, DECIMATE, RMEAN, RTREND, TAPER, ROTATE, REVERSE, STRETCH, SMOOTH, QUANTIZE, RGLITCHES, RQ. You must have gfortran installed on your computer for SAC to work. If not, use the previous version. This requirement will be removed in a future distribution.
Minor bug fixes in ROTATE, QUANTIZE and SMOOTH commands. ROTATE would not work properly if vertical component rotations were larger than 180 degrees. QUANTIZE would not recognize the gain list provided. SMOOTH did not set data bounds after smoothing, leading to incorrectly framed plots.
grh-103
Major feature additions to SSS subprocess: phase weighted stacking, Nth root stacking, and jackknife stack uncertainty estimation. Also facility for selective trace stacking: traces may individually be left out of a stack. See HELP SUMSTACK for information.
New expression functions: (STATUS GRAPHICS), (HDRVAL VV AZ x PM y), (HDRNUM VV AZ x PM y). The first queries presence of open graphics window. Remaining two query whether value of header variable VV is an azimuth of x +/- y for all files in memory. The comparisons work across arbitrary azimuth branch cuts. HDRVAL returns all VV values satisfying the criterion; HDRNUM returns the file numbers. Intended for use with selective stacking in SSS.
Graphical demonstrations for various commands added: TAPER, SYMBOL, GTEXT, BEGINFRAME/ENDFRAME, PLOT1, PLOT2, BANDPASS, HILBERT, XVPORT, YVPORT, PLOTC. See HELP for individual commands for activating the demo.
New suite of commands to query SAC internal state: REPORT TO xxx fff ggg ... transfers REPORT output to blackboard variable "xxx" of fff and ggg facilities so that SAC settings can be interrogated and reset. Principally for use in macro scripts. See HELP REPORT for information.
WIDTH command documented -- affects widths of lines drawn in graphics displays.
PREVIOUS options added to many more commands: COLOR, WIDTH, SYMBOL, TITLE, QDP, XLABEL, YLABEL, VSPACE, XVP, YVP. See individual command documentation for details.
TRANSFER command options to yield velocity or acceleration rather than displacement. TRANSFER documentation also improved. See HELP TRANSFER.
Explicit comment command "*". This may be used at the command-line level (unlike the previous limitation to inside macros). Also allows comments to be introduced following each line for better macro/command documentation. Example:
       message "Azimuth &1,az&" ;* Report trace azimuth
Here, the text following the semicolon is a comment.
grh-102
READ GCF implemented to read GCF data; see HELP READ for information.
RTREND TERSE implemented to control output verbosity; BB variables set. See HELP RTREND for information. Junk at the end of the RTREND command was ignored previously, whereas now it is parsed for content. This may cause some previously functioning, but incorrectly written macros to fail.
READ MSEED implemented to read MSEED data; see HELP READ for information.
FILEID PREVIOUS implemented; see HELP FILEID for information.
Bug fixed in PLOTRECORDSECTION using the M pick option.
Bug fixed in color incrementing that led to invisible traces.
Uninstaller made into proper application to prevent varying behavior with AppleScript.
grh-101
SAC file write list syntax extended to allow catenations/alternations. Thus, if three files are in memory, WRITE /tmp/hold.[e,n,z] will write them all.
Window resizing bugs for native Mac windows fixed; now behaves like X.
Reading of GSE 2.0 format files implemented. See HELP READGSE for information.
Reading of SEG-Y format files implemented. See HELP READ for information.
Long command names parsed incorrectly. SAC used to only use the first 8 characters of a command to determine a command name. Some SSS commands are not unique in this length; possibly some macros will fail if long command names were used in them.
SSS TRAVELTIME command provides iasp91, ak135 and sp6 travel times; PLOTRECORDSECTION TTIME ON implemented. See HELP TRAVELTIME and HELP PLOTRECORDSECTION in the SSS subprocess.
Automatic picks with APK will have '*' added to the pick name in KA or KT0. Pick file format unchanged, however.
grh-100
SAC help information is searchable. Use HELP APROPOS xxx to find any command name or description that contains the string xxx. See 'help help' for more information.
Faster drawing on native Mac windows. Many efficiency improvements to speed up plots to the native Mac device.
New command ENDWINDOW will close an open window under user control. BEGINWINDOW and ENDWINDOW provide the symmetric functionality of opening and closing windows under user control.
Wild card file name matching made reliable. Previously, matches in directories with many files would fail.
GSE format file writing implemented (reading -- not yet). See 'help writegse'.
REPORT EVALRESP reports EVALRESP version used for instrument correction.
Fixed problems with the SAC Uninstall script in the distribution package.
Note: Downloads before 19:30 GMT 2 Dec. 2008 contain a cursor position bug; download again and re-install for fix. Thanks to James Wookey for reporting it.
grh-99
SAC help information documents user-callable library routines: rsac1, rsac2, wsac0, wsac1, wsac2, setfhv, setihv, setkhv, setlhv, setnhv, getfhv, getihv, getkhv, getlhv, getnhv. See 'help', 'help library' and help for individual routine names.
New library routines for interrogating, reading and writing SAC XML datasets: qsacxml, rsacxml, wsacxml.
SAC library is now sacio.a; it used to be called sac.a. It is located in /usr/local/lib/sacio.a (by default). gfortran and g77 versions available; g77 version is g77-sacio.a.
Bug report: QDP OFF hangs SAC in this version; temporary workaround is to use QDP 10000 (or some other big number). Will be fixed in the next release.
grh-98
Restored functionality of some of the sgf utilities (sgfmerge, sgflist, sgfplot, etc.) which would crash with a "Bus error" on startup (problem reported by Y. Park, Penn State).
Implement PREVIOUS option for more commands: AXES PREVIOUS, TICKS PREVIOUS, LINE PREVIOUS, YLIM PREVIOUS. Restores previous setting before last previous change; useful inside of macros to temporarily change behavior. See 'help axes' etc. for full documentation.
Allow END to be first argument to SUBSTRING macro function. See 'help expressions'.
Fix bug in function processing that introduced a blank after every function expansion. This meant that, for example,
message "(CONCATENATE A B)(CONCATENATE C D)"
would print "AB CD " whereas now it will print "ABCD".
Fix bugs in line color list handling: 1) first color ignored; 2) first color skipped, second color repeated.
Updated punctuation in various command descriptions provided by the 'help xxx' command.
grh-97
Now can handle EVALRESP instrument responses -- see 'help transfer'.
Multi-trace SAC datasets can be placed into and retrieved from a single file (in XML format). The datasets can even be located on remote servers, accessible via a URL. See the dataset options documented in 'help read' and 'help write'.
(For a demonstration of XML dataset capabilities, try:
  • Copy (with `curl' or `wget') https://www1.gly.bris.ac.uk/MacSAC/korea.mac to your local machine and save it as e.g. /tmp/korea.mac:
    curl https://www1.gly.bris.ac.uk/MacSAC/korea.mac > /tmp/korea.mac
  • Start SAC and open a graphics device, then issue these commands:
  • read ds https://www1.gly.bris.ac.uk/MacSAC/korea.sds
  • macro /tmp/korea.mac
which will show you all 753 HiNet stations that recorded the 9 Oct. 2006 North Korean nuclear test.)
READ ALPHA option implemented -- see 'help read'.
WINDOW command now places native mac windows in correct place on desktop when opened.
Added new option to the SAC file byte-swapping utility sactosac to force conversion to SAC/BRIS format (-m; type 'sactosac -help' for usage).
grh-96
Fix bug in GRAYSCALE plots using X11 (resulted in crash).
MORE synonym for ACTIVE in BEGINDEVICES. See 'help begindevices'.
RMEAN now works for files with many data points and a large DC offset.
Fully document BEAM and BBFK commands; fix bug in BEAM leaving BEAM in memory; annotate BBFK polar plot with radial values.
Check XYZ file structure correct while reading.
Relax MERGE command checks to ignore gaps less than DELTA/2.
Document FIR file format ('help FIR').
Implement NEWHDR options for ADDF, SUBF, MULF and DIVF.
grh-95
XYZ files are now viewable as raster images (as opposed to contour plots). You can also define your own color maps to plot XYZ colors. See 'help color' and 'report color' for the rastered data options reported there.
(The commands to create this plot were:
fg seismogram; spectrogram xyz; ylim 0 20
beginframe; grayscale color; contour; endframe
The plot is a XYZ rendering of spectrogram overlaid by a contouring of the same data.)
LINEFIT command implemented for compatibility with SAC2000.
FILTERDESIGN FILE output option implemented, infinities removed in computed group delays at zero frequency.
ROTATE bug fixed causing horizontal components not to be recognized as horizontals (only on Intel machines; a compiler problem).
grh-94
(Intel versions downloaded before 5 Nov. 2006 might not run unless you have g77 working on your system; present version avoids this requirement. PPC installs are OK in all versions.)
Tiger installs simplified by using the Installer. PPC and Intel downloads available.
Native Mac graphics does not require X11: type 'bd mac'. Gets you high-quality anti-alias graphics rendering. Active window shown in title bar. See 'help begindevices'.
Command line history saved when you quit SAC, restored when you restart. See 'help transcript'.
New macro functions: GETVAL, ITEMS. Gets value in trace at particular time, and gets a range of blank-delimited items from input line. See 'help expressions' for more details.
LISTHEADER prompt changed for multi-page output. Shows possible choices.
grh-93
Native Mac graphics ('help begindevices'), though still slow.
PDF files directly from SAC graphics (.sgf) files; see the sgftopdf program:
Usage: sgftopdf [-t|-d|-w n|-v] sgffile [pdffile]
-t - interpret line style as thickness
-d - interpret line style as dash type
-w n - multiply line widths by n
-v - report version information
sgffile - SGF file name with or without .sgf suffix
pdffile - optional PDF file, sgf file with .pdf suffix if omitted
Smaller payload for use of library routines (rsac1, wsac1, etc.) Code condensed to achieve this results in smaller programs if you include them from lib/sac.a and call those routines from your own programs.
SAC window number now in title bar of X graphic window; windows condensed.
New macro line functions to query header variables based on range, to parse blank-delimited tokens from a string, and to retrieve the number of files in active memory: (HDRVAR H OP X ...) (ITEM N A B C ...) (STATUS NFILES) See 'help expressions' for details.
Bounding boxes calculated properly for all files produced by sgftoeps.
grh-93beta (never a default download)
Beta release - uses Mac windows, not X11. Type "BEGINDEVICE MAC" and you have a MacOS graphics window. (Graphics is not as fast as X11, but looks better; performance remedies under study). Feedback welcome; bugs likely.
grh-92
Mostly maintenance release. Fixes help info, adds new FUNCGEN IMPSTRING options; see 'help funcgen'.
grh-91
PREVIOUS option added to following commands for ease of use in macros, to temporarily set and then reset parameters: CUT, XLIM, WIENER, RGLITCHES, RMS, MTW. See help for each command.
SGFTOPS line width setting sometimes ignored by printers; now fixed.
Document GETTIME and SUBSTRING functions; see 'help expressions'.
Minor bug fixes in input processing, memory release, GETTIME function.
grh-90
Click on red go-away display window button no longer terminates SAC.
PRINT option for some commands broken since grh-88; now operational.
PLOTRECORDSECTION graphical interaction improvements:
  • Improved pick algorithms to handle stair-step data.
  • V during moveout curve definition prints apparent velocity of segment.
  • R redraws screen, erasing error messages.
  • Picks marked on traces.
Numerical instability in DIST/GCARC calculation for latitudes near zero fixed.
REPORT reports CUTERR; CUTERR PREVIOUS implemented.
Wrong file name reported if file header bad.
User callable routines in sac library RSACH(file,nerr) WSACH(file,nerr) to read and write file headers.
grh-89
Improved PLOTRECORDSECTION graphical interaction to define moveout curve; otherwise only invisible, internal, maintenance-related changes to grh-88.
grh-88
Major improvements to graphical interactions with record sections in PLOTRECORDSECTION: magnify traces and narrow trace display ranges; select traces for further processing; automatic picking of traces along graphically-defined moveout curves.
WHILE READ bbvar x y z ... - new syntactical construct to parse blank-separated strings broken up into input lines (Unix commands, or record section graphical interactions).
SYSTEMCOMMAND TO bbvar - places output of system command in blackboard variable for processing by SAC macro (with WHILE READ, notably).
BEGINDEVICES ACTIVE/BEGINDEVICES PREVIOUS - to push and pop active devices for use in macros.
SSS remembers static delays upon reentry to SSS subsystem.
Stricter checking of expression syntax in IF commands - may cause previously-working SAC macros to fail with syntax errors.
FUNCGEN IMPSTRING implemented.
Added help for SAC expressions: help expressions.
grh-87
Improved parsing of SAC macro text: $..$ and %..% variables may be nested inside &...& variables which may be nested inside functions (xxx ...). Function brackets recognized as delimiters for $..$, %..%, &..& variables too, meaning that (abs &1,depmax) is no longer a syntax error.
(Yet another) DELETECHANNEL bug that crashed SAC fixed.
Help/news text knows about actual window size for paging.
YLIM syntax errors reported instead of silently ignored.
WIENER MU [ON|OFF|v] implemented.
Syntax errors in &...& variables reported better.
grh-86
Maintenance release. Most changes internal to simplify distributing future versions.
Formal release of new SGF file translation tool: sgftoxfig. Converts SGF files to Xfig for making publication-quality seismogram displays.
Usage: sgftoxfig [-t|-d|-w n|-v] sgffile [xfigfile]
-t - interpret line style as thickness
-d - interpret line style as dash type
-w n - multiply line widths by n
-v - report version information
sgffile - SGF file name with or without .sgf suffix
xfigfile - optional Xfig file, sgf file with .fig suffix if omitted
grh-85
Bug fixes to grh-84, and provide for MacOS X 10.4 (Tiger) installs.
sgftoxfig provided.
Another bug fixed in $RUN command processing.
Filled traces not properly drawn if clipped at left and right sides of the window (e.g. some traces displayed with LINE FILL x/y used).
DELETECHANNEL sometimes crashed SAC; now it won't.
sgftoeps/sgftops produced wrong PostScript for very long traces.
sgfplot reports its version and behaves responsibly if EOF given.
separate install script for MacOS X 10.4 (Tiger) because 10.2 packages are not compatible with the 10.4 installer.
grh-84
Bug fixes to grh-83.
$RUN command expansion of $-, %-, &-variables sometimes wrong.
Delimited string macro arguments not passed correctly into macro (missing trailing delimiter). Warning: This fix might reveal latent bugs in string manipulation inside macros (using reply, concatenate, etc.). SAC does not make thorough checks that delimited strings end with a delimiter - the end of a function ("(xxx ...)") will usually terminate an unterminated string which may hide a potential syntax problem.
grh-83
Implement PRINT option for CONTOUR, PLOT, PLOT1, PLOT2, PLOTPM, BEGINFRAME, PLOTRECORDSECTION commands.
Many commands with logical ON|OFF selections now accept ON|OFF|PREVIOUS to restore previous state of option, which provides for a way for SAC macros to set and restore features for specialized processing/display in a macro. See help for BORDER, COMCOR, LINE, LOGLAB, PRODUCTION, SPEID, XFULL, YFULL.
PLOTDY help.
Bugs fixed in sgftops and sgftoeps that led to invalid or incorrect PostScript to be produced for some SGF files.
sgftops usable as a filter (SGF read from standard input, PostScript written to standard output). Type sgftops for info (in usage report).
Fixed ARRAYMAP scale occasionally being wrong or not plotting stations.
Smaller memory use (static tables eliminated).
grh-82
Full help for SPE and SSS (some commands omitted previously).
DELETECHANNEL command added (see 'help deletechannel' for info).
Faster pattern matches (of type xxxx[r,t,z]) in large directories.
$RUN command can safely include pipes.
Stricter syntax checking on ELSE, ENDIF, ENDDO commands.
Macro aborts inside IF and DO structures won't lead to further errors.
grh-81
Hardware text improvements.
SPE and SSS subprocess help, documentation for BANDPASS.
Changeable color tables - see `help color' for info.
grh-80
New feature: Area-filled traces. See images below and type `help line' in SAC for more info.
Expand $-, %-, &-variables in $RUN command text.
Warning: This may cause some macros using $RUN to fail if @ isn't used to escape those characters.
Improve line clipping at edges of plot window.
Fix formatting in online documentation for XVPORT, YVPORT, FILTERDESIGN, READSP.
grh-79
Bug fix to grh-78 - use of pattern match for a file in an alternate directory (e.g. READ /tmp/A12*BHZ) left you in that directory afterwards.
Fix online documentation for RQ, QUANTIZE and TRANSFER commands.
grh-78
MTW bug - if window extends beyond trace, crash.
Fixed obscure problems with escaped % and & symbols in text.
Use of hardware text in SGF files improved.
Upside-down text problems on Linux/PC platforms fixed.
Add PLOTC text file parameter-setting commands to documentation.
SGF file format compatibly extended to support hardware text alignment.
sgftoeps - bug occasionally causing bad EPS files fixed.
grh-77
Fixed upgrade problems when using Installer. Added help text for IF command.
grh-76
Bug fix to sgftops, inadvertently broken in grh-75 by hardware text change.
grh-75
BBFK bug fixes, TRANSFER command modified to allow 2**32 point trace manipulation, GTEXT state reported properly by REPORT command.
Merged sgftoadobe and sgftoeps; sgftoadobe retired to code heaven.
Selection of ``hardware text'' for SGF files results in PostScript font use, handy for producing production-quality figures of SAC seismograms.
grh-74
Bug fix in calculating CORRELATE cmd max window length.
Make space and tab equivalent characters to prevent SAC choking on macros modified by editors that change multiple spaces to tabs.
Fix error reporting in CUTIM command, and bugs: 1) did not set file count in dataset right when making multiple cuts; 2) cut began one point too late in data; 3) zero filling before/after data didn't work right if CUTERR FILLZ on.
grh-73
Fix fatal bug in DECIMATE command; implement TRANSFER FAP subtype.
grh-71
CUTIM command implemented. READCSS command implemented in bug-free form.
grh-69
Rest of command line not ignored any more following a macro invocation.
grh-67
Wild card file name matches work better (but not perfectly).
grh-63
Max 1000 files in memory simultaneously.
grh-61
No limit on file size (other than your computer's memory).
grh-60
SPECTROGRAM command implemented with color output.
grh-58
Online help (start with "help commands")
grh-33
Line editing/re-entry like modern Unix shell input (bash/tcsh), meaning that left-, up-, down- and right-arrows move cursor for typing over commands or retrieving old commands from your scrolling buffer.

Comments or complaints to

George Helffrich