Book contents
- Frontmatter
- Contents
- Preface
- Acknowledgements
- 1 Introduction
- 2 The SAC data format
- 3 The SAC processing philosophy
- 4 Basic SAC commands
- 5 SAC macros
- 6 Accessing SAC functionality and data from external programs
- 7 Graphical data annotation
- 8 Array data handling
- 9 Spectral estimation in SAC
- 10 Three-dimensional data in SAC
- 11 Implementation of common processing methodologies using SAC
- Appendix A Alphabetical list of SAC commands
- Appendix B Keyword in context for SAC command descriptions
- References
- Index
- Plate Section
6 - Accessing SAC functionality and data from external programs
Published online by Cambridge University Press: 05 October 2013
- Frontmatter
- Contents
- Preface
- Acknowledgements
- 1 Introduction
- 2 The SAC data format
- 3 The SAC processing philosophy
- 4 Basic SAC commands
- 5 SAC macros
- 6 Accessing SAC functionality and data from external programs
- 7 Graphical data annotation
- 8 Array data handling
- 9 Spectral estimation in SAC
- 10 Three-dimensional data in SAC
- 11 Implementation of common processing methodologies using SAC
- Appendix A Alphabetical list of SAC commands
- Appendix B Keyword in context for SAC command descriptions
- References
- Index
- Plate Section
Summary
Despite the broad range of utility that SAC provides, at times it may be necessary to use external applications to augment its capabilities. In addition, it is sometimes desirable to access the functionality of SAC without interacting manually with the program, for example to include it in a longer processing workflow. In this chapter we will describe techniques and give examples of how to achieve both these ends.
Note that details of the languages and applications for which examples are shown are beyond the scope of this book. The reader should seek more specialized books for that material.
AUTOMATING SAC EXECUTION
Running SAC from the shell
Executing SAC
While a decent amount of batch processing is possible within SAC using its built-in macro language (see Chapter 5), it is often useful (for example, to access functionality built into the operating system) to run SAC using scripting languages provided by the shell (under UNIX-like environments, examples include bash and tcsh).
One way is by using startup files (see Section 4.10). After the commands in it are executed, SAC then enters interactive mode. Because (usually) there is no need for an interactive phase when scripting, it is helpful to make the last line a QUIT command to terminate SAC and allow control to return to the shell.
- Type
- Chapter
- Information
- The Seismic Analysis CodeA Primer and User's Guide, pp. 64 - 73Publisher: Cambridge University PressPrint publication year: 2013