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')): extract_done = True if not extract_done: mids = [] for i in range (ids[s][0] - marginids, ids[s][0] + marginids + 1): if os.path.exists (os.path.join (sdir, str(i) + '.DAT')): mids.append (i) # extract to 02 mkm = Makemseed () mkm.station = s mkm.root = os.path.join (d, s) mkm.destdir = ex_02 mkm.ids = mids (mseedf, idsf, refsf) = mkm.dorange () rd = open (os.path.join (ex_02, 'extract_done'), 'w') rd.write ('yes\n') rd.close () else: print "%s: %s already extracted, skipping station." % (d, s) # seismometer s = 'GAKS'
print "%s: reextracting.." % d for s in stations: reextract_done = False if os.path.exists (os.path.join (d, s, '01', 'reextract_done')): reextract_done = True if not reextract_done: idf = open (os.path.join (d, s, '00', idfiles[s]), 'r') ids = [] for l in idf.readlines (): (ii, sdlag) = l.split (',') ids.append (int(ii)) idf.close () mkm = Makemseed () mkm.station = s mkm.root = os.path.join (d, s) mkm.destdir = os.path.join (d, s, '01') mkm.ids = ids (mseedf, idsf, refsf) = mkm.dorange () rd = open (os.path.join (d, s, '01', 'reextract_done'), 'w') rd.write ('yes\n') rd.close () else: print "%s: %s already reextracted, skipping." % (d, s) print "%s: putting to 04_events_localize.." % d p = Putrevised () p.doevent (d, d, '01')
os.makedirs(ex_02) extract_done = False if os.path.exists(os.path.join(ex_02, 'extract_done')): extract_done = True if not extract_done: mids = [] for i in range(ids[s][0] - marginids, ids[s][0] + marginids + 1): if os.path.exists(os.path.join(sdir, str(i) + '.DAT')): mids.append(i) # extract to 02 mkm = Makemseed() mkm.station = s mkm.root = os.path.join(d, s) mkm.destdir = ex_02 mkm.ids = mids (mseedf, idsf, refsf) = mkm.dorange() rd = open(os.path.join(ex_02, 'extract_done'), 'w') rd.write('yes\n') rd.close() else: print "%s: %s already extracted, skipping station." % (d, s) # seismometer s = 'GAKS'