Lesson 1-2: The SAC data format

Similar documents
STP, Unix, SAC tutorial, Ge167 Winter 2014

Practice of Seismic Analysis Code

SOD 3.0. Standing Order for Data A product of the University of South Carolina pro bono publico

Contents: Download WinQuake Version 2.8. Update: 7/10/2006

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Java Oriented Object Programming II Files II - Binary I/O Lesson 3

Binary Codes. Dr. Mudathir A. Fagiri

User s Manual SeisOpt Picker Version 1.5

Computer Networks A Simple Network Analyzer Decoding Ethernet and IP headers

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19

Number Systems. Both numbers are positive

External Data Representation (XDR)

These notes are designed to provide an introductory-level knowledge appropriate to understanding the basics of digital data formats.

CS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #3: Of Integers and Endians (pt. 2)

CHAPTER 5 A Closer Look at Instruction Set Architectures

Why Don t Computers Use Base 10? Lecture 2 Bits and Bytes. Binary Representations. Byte-Oriented Memory Organization. Base 10 Number Representation

2-1. i. The SAC command ii. Reading and wri,ng data iii. Plo1ng and windowing iv. Picking travel-,mes v. Header manipula,on

Site Effects Assessment Using Ambient Excitations SESAME WP06

Basic SeismicHandler Introduction

SMARTOffline v3.5. User s Guide. Offline Data Retrieval and Conversion Tool. Copyright Geotech Instruments, LLC Dallas, Texas

NAME rdseed Read an FDSN SEED format volume. SYNOPSIS rdseed -{aclssrtdoxzei} [-f filename] [v (n)]

Why Don t Computers Use Base 10? Lecture 2 Bits and Bytes. Binary Representations. Byte-Oriented Memory Organization. Base 10 Number Representation

Computer Organisation CS303

Data Representation and Binary Arithmetic. Lecture 2

Input File Syntax The parser expects the input file to be divided into objects. Each object must start with the declaration:

ECE4110 Internetwork Programming. Introduction and Overview

CSCI 402: Computer Architectures. Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI.

fida.bcfm Basis Components File Management

UNIT 7A Data Representation: Numbers and Text. Digital Data

IFREE data center: Seismological data archiving and distributing system

ESc101 : Fundamental of Computing

SaneSeisA Ian Vincent Oct 2015 Updated 18-Oct2015 A proposed seismic acquisition file format

Chapter 20 Network Layer: Internet Protocol 20.1

RSEIS: Seismic Time Series Analysis in R

FLOATING POINT NUMBERS

Reflection Seismic Processing

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Geogiga Seismic Pro 9.0 Release Notes

MACHINE LEVEL REPRESENTATION OF DATA

M1 Computers and Data

Computer Architecture

ECE331: Hardware Organization and Design

Session 16. Process-Oriented Data Handling

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Virtual Machines and Dynamic Translation: Implementing ISAs in Software

Lecture Notes: Floating-Point Numbers

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Introduction to Computer Use II

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Signed umbers. Sign/Magnitude otation

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

(the bubble footer is automatically inserted in this space)

Few reminders and demos

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

PS User Guide Series Utility

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

Basics: accessing SAC func1onality and data from external programs

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

Floating Point Arithmetic

Pretty-printing of kernel data structures

Bits and Bytes. Why bits? Representing information as bits Binary/Hexadecimal Byte representations» numbers» characters and strings» Instructions

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

Page 1. Where Have We Been? Chapter 2 Representing and Manipulating Information. Why Don t Computers Use Base 10?

12: Memory Management

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

CS311 Lecture: The Architecture of a Simple Computer

Bits, Words, and Integers

Team 1. Common Questions to all Teams. Team 2. Team 3. CO200-Computer Organization and Architecture - Assignment One

SeaSonde Radial Site Release 6 Reduced CrossSpectra File Format Apr 19, 2009 Copyright CODAR Ocean Sensors

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

LabVIEW Basics I: Introduction Course

ECE331: Hardware Organization and Design

Lecture 11: Networks & Networking

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Basic data types. Building blocks of computation

CHAPTER 5 A Closer Look at Instruction Set Architectures

