-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_inputOR96.pl
More file actions
executable file
·39 lines (28 loc) · 923 Bytes
/
db_inputOR96.pl
File metadata and controls
executable file
·39 lines (28 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /usr/bin/env perl
use lib "$ENV{ANTELOPE}/data/perl/";
use Datascope;
$arid = 1; # CHECK LASTID
open(PIPE, "ls *.txt |");
while(<PIPE>) {
$pickfile = $_; # just throw it in, for now...
@db = dbopen($new_db,"r+");
@dbar = dblookup(@db,"","arrival","","");
@dbas = dblookup(@db,"","assoc","","");
@dbst = dblookup(@db,"","site","","");
@dbo = dblookup(@db,"","origin","","");
# input the files... get station, maybe line from them...
$sta = "something from $pickfile";
open(FILEIN, "<$pickfile");
while(<FILEIN>) {
($lon,$lat,$dep,$xshot,$ytime) = split(" ",$_);
#round $xshot!!!!!!!!!
$xshot = sprintf('%d',$xshot);
# if the shots are already in there...
@dbo = dbsubset(@dbo,"orid == $xshot");
$shottime = dbgetv(@dbo,"time");
$ytime = $shottime + $ytime;
dbaddv(@dbas,"orid",$xshot,"arid",$arid);
dbaddv(@dbar,"time",$ytime,"arid",$arid);
}
dbaddv(@dbst,"sta",$sta,"lon",$lon,"lat",$lat,"depth",$dep);
}