Click To Go To PSU Geophysics Home

Note: This is an old page, the best way to do this now is to use the USGS NEIC web site. I haven't deleted this page because the example shell script and awk command examples may be useful.

Searching For Earthquake Locations

The US Geological Survey publishes locations of earthquakes that occur throughout the globe. We have a the hardcopy of the Preliminary Determination of Epicenters in the copy room and eventually they will be moved to the library. We also have a set of the basic location data online and a simple program to search these files. The hard-copies for recent years have additional information such as moment tensors, first motion plots, and maps.


The Earthquake Hypocenter Files

The PDE files are in the directory /geo/GeoData/PDEs/Data/p____. Early data are collected into three files, later data are collected in one file for each year. The file p9999 contains the data from the recent weekly PDEs. In general, the release of the monthy PDEs takes about 9-10 months.

File Name
Time Span
p1899
1643-1899
p1949
1900-1949
p1959
1950-1959
p1960-p1996
One year per file
p9999
Latest Weekly PDEs

The data format is described here.


Searching the PDE Files for Earthquake Locations

We have a simple program called "pde_srch" to search the PDE files. With this program you can search the PDE files one at a time, but using a shell script, you can automate a search of the entire data base.

Here is an example of a single execution of the program.The input from the user is in green.


mantle.eas.slu.edu:66% pde_srch What year (e.g. 1992)? 1989 Will search file: /geo/GeoData/PDEs/Data/p1989 What is the summary file name? summary.89 Search by box (1) or distance (2)? 1 Enter bounds: w,e,s,n? Units = degrees -124,-120,36,38 What are the minimum & maximum magnitude? 0,10 Use mb (1), Ms (2), or larger of the two (3)? 1 What are the minimum & maximum depths (km)? 0,10000


The output file, "summary.89" looks like this:
1989 01 15 00:07:13.199  37.417 -121.758    7 0.0   1989.038330078
1989 01 16 06:29:53.599  37.735 -121.983    4 0.0   1989.041870117
1989 01 16 07:07:03.799  37.737 -121.980    5 0.0   1989.041870117
1989 01 17 22:39:54.200  37.815 -122.598   12 0.0   1989.046386719
1989 01 20 20:48:53.799  36.150 -120.208   10 0.0   1989.054443359
.
.
.


Summary File Format

The output format is:

yyyy mm dd hh:mm:ss.ssss latitude longitude depth magnitude decimal_year

The individual values can be extracted using awk and then plotted using programs such as GMT, etc. For example, to make a file (let's call it the_locations.xy) that can be plotted using the GMT command psxy, use the command:

awk '{print $6, $5}' summary.89 > the_locations.xy

Note the switch to longitude latitude since that is the default in gmt. To scale the symbols in the GMT plot, make the diameter of the symbols in GMT proportional to the magnitude:

awk '{print $6, $5, $8 / 100 + 0.01}' summary.89 > the_locations.xy

The "+0.01" is used to insure that the earthquakes that have zero magnitude still show up int the GMT plot. Why are the zero magnitudes anyway? The PDE search we did was conducted using mb as the magnitude key. Not all the events in the catalog are large enough to have an estimate of mb. Small earthquakes are generally measured by ML or mb(Lg) or coda magnitude, but that information is not in the PDE files.


Using a Shell Script for a multi-year search

Suppose that you want to make a map of seismicity in a region and you don't want to type the same geographic search parameters into pde_srch over and over. Use a shell script to automate the process. Here's an example script that creates two files. A summary file called "my.events" and a file for plotting the locations with GMT called events.xy. In this example, the size of the symbol for each earthquake is scaled relative to the cube of the events' magnitude. The search depends on the file called "theList", which is a list of filenames located in the PDE directory.


#!/bin/csh # # script to search all the PDEs # makes two files, one with date and time, etc # the other just lat lon and mb (for gmt) # /bin/rm my.summary events.xy touch my.summary touch events.xy # foreach year ( `cat /geo/GeoData/PDEs/Data/theList` ) # echo '***********' $year '***********' # pde_srch << finished $year eve.tmp 1 -128,-115,40,55 0,10 1 0,2000 finished # # scale the magnitudes for plotting in GMT # cat eve.tmp >> my.summary awk '{print $5, $6, $8*$8*$8/1000 + 0.01}' eve.tmp >> events.xy # end # /bin/rm eve.tmp


Penn State Earthquake Seismology

Last Updated:23 November, 2005