if (os.path.exists (ex_00) or os.path.exists (ex_01)): alreadyextracted &= True else: alreadyextracted = False if alreadyextracted: print "%s: already extracted, ignoring." % d continue else: print "%s: extracting.." % d # guess id g = Guessid () ids = g.go (d, d, quiet = True) marginids = 1 # id files to include before and after guessed id marginseismo_pre = 30.0 # seconds before event to include on seismometer marginseismo_post = 160.0 # seconds to include after first phase arrival # user arrival on GAK2 as arrival for GAKS for s in stations: sdir = os.path.join (d, s) ex_02 = os.path.join (sdir, '02') if not os.path.exists (ex_02): os.makedirs (ex_02) extract_done = False if os.path.exists (os.path.join (ex_02, 'extract_done')):
if not os.path.exists (os.path.join (root, contdir)): root = '../../' if not os.path.exists (os.path.join (root, contdir)): print "Could not figure out root db dir, run from either root db or one of sub dirs." sys.exit (1) contdir = os.path.join (root, contdir) rawevents = os.path.join (root, rawevents) readyevents = os.path.join (root, readyevents) localizeevents = os.path.join (root, localizeevents) # Search for events in 03 raw = [] files = os.listdir ('.') files.sort () for f in files: if '.S' in f: raw.append (f) # print events as they arrive at GAK2 for e in raw: g = Guessid () ids = g.go (e, e, quiet = True) print ids['GAKS'][1]
if (os.path.exists(ex_00) or os.path.exists(ex_01)): alreadyextracted &= True else: alreadyextracted = False if alreadyextracted: print "%s: already extracted, ignoring." % d continue else: print "%s: extracting.." % d # guess id g = Guessid() ids = g.go(d, d, quiet=True) marginids = 1 # id files to include before and after guessed id marginseismo_pre = 30.0 # seconds before event to include on seismometer marginseismo_post = 160.0 # seconds to include after first phase arrival # user arrival on GAK2 as arrival for GAKS for s in stations: sdir = os.path.join(d, s) ex_02 = os.path.join(sdir, '02') if not os.path.exists(ex_02): os.makedirs(ex_02) extract_done = False if os.path.exists(os.path.join(ex_02, 'extract_done')):
root = './' if not os.path.exists(os.path.join(root, contdir)): root = '../' if not os.path.exists(os.path.join(root, contdir)): root = '../../' if not os.path.exists(os.path.join(root, contdir)): print "Could not figure out root db dir, run from either root db or one of sub dirs." sys.exit(1) contdir = os.path.join(root, contdir) rawevents = os.path.join(root, rawevents) readyevents = os.path.join(root, readyevents) localizeevents = os.path.join(root, localizeevents) # Search for events in 03 raw = [] files = os.listdir('.') files.sort() for f in files: if '.S' in f: raw.append(f) # print events as they arrive at GAK2 for e in raw: g = Guessid() ids = g.go(e, e, quiet=True) print ids['GAKS'][1]