Reduced Cross Spectra File Format

CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES.

CS101 Lecture 04: Binary Arithmetic

Introducing WinQuake 2.5

Chapter 2. Data Representation in Computer Systems

Numerical Precision. Or, why my numbers aren t numbering right. 1 of 15

Instruction Sets: Characteristics and Functions

Assembler. Lecture 8 CS301

ECE 122 Engineering Problem Solving with Java

MIB BROADCAST STREAM SPECIFICATION

Internal Data Representation

RadExPro seismic software for 2D/3D data QC and infield processing

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Representation of Non Negative Integers

Computer Architecture

unused unused unused unused unused unused

RPC Interface Specification November 2001 Introduction

Digital Fundamentals

Computer Networks A Simple Network Analyzer PART A undergraduates and graduates PART B graduate students only

ASDF Definition. Release Lion Krischer, James Smith, Jeroen Tromp

BINARY SYSTEM. Binary system is used in digital systems because it is:

Transcription:

Lesson 1-2: The SAC data format i. Philosophy and structure ii. Converting to, within, and from SAC format

Lesson 1-3: SAC processing philosophy SAC has a complete set of reliable and welltested processing elements to document, view, process, transform, and save data and results. Given this abundant set of elements, how does one typically process seismic data? This lecture will describe general approaches to getting the desired information from a seismogram collection.

Processing philosophy Organize - standardize/prepare data for analysis Interact - selection portion of waveform to operate on Process - calculate property / estimate parameter / transform data Display - graphically show result of processing to verify / validate

Organize Standardize file names e.g. for vertical component data from station XYZ, want all data in files called XYZ.aabbcc.BHZ best done with shell scripts of Unix commands group three component data (ENZ, 123) as XYZ.aabbcc.BHE, XYZ.aabbcc.BHN, XYZ.aabbcc.BHZ

Organize Add relevant event information (origin time, lat, lon, depth, magnitude) Add component orientation if mis-oriented or not standard Cut data to common time window and length or merge fragments to usable length Deglitch (now rare but historical data has them) Decimate/interpolate to common sample rate

Organize (cont.) Remove instrument response / standardize to common response Remove data mean, trend Filter appropriately (low, high, or bandpass) Add travel time picks Preview and winnow bad data traces... Write as SAC binary files; uniform format, uniform structure, different data.

Interact Generally graphical interaction with data (though need not be). Graphical interactions are quick and less error prone than typing; preferred. Types of interactions: Data QC (quality control) - discard noisy/ unsuitable traces Pick time window for analysis Pick signal onset

Interact (cont.) Interaction graphical, but desired information is numeric. Save graphical pick results as numbers (usually time offsets) for processing step. Choices: in memory in the trace header information (will be saved as in SAC file with data) external file For QC use, save either good file names, bad file names (or both)

Process Heart of analysis process. Usually specialized external program that SAC file is passed. Good programs: produce text output (for debug or info purposes) produce graphical output (for validation). Processing might also use SAC internal analysis elements (spectrum estimation, stacking, waveform picking, trace sample arithmetic).

Display Best confirmation of proper behavior of processing step is graphical output for validation / results. Display should follow processing step External program, if used, must produce a SAC output file that can be read by SAC for display

Useful commands for processing steps Organizing data Change data in file headers: CHNHDR Cut/merge data to common length: CUT, CUTIM, MERGE Common time base: CHNHDR ALLT, SYNCHRONIZE Deglitch: DEGLITCH Remove mean and trend: RMEAN, RTREND Tapering: TAPER Filter: LOWPASS, HIGHPASS, BANDPASS Instrument response: TRANSFER

Useful commands for processing steps (cont.) Organizing data (more) Add traveltime picks: TRAVELTIME (SSS) Preview and winnow: PLOT1, MESSAGE, SETBB with (REPLY...) Writing data: WRITE Interacting with user Graphical interactions: PLOTPK, PLOTRECORDSECTION / PRS (SSS) Text interactions: MESSAGE, SETBB with (REPLY )

