TABLE OF CONTENTS
OVERVIEW
Starting in version 102.0, SAC is capable of viewing and downloading event, station, and response metadata and downloading waveforms from online Web services. These abilities include
- event searches ( EVENT )
- station searches ( STATION )
- data: searches and downloading ( DATA )
- applying station and/or event meta-data to data ( METADATA )
- reading miniseed directly into SAC ( READ )
- download instrument responses ( RESPONSE )
- traveltime data using the the IRIS Traveltime Web Service ( TRAVELTIME )
Definitions
- Currently (2020), as described on the IRIS DMC Web Service Web page
- miniSEED is the subset of the SEED standard that is used for time series data. Very limited metadata for the time series is included in miniSEED beyond time series identification and simple state-of-health flags. In particular, geographic coordinates, response/scaling information and other information needed to interpret the data values are not included.
- FDSN StationXML is the XML-based standard for seismological metadata. These metadata contain the most important and commonly used structures of SEED 2.4 metadata with many enhancements.
- PH5 is the name of the repository at the IRIS DMC commonly used for active-source, controlled-source and mixed-source data sets and is an alternative to the DMC's SEED repository. In DATA, METADATA, and STATION ph5 is an option that when invoked will search this alternate repository.
Web requests are made to the colletion of Web Services at http://service.iris.edu along with event searches through the USGS and ISC.
An EventID is defined by source:uniqueid. See EVENT for more details.
Event search results, EVENT, can be used as input for timing and location in DATA and STATION searches using assocaited EventID. Examples are given below.
The format for latitudes and longitudes is degrees.decimal-degrees. Longitudes run from -180.00 degrees to 180.00 degrees. The formats used for time are given at the end of this file.
For repeated calls to most SAC command in a single session, the program "remembers" previous values for options if not reset explicitly. That is not true for these commands; For any option not explicitly stated in each call, the default is assumed. If there is no default value for an option, it must be explicitly given.
The SAC convention for units differs from others such as EVALRESP and SEED that use SI units (meters, meters/sec, meters/sec/sec). SAC uses nm for displacement. As discussed in TRANSFER, unit conversions may be needed to convert output files from instrument-corrections to get consistency between the data and the SAC header parameter IDEP.
SACLST & SACSET: These two stand-alone programs allow one to parse (saclst) or modify the header or of one or more SAC files. They are analogous to the internal SAC commands LISTHDR and READHDR respectively. One can display the results on the screen, print them, or (for saclst) redirect the output into an application. See ${SACHOME}/utils/README_utils for more details. Examples are given below showing how saclst output can be redirected to applications.
TIME FORMATS
Times are of the form h:m:s or h:m:s.ms where h is the hour, m the minute, s the seconds, and ms the millisecodnds. If the time is left out, the beginning of the day is used, i.e. 00:00:00.000.
Dates are in the form Y-M-D or Y-O where Y is the year, M the month, D the day of the month, and O the day of the year (or ordinal day). Separators for the date components include /, ,, and -. Separators between the date and time is either a T or the date separator.
Date Only | Date and Time | Date and Time |
---|---|---|
Y/O | Y/OTh:m:s Y/O/h:m:s | Y/OTh:m:s.ms Y/O/h:m:s.ms |
Y-O | Y-OTh:m:s Y-O-h:m:s | Y-OTh:m:s.ms Y-O-h:m:s.ms |
Y,O | Y,OTh:m:s Y,O,h:m:s | Y,OTh:m:s.ms Y,O,h:m:s.ms |
Y/M/D | Y/M/DTh:m:s Y/M/D/h:m:s | Y/M/DTh:m:s.ms Y/M/D/h:m:s.ms |
Y-M-D | Y-M-DTh:m:s Y-M-D-h:m:s | Y-M-DTh:m:s.ms Y-M-D-h:m:s.ms |
Y,M,D | Y,M,DTh:m:s Y,M,D,h:m:s | Y,M,DTh:m:s.ms Y,M,D,h:m:s.ms |
Durations are of the form [+-]###unit where + is time forward and - is a time backwards from the reference time, unit are given below, and the ### is an integer value.
Duration | Abbreviations |
---|---|
Seconds | s sec secs seconds |
Minutes | m min mins minutes |
Hours | h hrs hours |
Days | d days |
Weeks | w wk wks weeks |
Months | mon months |
Years | y yr yrs years |
Decades | dec decades |
Centuries | cent centuries |
EVENT SEARCH
Broad search
Let's find all M \(\ge\) 9 earthquakes within the past century (100 years), assuming the date today is Oct-31-2019. This will search the USGS Earthquake catalog by default:
SAC> event time 2019-10-31 -100years mag 9 Origin Lat. Lon. Depth Mag. Agency EventID 2011-03-11T05:46:24 38.30 142.37 29.00 9.10 mww US/official - usgs:official20110311054624120_30 2004-12-26T00:58:53 3.29 95.98 30.00 9.10 mw US/official - usgs:official20041226005853450_30 1964-03-28T03:36:16 60.91 -147.34 25.00 9.20 mw iscgem/official - usgs:official19640328033616_30 1960-05-22T19:11:20 -38.14 -73.41 25.00 9.50 mw iscgem/official - usgs:official19600522191120_30 1952-11-04T16:58:30 52.62 159.78 21.60 9.00 mw iscgem/official - usgs:official19521104165830_30
Using the NOW keyword
Using the NOW keyword in place of the first date is useful in scripts so one does not have to explicitly enter today's date. Let's use NOW and also change the catalog to Global CMT:
SAC> event time now -100years mag 9 gcmt Origin Lat. Lon. Depth Mag. Agency EventID 2011-03-11T05:47:32 37.52 143.05 20.00 9.10 MW GCMT/- GCMT gcmt:3279407 2004-12-26T01:01:09 3.09 94.26 28.60 9.00 MW GCMT/- GCMT gcmt:1916079
Note that the results from Global CMT, compared to the USGS, do not have the older events and the prefix for the event id is also different.
Narrow search
If we are interested in a particular event, an event time window, or depth range, that can be specified directly:
SAC> event time 1994/1 1994/365 mag 8 depth 600 1000 usgs Origin Lat. Lon. Depth Mag. Agency EventID 1994-06-09T00:33:16 -13.84 -67.55 631.30 8.20 mw US/HRV - usgs:usp0006dzc
STATION SEARCH
Rectangular Search in a Network
Looking for available stations is straightforward by using a region, network name, station name and channels. Here we only use a small region and the network IU:
SAC> station region -130 -110 45 48 net IU Warning: Multiple instances of net.sta, likely mutiple epochs Net Sta Lat. Lon. Elev. SiteName IU RAIO 46.0403 -122.8851 1.00 Rainier, Oregon, USA
Radial Search with a time window in a Network
If a particular time range or distance range is of interest, that may be specified as well:
SAC> station network IU channel ?HZ time 2011-03-11 1day radial 30 35 origin 143.05 37.53 Net Sta Lat. Lon. Elev. SiteName IU ADK 51.8823 -176.6842 130.00 Adak, Aleutian Islands, Alaska IU BILL 68.0653 166.4531 320.00 Bilibino, Russia IU DAV 7.0697 125.5791 150.00 Davao, Philippines IU MIDW 28.2156 -177.3698 20.00 Midway Island, USA IU TIXI 71.6341 128.8667 40.00 Tiksi, Russia
Using an EventID
The previous search was for stations operating during the 2011 Tohoku event with an epicentral distance 30 and 35 degrees. This search can be simplified by using and event id:
SAC> event mag 9 time 2011/1 +1y gcmt Origin Lat. Lon. Depth Mag. Agency EventID 2011-03-11T05:47:32 37.52 143.05 20.00 9.10 MW GCMT/- GCMT gcmt:3279407 SAC> station net IU cha ?HZ gcmt:3279407 radial 30 35 Net Sta Lat. Lon. Elev. SiteName IU ADK 51.8823 -176.6842 130.00 Adak, Aleutian Islands, Alaska IU BILL 68.0653 166.4531 320.00 Bilibino, Russia IU DAV 7.0697 125.5791 150.00 Davao, Philippines IU MIDW 28.2156 -177.3698 20.00 Midway Island, USA IU TIXI 71.6341 128.8667 40.00 Tiksi, Russia
DATA SEARCH
Data for 1 hour after event origin
Once the event or time range and stations are identified, downloading data is straight forward. First, the event is determined; here we use the 1994 deep Bolivian event and a station named DOOR. Data requests need to specific where the data should be placed; this includes miniSEED for directly saving the miniSEED files, SAC for converting the miniSEED files into SAC binary format, and READ for placing the data directly into memory. Any combination of these options can be used. We also specify the duration of the data be downloaded using the DURATION option:
SAC> event time 1994/160 1d mag 8 gcmt Origin Lat. Lon. Depth Mag. Agency EventID 1994-06-09T00:33:45 -13.82 -67.25 647.10 8.20 MW GCMT/- GCMT gcmt:369471 SAC> data sta DOOR cha BHZ gcmt:369471 duration +1h ## REQUEST 1/ 1 DATACENTER=IRISDMC,http://ds.iris.edu XE DOOR -- BHZ 1994-06-09T00:33:45 1994-06-09T01:33:45 No Data Downloaded, use miniseed, sac, or read to download data SAC> data sta DOOR cha BHZ gcmt:369471 dur +1h read Data Center: IRISDMC,http://ds.iris.edu SourceID Start sample End sample Gap XFDSN:XE_DOOR__B_H_Z 1994-06-09T00:33:45.012000 1994-06-09T01:33:44.912000 == Working on file: XE.DOOR..BHZ.M.1994.160.003345.sac [ OK ]
Data download using a station file
If a stations file exists, data for these can be directly downloaded. Let's create the stations file, then download the data. We also save the data request using the OUT parameter in DATA, then immediately use that request file
Create a station file call net_BK.txt:
SAC> station net BK region -125 -110 30 40 sta B*,C* out net_BK.txt Warning: Multiple instances of net.sta, likely mutiple epochs Net Sta Lat. Lon. Elev. SiteName BK BABI 36.5158 -120.8530 571.20 Babies Gulch, near Pinnacles National Park, USA ... BK CVS 38.3453 -122.4584 295.10 Carmenet Vineyards, Sonoma, CA, USA
Create a request file from the station file:
SAC> data time 2010,235T00:00:00 1hr in net_BK.txt cha BHZ out net_BK_request.txt Reading station file: net_BK.txt ## REQUEST 1/ 1 DATACENTER=NCEDC,http://www.ncedc.org BK BDM -- BHZ 2010-08-23T00:00:00 2010-08-23T01:00:00 ... BK CVS 00 BHZ 2010-08-23T00:00:00 2010-08-23T01:00:00 No Data Downloaded, use miniseed, sac, or read to download data
Use the request file to download data, this will automatically download to miniSSED:
SAC> data request net_BK_request.txt Data Center: NCEDC,http://www.ncedc.org Writing data to fdsnws.2019.10.25.18.01.01.NCEDC.mseed [956.00 KiB]
Magic incantations to get the most recent miniSEED file and read it. These can be avoided by using there READ option in DATA:
SAC> sc to FILE ls -rt *.mseed | tail -1 SAC> getbb FILE FILE = 'fdsnws.2019.10.25.18.01.01.NCEDC.mseed' SAC> read %FILE SourceID Start sample End sample Gap XFDSN:BK_BDM__B_H_Z 2010-08-23T00:00:00.010466 2010-08-23T00:59:59.985466 == XFDSN:BK_BKS__B_H_Z 2010-08-23T00:00:00.023145 2010-08-23T00:59:59.998145 == XFDSN:BK_BRIB_00_B_H_Z 2010-08-23T00:00:00.019538 2010-08-23T00:59:59.994538 == XFDSN:BK_BRK_00_B_H_Z 2010-08-23T00:00:00.019538 2010-08-23T00:59:59.994538 == XFDSN:BK_CMB__B_H_Z 2010-08-23T00:00:00.023616 2010-08-23T00:59:59.998696 == XFDSN:BK_CVS_00_B_H_Z 2010-08-23T00:00:00.019536 2010-08-23T00:59:59.994539 == SAC>
Applying metadata automatically
If data is downloaded and converted to sac binary or read into memory, SAC will try to insert metadata for the resulting data files.
SAC> data sta DOOR cha BHZ gcmt:369471 dur +1h read Data Center: IRISDMC,http://ds.iris.edu SourceID Start sample End sample Gap XFDSN:XE_DOOR__B_H_Z 1994-06-09T00:33:45.012000 1994-06-09T01:33:44.912000 == Working on file: XE.DOOR..BHZ.M.1994.160.003345.sac [ OK ] SAC> lh kevnm stlo stla evlo evla evdp FILE: XE.DOOR..BHZ.M.1994.160.003345.sac - 1 ---------------------------------------- kevnm = gcmt:369471 stlo = -6.722330e+01 stla = -1.935380e+01 evlo = -6.725000e+01 evla = -1.382000e+01 evdp = 6.471000e+02
Applying metadata manually
If data is downloaded without metadata, it is simple to insert that metadata using the METADATA command:
SAC> data sta DOOR cha BHZ time 1994-06-09T00:33:45 1h read Data Center: IRISDMC,http://ds.iris.edu SourceID Start sample End sample Gap XFDSN:XE_DOOR__B_H_Z 1994-06-09T00:33:45.012000 1994-06-09T01:33:44.912000 == Working on file: XE.DOOR..BHZ.M.1994.160.003345.sac [ OK ] SAC> lh kevnm stlo stla evlo evla evdp FILE: XE.DOOR..BHZ.M.1994.160.003345.sac - 1 ---------------------------------------- stlo = -6.722330e+01 stla = -1.935380e+01 SAC> metadata gcmt:369471 Working on file: XE.DOOR..BHZ.M.1994.160.003345.sac [ OK ] SAC> lh kevnm stlo stla evlo evla evdp FILE: XE.DOOR..BHZ.M.1994.160.003345.sac - 1 ---------------------------------------- kevnm = gcmt:369471 stlo = -6.722330e+01 stla = -1.935380e+01 evlo = -6.725000e+01 evla = -1.382000e+01 evdp = 6.471000e+02
INSTRUMENT RESPONSES
Responses for specific files is also simple with files read into memory. Responses can be obtained in sacpz or evalresp format.:
SAC> read XE.DOOR..BHZ.M.1994.160.003345.sac SAC> response sacpz Writing data to SAC_PZs_XE_DOOR__BHZ_1994-06-09T00:33:45_1994-06-09T01:33:44 [ 1.02 KiB] SAC> response evalresp Writing data to RESP.XE.DOOR..BHZ [ 49.80 KiB]
COMPUTING TRAVELTIMES
Traveltimes can also be retrieved and set using the traveltime Web Service at IRIS. Just specific the ONLINE keyword to the TRAVELTIME command:
SAC> data sta CMB net BK cha BHZ gcmt:369471 duration 1h read Data Center: NCEDC,http://www.ncedc.org SourceID Start sample End sample Gap XFDSN:BK_CMB__B_H_Z 1994-06-09T00:33:45.004000 1994-06-09T01:33:44.953000 == Working on file: BK.CMB..BHZ.D.1994.160.003345.sac [ OK ] SAC> traveltime online picks 0 phase ttall traveltime: depth: 647.100 km traveltime: setting phase P at 618.4500 s [ t = 618.4500 s ] t0 traveltime: setting phase PKIKKIKP at 1782.5400 s [ t = 1782.5400 s ] t1 traveltime: setting phase PKIKPPKIKP at 2280.2400 s [ t = 2280.2400 s ] t2 traveltime: phase PKIKPPKIKP truncated in kt2 traveltime: setting phase PKPPKP at 2277.7900 s [ t = 2277.7900 s ] t3 traveltime: setting phase PKiKP at 974.6000 s [ t = 974.6000 s ] t4 traveltime: setting phase PP at 789.5900 s [ t = 789.5900 s ] t5 traveltime: setting phase PcP at 632.6300 s [ t = 632.6300 s ] t6 traveltime: setting phase S at 1128.5800 s [ t = 1128.5800 s ] t7 traveltime: setting phase SKIKKIKP at 1935.6899 s [ t = 1935.6899 s ] t8 traveltime: setting phase SKS at 1160.1700 s [ t = 1160.1700 s ] t9 SAC> lh picks FILE: BK.CMB..BHZ.D.1994.160.003345.sac - 1 --------------------------------------- NPTS = 72000 B = -3.960000e-01 E = 3.599554e+03 OMARKER = -2.1458e-09 T0MARKER = 618.45 (P) T1MARKER = 1782.5 (PKIKKIKP) T2MARKER = 1997.2 (PKIKKIKS) T3MARKER = 2280.2 (PKIKPPKI) T4MARKER = 2277.8 (PKPPKP) T5MARKER = 974.6 (PKiKP) T6MARKER = 789.59 (PP) T7MARKER = 632.63 (PcP) T8MARKER = 1128.6 (S) T9MARKER = 1935.7 (SKIKKIKP) KZDATE = JUN 09 (160), 1994 KZTIME = 00:33:45.400
Teleseismic Traveltime Example
Given a region of interest to conduct a teleseismic traveltime experiment, first find the events 30 to 90 degrees from the region of interest, Hawaii (Lon: 158W, Lat: 20N). Here we only look for events within the last year and magnitude > 7 to limit the results, typically we use more expansive search parameters. As this uses a do loop, the commands need to be contained within a macro
% cat data.sm event mag 7 radial -158 21 30 90 usgs time now -1years to events outfile events_usgs_m7.xml do ev list %events message "Event $ev" mkdir $ev cd $ev station $ev cha BHZ outfile stations.txt region -161 -152 18 22 data $ev cha BHZ in stations.txt out request.txt duration 90m miniseed cd .. enddo % sac SAC> macro data.sm
This should result in a set of directories named with eventids containing a station file, the data request, and miniseed files to be unpacked. Miniseed files can be unpacked, metadata applied, and traveltime data set using:
SAC> sc to PWD "basename @$(pwd)" SAC> getbb PWD SAC> read *.mseed SAC> metadata %PWD SAC> traveltime online picks 0 SAC> write over
REDIRECTING SACLST INPUT
Let's say you have a list of sac files and you would like to generate a station list:
saclst knetwk kstnm stlo stlo stel f *.SAC | \ awk '{print $2,$3,$4,$5}' | \ sort | \ uniq > station_lists.txt
To make sure all event locations are consistent for a list of files:
saclst evlo evla evdp f *.SAC | awk '{print $2,$3,$4}' | sort | uniq
Find file that are too short in duration with the longest first:
saclst b e f *SAC | \ awk '{print $1,$2,$3,$3-$2}' | \ sort -nr -k +4
Or removing files that are too short in duration:
mkdir too_short for z in $( saclst b e f *SAC | awk '{if($3-$2<30.0){print $1}}' ) ; do mv $z too_short done
Or using xargs:
saclst b e f *SAC | awk '{if($3-$2<30.0){print $1}} | \ args -I args mv args too_short
RDSEED - End of Life
Before 2010, the majority of data analysis was done on data sets commonly exchanged as SEED volumes, which could be downloaded from the IRIS Data Management Center over the Internet. For the SEED manual, go to <http://www.fdsn.org/seed_manual/SEEDManual_V2.4.pdf>.
Program RDSEED is a legacy utility for reading SEED volumes. This utility allows the user to read the contents of the SEED file and convert it to many different output formats (including SAC), extracting the data, station information, or instrument responses from the file. Although SEED volumes remains the FDSN-approved file format for representing and distributing digital seismic data, RDSEED is End of Life and no longer supported at IRIS. It has now been made an open-source project on GitHub <https://github.com/iris-edu-legacy/rdseed>. For further details on RDSEED, go to <http://ds.iris.edu/ds/nodes/dmc/software/downloads/rdseed/5-3-1-eol/>.