help='name of file containing station information',
                        required=True)
    parser.add_argument('--events',
                        help='name of file containing event catalog',
                        default=False,
                        required=False)
    parser.add_argument('--printall',
                        help='Print all results to terminal',
                        default=True,
                        required=False,
                        action='store_true')
    parser.add_argument('--show',
                        help='show figure at the end',
                        default=False,
                        required=False,
                        action='store_true')
    args = parser.parse_args()

    stations = model.load_stations(args.stations)

    if args.usestations:
        stations = [s for s in stations if util.match_nslc(args.usestations, s.nsl())]

    events = []
    if args.events:
        events.extend(model.load_events(args.events))
    if args.markers:
        markers = gui_util.load_markers(args.markers)
        events.extend([m.get_event() for m in markers])
    get_bounds(stations, events=events, usestations=args.usestations, printall=args.printall, show_fig=args.show)
Exemple #2
0
    # center. The relative position can be changed between 0 (phase at t=0) and
    # 1 (phase at t=tmax).
    window = autogain.StaticLengthWindow(static_length=20., phase_position=0.5)

    #candidate_fn = 'candidates2013new.pf'
    #candidates = [m.get_event() for m in gui_util.Marker.load_markers(candidate_fn)]

    # If you have a catalog of events that you want to use, load them and make
    # and event EventCollection from those events:
    #candidates = model.load_events('events.pf')

    #event_selector = autogain.EventCollection(events=candidates)

    # I selected events that I wanted to use using snuffler and wrote the
    # selected event markers into a file which is loaded here:
    markers = gui_util.load_markers('candidates2013new.pf')

    # Thus, the EventCollection accepts 'markers' or 'events' as kwargs:
    event_selector = autogain.EventCollection(markers=markers)

    # If you do not have a catalog, yet, you might want to automatically
    # download events either from Geofon or Iris.
    event_selector = autogain.EventSelectorCatalog(distmin=1000 * km,
                                                   distmax=20000 * km,
                                                   depthmin=2 * km,
                                                   depthmax=600 * km,
                                                   magmin=4.9)

    # Setup the processing:
    ag = autogain.AutoGain(data_pile,
                           stations=stations,
                        help='name of file containing station information',
                        required=True)
    parser.add_argument('--events',
                        help='name of file containing event catalog',
                        default=False,
                        required=False)
    parser.add_argument('--printall',
                        help='Print all results to terminal',
                        default=True,
                        required=False,
                        action='store_true')
    parser.add_argument('--show',
                        help='show figure at the end',
                        default=False,
                        required=False,
                        action='store_true')
    args = parser.parse_args()

    stations = model.load_stations(args.stations)

    if args.usestations:
        stations = [s for s in stations if util.match_nslc(args.usestations, s.nsl())]

    events = []
    if args.events:
        events.extend(model.load_events(args.events))
    if args.markers:
        markers = gui_util.load_markers(args.markers)
        events.extend([m.get_event() for m in markers])
    get_bounds(stations, events=events, usestations=args.usestations, printall=args.printall, show_fig=args.show)
Exemple #4
0

def __snufflings__():
    return [MapMaker()]


if __name__ == '__main__':
    util.setup_logging('map.py', 'info')
    s = MapMaker()
    options, args, parser = s.setup_cli()
    s.markers = []

    if options.stations_filename:
        stations = model.load_stations(options.stations_filename)
        s.stations = stations
    else:
        s.stations = None

    if options.events_filename:
        events = model.load_events(filename=options.events_filename)
        markers = [gui_util.EventMarker(e) for e in events]
        s.markers.extend(markers)

    if options.markers_filename:
        markers = gui_util.load_markers(options.markers_filename)
        s.markers.extend(markers)
    s.open_external = True
    mapmap = {'google': 'Google Maps', 'osm': 'OpenStreetMap'}
    s.map_kind = mapmap[options.map_provider]
    s.call()
    window = autogain.StaticLengthWindow(static_length=20.,
                                         phase_position=0.5)


    #candidate_fn = 'candidates2013new.pf'
    #candidates = [m.get_event() for m in gui_util.Marker.load_markers(candidate_fn)]

    # If you have a catalog of events that you want to use, load them and make
    # and event EventCollection from those events:
    #candidates = model.load_events('events.pf')

    #event_selector = autogain.EventCollection(events=candidates)

    # I selected events that I wanted to use using snuffler and wrote the
    # selected event markers into a file which is loaded here:
    markers = gui_util.load_markers('candidates2013new.pf')

    # Thus, the EventCollection accepts 'markers' or 'events' as kwargs:
    event_selector = autogain.EventCollection(markers=markers)

    # If you do not have a catalog, yet, you might want to automatically
    # download events either from Geofon or Iris.
    event_selector = autogain.EventSelectorCatalog(distmin=1000*km,
                                                   distmax=20000*km,
                                                   depthmin=2*km,
                                                   depthmax=600*km,
                                                   magmin=4.9)

    # Setup the processing:
    ag = autogain.AutoGain(data_pile, stations=stations,
                           event_selector=event_selector,