示例#1
0
W, E, S, N = 121.3, 121.8, 23.5, 24.25
stamen_terrain = cimgt.Stamen('terrain-background')
fig = plt.figure(figsize=(8, 11))
ax = fig.add_subplot(1, 1, 1, projection=stamen_terrain.crs)
ax.set_extent([W, E, S, N], crs=ccrs.Geodetic())
ax.add_image(stamen_terrain, 11)

events = read_event_list('HL201718')
HL_eq = []
for event in events:
    HL_eq.append([event.origins[0].longitude, event.origins[0].latitude])
HL_eq = np.array(HL_eq).T
ax.scatter(HL_eq[0], HL_eq[1], label='Earthquake',
           transform=ccrs.Geodetic(), color='#555555', edgecolors='k', linewidth=0.3, marker='o', s=10)

geom = read_hyp('HL2017.HYP')
HL_station = []
for k, station in geom.items():
    HL_station.append([station['longitude'], station['latitude'], ])
HL_station = np.array(HL_station).T
ax.scatter(HL_station[0], HL_station[1], label='HL 2017 station',
           transform=ccrs.Geodetic(), color='#b71c1c', edgecolors='k', marker='v', linewidth=0.5, s=60)

geom = read_hyp('HL2018.HYP')
HL_station = []
for k, station in geom.items():
    if station['latitude'] > 23.65:
        HL_station.append([station['longitude'], station['latitude'], ])
HL_station = np.array(HL_station).T
ax.scatter(HL_station[0], HL_station[1], label='HL 2018 station',
           transform=ccrs.Geodetic(), color='#FBC02D', edgecolors='k', marker='v', linewidth=0.5, s=60)
示例#2
0
ap = argparse.ArgumentParser()
ap.add_argument('-d',
                '--database',
                required=True,
                help='sql database file',
                type=str)
ap.add_argument('-c',
                '--catalog',
                required=True,
                help='catalog s-file dir',
                type=str)
ap.add_argument('-g',
                '--geometry',
                required=True,
                help='geometry STATION0.HYP',
                type=str)
ap.add_argument('-p',
                '--name',
                required=True,
                help='output pickset name',
                type=str)
args = ap.parse_args()

geom = read_hyp(args.geometry)
events = read_event_list(args.catalog)
pick_dict = get_pick_dict(events)

db = Client(args.database)
db.add_geom(geom)
db.add_picks(pick_dict, args.name)
示例#3
0
events = read_event_list('MN2016')
MN_eq = []
for event in events:
    MN_eq.append([event.origins[0].longitude, event.origins[0].latitude])
MN_eq = np.array(MN_eq).T
ax.scatter(MN_eq[0],
           MN_eq[1],
           label='Earthquake',
           transform=ccrs.Geodetic(),
           color='#555555',
           edgecolors='k',
           linewidth=0.3,
           marker='o',
           s=10)

geom = read_hyp('MN2016.HYP')
MN_station = []
for k, station in geom.items():
    MN_station.append([
        station['longitude'],
        station['latitude'],
    ])
MN_station = np.array(MN_station).T
ax.scatter(MN_station[0],
           MN_station[1],
           label='MN station',
           transform=ccrs.Geodetic(),
           color='#b71c1c',
           edgecolors='k',
           marker='v',
           linewidth=0.5,