Useful commands for processing steps (cont.) Process Invoke Unix command/external program: SYSTEMCOMMAND, $RUN $ENDRUN SAC processing facilities: SPE subprocess, SSS subprocess, APK Display Graphical interactions: PLOTPK, PRS (SSS) Text interactions: MESSAGE, SETBB with (REPLY )

More information about SAC commands Start with SAC> help commands List of all commands (overwhelming) SAC> help apropos XXXX List of commands with XXXX in their description Then SAC> help YYYY Help for command YYYY Use web search engines http://www.iris.edu/software/sac/commands/func_commands.html

Philosophy and structure SAC file: one file, one trace Trace consists of a fixed-length header, and variable length of data (determined by header information) Binary and character (alphanumeric) formats Data is either numerical (integer and real), logical (true/false), categorical (explosion source, nuclear source, earthquake source), or character (station code, event ID, arrival name)

Philosophy and structure (cont.) Alphanumeric data format intended for ease of writing and transfer between machine types not widely used for processing due to need to convert to binary form for SAC operations header data organized into sections, each section subdivided into lines alphanumeric is data is text (.txt), not RTF or Word files (NOT.rtf or.doc)

Philosophy and structure (cont.) Binary format for efficient reading and writing Binary information in header and data portions of file: signed 32 bit integers, IEEE floating point real numbers HUGE historical mistake in defining header format: no way to determine whether bigendian (Sun SPARC/Power PC) or little-endian (DEC/Intel) format leads to MANY errors in user-written SAC file processing programs (will teach strategies to avoid them)

Converting to and from SAC format SAC alphanumeric to binary SAC> read alpha afile SAC> write binary bfile SAC binary to alphanumeric SAC> read binary bfile SAC> write alpha afile

Converting to and from SAC format (cont.) GSE (Group of Scientific Experts) AutoDRM format to and from SAC To SAC: SAC> readgse gfile SAC> write sfile From SAC SAC> read sfile SAC> writegse gfile Some information is lost in translation (multiple event origins, picks >10 in number)

Converting to and from SAC format (cont.) One way conversions available (convert other format to SAC): CSS (Center for Seismic Studies) MSEED (mini-seed IRIS/PASSCAL format) GCF (Guralp Compressed Format) Read in, then view/process/write as SAC files (or discard) Converting CSS data (separate command) SAC> readcss cfile Converting MSEED data (variant of READ command) SAC> read mseed mfile Converting GCF data (variant of READ command) SAC> read GCF gfile

Converting to and from SAC format: Binary format and endian-ness Binary data formats have endian considerations to be aware of: storage order of binary data Endian example: Arabic numerals The number 137 is represented as 1x10 2 + 3x10 1 + 7x10 0 big-endian writing order is 1 3 7 (largest base-10 multiple first) little-endian writing order is 7 3 1 (smallest base-10 multiple first; not used with arabic numbers, but with some linguistic representations of numbers, e.g. German 24 is vier und swanzig literally 4 and 20)

Converting to and from SAC format (cont.) Binary data grouped in 8-bit quantities called bytes (base 256) represented as 2 hexadecimal (base 16) digits 0-9,A-F (A=10, B=11, F=15) As 1 byte number, 137 is hexadecimal 89 8x16 1 + 9x16 0 As 4 byte big-endian binary integer, 137 is 00 00 00 89 As 4 byte little-endian binary integer, 137 is 89 00 00 00

Converting to and from SAC format using custom programs Need to know three things to properly encode/ decode binary numbers: actual endianness of input data desired endianness of output data endianness of computer processing the data It is complicated! - confuses most people (even programmers) Computer endianness: Sun/Power PC computers - big-endian DEC/Intel computers - little-endian

Converting to and from SAC format using custom programs SAC binary file endianness No established convention (another design mistake!) SAC2000 will read any endianness SAC file and will write file with machine endianness MacSAC reads and writes big-endian SAC files ONLY Conversion tool (sactosac) provided to convert ANY file endianness to big-endian sactosac -m bfile...

Converting to and from SAC format using custom programs How to avoid endianness problems when writing your own tools for data conversion Convert to alphanumeric format, then SAC Use subroutine packages that are fully cognizant of endianness and convert data using them SAC programming library provides these routines (in sacio.a library; see help library in SAC)