Ejemplo n.º 1
0
    def _create_pick():
        # setup some of the classes
        creation = ev.CreationInfo(
            agency='SwanCo',
            author='Indago',
            creation_time=UTCDateTime(),
            version='10.10',
            author_url=ev.ResourceIdentifier('smi:local/me.com'),
        )

        pick = ev.Pick(
            time=state['time'],
            comments=[ev.Comment(x) for x in 'BOB'],
            evaluation_mode='manual',
            evaluation_status='final',
            creation_info=creation,
            phase_hint='P',
            polarity='positive',
            onset='emergent',
            back_azimith_errors={"uncertainty": 10},
            slowness_method_id=ev.ResourceIdentifier('smi:local/slow'),
            backazimuth=122.1,
            horizontal_slowness=12,
            method_id=ev.ResourceIdentifier(),
            horizontal_slowness_errors={'uncertainty': 12},
            filter_id=ev.ResourceIdentifier(),
            waveform_id=ev.WaveformStreamID('UU', 'FOO', '--', 'HHZ'),
        )
        state['pick_id'] = pick.resource_id
        return pick
Ejemplo n.º 2
0
def _create_first_pick_origin(first_pick, channel_ser, depth):
    """ Create an origin based on first pick and a channel series. """
    msg = ("origin fixed to location and time of earliest pick by "
           f"obsplus version {obsplus.__last_version__}")
    comment = ev.Comment(text=msg)
    odict = dict(
        time=to_utc(first_pick["time"]),
        latitude=channel_ser["latitude"],
        longitude=channel_ser["longitude"],
        depth=depth,
        time_fixed=True,
        comments=[comment],
    )
    return ev.Origin(**odict)
Ejemplo n.º 3
0
 def _get_arrival():
     return ev.Arrival(
         resource_id=ev.ResourceIdentifier('smi:local/Ar1'),
         pick_id=state['pick_id'],
         phase='P',
         time_correction=.2,
         azimuth=12,
         distance=10,
         takeoff_angle=15,
         takeoff_angle_errors={'uncertainty': 10.2},
         time_residual=.02,
         horizontal_slowness_residual=12.2,
         backazimuth_residual=12.2,
         time_weight=.23,
         horizontal_slowness_weight=12,
         backazimuth_weight=12,
         earth_model_id=ev.ResourceIdentifier(),
         commens=[ev.Comment(x) for x in 'Nothing'],
     )
Ejemplo n.º 4
0
    def _setPick(self, xdata, phase, channel, polarity='undecideable'):
        '''
        Write obspy.core.event.Pick into self._picks list
        '''
        picktime = self._current_st[0].stats.starttime + \
                   (xdata * self._current_st[0].stats.delta)

        this_pick = event.Pick()
        overwrite = True
        # Overwrite existing phase's picktime
        for _pick in self._getPicks():
            if _pick.phase_hint == phase and \
                            _pick.waveform_id.channel_code == channel:
                this_pick = _pick
                overwrite = False
                break

        creation_info = event.CreationInfo(
            author='ObsPy.Stream.pick()',
            creation_time=UTCDateTime())
        # Create new event.Pick()
        this_pick.time = picktime
        this_pick.phase_hint = phase
        this_pick.waveform_id = event.WaveformStreamID(
            network_code=self._current_st[0].stats.network,
            station_code=self._current_st[0].stats.station,
            location_code=self._current_st[0].stats.location,
            channel_code=channel)
        this_pick.evaluation_mode = 'manual'
        this_pick.creation_info = creation_info
        this_pick.onset = self.onset_types[self.onsetGrp.checkedId()]
        this_pick.evaluation_status = 'preliminary'
        this_pick.polarity = polarity
        if self._current_filter is not None:
            this_pick.comments.append(event.Comment(
                text=str(self.bpfilter[self.fltrcb.currentIndex()])))
        if overwrite:
            self._picks.append(this_pick)