Written by Terje Utheim, email@example.com The purpose of this program is to download hypocenter information from international data centers. The program has now been implemented for USGS but will also be implemented for ISC and EMSC.
The program downloads the data to a SEISAN data base in a Nordic format file. The program downloads a file from the USGS called get_web_locations.txt from which it picks up relevant information for the S-file. The download might have data from several other sources which are entered into the S-file. The list of sources can be found at https://earthquake.usgs.gov/data/comcat/contributor/. The source 'us' is translated into USG in the S-file but the others are left as they are, e.g. 'ak' is Alaska earthquake Center'.
The input magntude types from th eUSGS text file are converted to SEISAN magnitude types as follows:
mb b ML L mB B Ms s MS S MW W Mc C mw W mww W ww W wr W ml L md C
The program has several options: Set limits for minimum and maximum depths and minimum magnitude
Set time interval for download
Run once for the given parameters from command line
Run at given time intervals to always maintain the local data base. If a new location of the same event is found, the old event is replaced.
The program has no parameter files, all options are given as options on the prompt line.
Typing get_web_locations -h the following options/info are shown (platform dependent) SEISAN_TOP..................................: /home/seismo/snew Valid program options, int is integer, float is a floating point number and text is an ascii string: -h show this help info -loop int 1-loop forever, 0-one query (0=default) -tsrt int minutes back, start-time. (Number of minutes to start from current time) -tstp int minutes back, stop-time. Number of minutes to stop from current time. This should not be too close to real time in order for the data center to calculate the hypocenter. 50 minutes is a reasonable number. These two parameters are only used if the program runs continuously. The interval of looking for data is tstp-tsrt. -mag float minimum magnitude The minimum magnitude to be included. The magnitude is the first found in case there are several types of magnitudes. If no magnitude is given, all magnitude events are used. -mind text minimum depth (default: 0) -maxd text maximum depth (default: 800) -db text SEISAN database name, max 5 characters -srt text start-time, format: 2018-02-20T03:45:00 -end text end-time, format: 2018-02-22T08:23:00 Start and stop time for a one time extract. Cannot be used at the same time as tsrt and tstp. To run the program in a continuous loop, the following parameters MUST be specified: -loop 1 -tsrt t1 (start time, number of minutes back in time) -tstp t1 (stop time, number of minutes back in time) Example 1: Collecting data continuously from command line: get_web_locations -loop 1 -tsrt 60 -tstp 50 -mag 3.0 -db MYDB The program will query data from 60 minutes ago until 50 minutes back in time from now. The program will then sleep for 60 - 50 = 10 minutes and start again. Minimum magnitude is 3.0 and the data is written to the data base MYDB -srt and -end cannot be specified when running in loop mode. Example 2:" one time" data collections with no options get_web_locations -db TEST -srt 2018-01-01T00:00:00 -end 2018-01-10T23:59:00 Example3: "one time" data collection from start time to end time from command line: get_web_locations -mag 5.0 -db ABC -mind 10 -maxd 100 -srt 2018-01-01T00:00:00 -end 2018-01-30T23:59:00 Example of output S-file 2018 1 1 052 31.0 D -0.280 123.700127.2 USG 4.5bUSG1 WEB event-id: us1000byph 3 LOCALITY: 80km SSW of Molibagu, Indonesia 3 ACTION:NEW 18-03-26 20:27 OP:SEIS STATUS: ID:20180101005230 I STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO AIN AR TRES W DIS CAZ7 Example 3: Continuous mode as cron job on a Linux system The setup below will start every hour at 0 minutes in a bash environment 0 * * * * /home/seismo/get_web_locations/cron_restart.bash 2.0 MYDB 0 800 2 1 >/dev/null 2>&1 The setup below will start every hour at 0 minutes in a csh environment 0 * * * * /home/seismo/get_web_locations/cron_restart.csh 2.0 MYDB 0 800 2 1 >/dev/null 2>&1 cron_restart.csh #!/bin/csh rm -f /home/seismo/get_web_locations/usgs.log source /home/seismo/COM/.SEISAN echo MAG: $1 DBASE: $2 MIN_DEPTH: $3 MAX_DEPTH: $4 START_HOUR: $5 STOP_HOUR: $6 set start_time=`date --utc "+%Y-%m-%dT%H:%M:00" --date -$5hour` set stopp_time=`date --utc "+%Y-%m-%dT%H:%M:00" --date -$6hour` echo $start_time echo $stopp_time cd /home/seismo/get_web_locations /home/seismo/get_web_locations/get_web_locations -mag $1 -db $2 -mind $3 -maxd $4 -srt "$start_time" -end "$stopp_time" > usgs.log cron_restart.bash file #!/bin/bash rm -f /home/seismo/get_web_locations/usgs.log source /home/seismo/COM/.SEISAN echo MAG: $1 DBASE: $2 MIN_DEPTH: $3 MAX_DEPTH: $4 START_HOUR: $5 STOP_HOUR: $6 start_time=`date --utc "+%Y-%m-%dT%H:%M:00" --date -$5hour` stopp_time=`date --utc "+%Y-%m-%dT%H:%M:00" --date -$6hour` echo $start_time echo $stopp_time cd /home/seismo/get_web_locations /home/seismo/get_web_locations/get_web_locations -mag $1 -db $2 -mind $3 -maxd $4 -srt "$start_time" -end "$stopp_time" > usgs.log