Revision 16,
865 bytes
checked in by marcus, 15 years ago
(diff) |
r1 | svn | 2007-12-13 11:10:29 +0100 (Do, 13 Dez 2007) | 2 lines
Initial import
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #! /bin/csh |
---|
2 | # |
---|
3 | # file find_evid.csh |
---|
4 | # ============= |
---|
5 | # |
---|
6 | # version 1, 28-Dec-2005 |
---|
7 | # |
---|
8 | # Find event id number for a given origin time string |
---|
9 | # K. Stammler, 28-Dec-2005 |
---|
10 | |
---|
11 | if ("$1" == "") then |
---|
12 | echo "Usage: $0 <origstr>" |
---|
13 | echo " Example: $0 051228_1253" |
---|
14 | exit |
---|
15 | endif |
---|
16 | |
---|
17 | # get parameters |
---|
18 | set origstr=$1 |
---|
19 | |
---|
20 | # set constants |
---|
21 | set evtpath=$EVT/evt_archive |
---|
22 | |
---|
23 | # get time |
---|
24 | set origtime=`$SH_UTIL/timename name_time xxx_$origstr` |
---|
25 | if ($#origtime != 2) exit |
---|
26 | set origtime=$origtime[2] |
---|
27 | |
---|
28 | # get day string |
---|
29 | set daystr=`echo $origstr | sed 's/_/ /'` |
---|
30 | set daystr=$daystr[1] |
---|
31 | |
---|
32 | set found = ( ) |
---|
33 | |
---|
34 | set evtlist=`ls $evtpath/shm_1$daystr*` |
---|
35 | foreach evt ($evtlist) |
---|
36 | set otime=`grep 'Origin time' $evt | head -1 | awk '{print $4}'` |
---|
37 | if ("$otime" == "") continue |
---|
38 | set diff=`$SH_UTIL/timename time_intdiff $otime $origtime | sed 's/^-//'` |
---|
39 | if ($diff < 60) set found = ( $found $evt ) |
---|
40 | end |
---|
41 | |
---|
42 | echo $found |
---|
Note: See
TracBrowser
for help on using the repository browser.