if True: _map.gmt.psmeca( S='%s%g' % ('m', size_cm * 2.0), #G=gmtpy.color(colors[e.cluster]), #G=colors[i_e], G='red', C='3p,0/0/0', #W='thinnest,%i/%i/%i' % (255, 255, 255), #L='thinnest,%i/%i/%i' % (255, 255, 255), in_rows=[data], *_map.jxyr) _map.save(outpath=outfn) if __name__ == '__main__': e = list(Event.load_catalog(filename='event.pf'))[0] #stations = model.load_stations('arrays.pf') stations = model.load_stations('array_center.pf') color_wet = [200, 200, 200] color_dry = [253, 253, 253] params = MapParameters(lat=e.lat, lon=e.lon, radius=8000000, outfn='array-map-new.pdf', stations=stations, events=[e], show_topo=False, show_grid=False, color_wet=color_wet, color_dry=color_dry) make_map(map_parameters=params)
data = (e.lon, e.lat, 10, 1,1,1,0,0,0, 1, e.lon, e.lat, 'Test site') if True: _map.gmt.psmeca( S='%s%g' % ('m', size_cm*2.0), #G=gmtpy.color(colors[e.cluster]), #G=colors[i_e], G='red', C='3p,0/0/0', #W='thinnest,%i/%i/%i' % (255, 255, 255), #L='thinnest,%i/%i/%i' % (255, 255, 255), in_rows=[data], *_map.jxyr) _map.save(outpath=outfn) if __name__=='__main__': e = list(Event.load_catalog(filename='event.pf'))[0] #stations = model.load_stations('arrays.pf') stations = model.load_stations('array_center.pf') color_wet = [200, 200, 200] color_dry = [253, 253, 253] params = MapParameters(lat=e.lat, lon=e.lon, radius=8000000, outfn='array-map-new.pdf',stations=stations, events=[e], show_topo=False, show_grid=False, color_wet=color_wet, color_dry=color_dry) make_map(map_parameters=params) print '.'*40 fdomain_station_locs = [] #with open('northkoreaplot/stations.table.mec', 'r') as f: # for line in f.readlines(): # lat, lon, c = line.split()
config_ids = [c.id for c in configs] return config_ids if __name__ == "__main__": import argparse from pyrocko.model import Event, load_stations parser = argparse.ArgumentParser('suggest a store for P phases only') parser.add_argument('--stations', help='stations file') parser.add_argument('--events', help='event file') parser.add_argument('--force', action='store_true', help='force_overwrite') parser.add_argument('--superdir', default='.', help='directory where to put the store') parser.add_argument( '--number_of_distances', help='number of distances between outer grid nodes in GFDB', default=2) args = parser.parse_args() stations = load_stations(args.stations) if len(stations) == 1: s = stations[0] events = list(Event.load_catalog(args.events)) propose_store(s, events, superdir=args.superdir, force=args.force)
) _map.gmt.psmeca( S="%s%g" % ("m", size_cm * 2.0), # G = gmtpy.color(colors[e.cluster]), # G = colors[i_e], G="red", C="3p,0/0/0", # W = 'thinnest,%i/%i/%i' % (255, 255, 255), # L = 'thinnest,%i/%i/%i' % (255, 255, 255), in_rows=[data], *_map.jxyr) _map.save(outpath=outfn) if __name__ == "__main__": e = list(Event.load_catalog(filename="event.pf"))[0] stations = model.load_stations("array_center.pf") color_wet = [200, 200, 200] color_dry = [253, 253, 253] params = MapParameters( lat=e.lat, lon=e.lon, radius=8000000, outfn="array-map-new.pdf", stations=stations, events=[e], show_topo=False, show_grid=False, color_wet=color_wet, color_dry=color_dry, )
output[tuple(d)] = e return output def readnsplit(fn): ''' read and split file content....''' with open(fn, 'r') as f: return [l.split() for l in f.readlines()] def convert_time(t): return util.str_to_time('%s-%s-%s %s:%s:%s.' % (t[0:4], t[4:6], t[6:8], t[8:10], t[10:12], t[12:14])) fn_loki = 'catalogue_loki.dat' fn_mts = 'qresults_definitivo_ok.dat' events = list(Event.load_catalog(fn_loki)) mts_data = readnsplit(fn_mts) # check pattern pattern = ['time', 'misfit', 'lat', 'lon', 'depth', 'magnitude', 'misfit2', '_', 'moment', 'strike', 'dip', 'rake', 'dz', 'dx', 'dy', 'rt'] wanted_arguments = ['moment', 'strike', 'dip', 'rake'] mts = classify(MomentTensor, mts_data, pattern, wanted_arguments) time_threshold = 80. print 'number of events: ', len(events) done = [] print 'number of mts: ', len(mts.keys()) for e in events: for d, mt in mts.items(): # specific to this pattern because time is at first place: if abs(e.time-convert_time(d[0])) < time_threshold:
if __name__=="__main__": import argparse from pyrocko.model import Event, load_stations parser = argparse.ArgumentParser('suggest a store for P phases only') parser.add_argument('--stations', help='stations file') parser.add_argument('--events', help='event file') parser.add_argument('--force', action='store_true', help='force_overwrite') parser.add_argument('--superdir', default='.', help='directory where to put the store') parser.add_argument('--number_of_distances', help='number of distances between outer grid nodes in GFDB', default=2) args = parser.parse_args() stations = load_stations(args.stations) if len(stations)==1: s = stations[0] events = list(Event.load_catalog(args.events)) propose_store(s, events, superdir=args.superdir, force=args.force)