本文整理汇总了Python中obspy.core.event.Pick.horizontal_slowness方法的典型用法代码示例。如果您正苦于以下问题:Python Pick.horizontal_slowness方法的具体用法?Python Pick.horizontal_slowness怎么用?Python Pick.horizontal_slowness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.core.event.Pick
的用法示例。
在下文中一共展示了Pick.horizontal_slowness方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _parse_arrivals
# 需要导入模块: from obspy.core.event import Pick [as 别名]
# 或者: from obspy.core.event.Pick import horizontal_slowness [as 别名]
#.........这里部分代码省略.........
try:
network_code, channel = self._get_channel(station,
pick.time)
if channel:
channel_code = channel.code
location_code = channel.location_code
except TypeError:
pass
pick.waveform_id.network_code = network_code
pick.waveform_id.channel_code = channel_code
if location_code:
pick.waveform_id.location_code = location_code
try:
ev_mode = EVALUATION_MODES[evaluation_mode]
pick.evaluation_mode = ev_mode
except KeyError:
pass
try:
pick.polarity = PICK_POLARITIES[direction]
except KeyError:
pass
try:
pick.onset = PICK_ONSETS[onset]
except KeyError:
pass
pick.phase_hint = phase
try:
pick.backazimuth = float(arrival_azimuth)
except ValueError:
pass
try:
pick.horizontal_slowness = float(slowness)
except ValueError:
pass
public_id = "pick/%s" % line_id
pick.resource_id = self._get_res_id(public_id)
event.picks.append(pick)
except (TypeError, ValueError, AttributeError):
# Can't parse pick, skip arrival and amplitude parsing
continue
arrival = Arrival()
arrival.creation_info = self._get_creation_info()
try:
arrival.pick_id = pick.resource_id.id
except AttributeError:
pass
arrival.phase = phase
try:
arrival.azimuth = float(event_azimuth)
except ValueError:
pass
try:
arrival.distance = float(distance)
except ValueError:
pass
try:
arrival.time_residual = float(time_residual)
except ValueError:
pass
try:
arrival.backazimuth_residual = float(azimuth_residual)
示例2: _map_join2phase
# 需要导入模块: from obspy.core.event import Pick [as 别名]
# 或者: from obspy.core.event.Pick import horizontal_slowness [as 别名]
def _map_join2phase(self, db):
"""
Return an obspy Arrival and Pick from an dict of CSS key/values
corresponding to one record. See the 'Join' section for the implied
database table join expected.
Inputs
======
db : dict of key/values of CSS fields related to the phases (see Join)
Returns
=======
obspy.core.event.Pick, obspy.core.event.Arrival
Notes
=====
Any object that supports the dict 'get' method can be passed as
input, e.g. OrderedDict, custom classes, etc.
Join
----
assoc <- arrival <- affiliation (outer) <- schanloc [sta chan] (outer)
"""
p = Pick()
p.time = _utc(db.get('time'))
def_net = self.agency[:2].upper()
css_sta = db.get('sta')
css_chan = db.get('chan')
p.waveform_id = WaveformStreamID(
station_code = db.get('fsta') or css_sta,
channel_code = db.get('fchan') or css_chan,
network_code = db.get('snet') or def_net,
location_code = db.get('loc'),
)
p.horizontal_slowness = db.get('slow')
#p.horizontal_slowness_errors = self._create_dict(db, 'delslo')
p.backazimuth = db.get('azimuth')
#p.backazimuth_errors = self._create_dict(db, 'delaz')
on_qual = _str(db.get('qual')).lower()
if 'i' in on_qual:
p.onset = "impulsive"
elif 'e' in on_qual:
p.onset = "emergent"
elif 'w' in on_qual:
p.onset = "questionable"
else:
p.onset = None
p.phase_hint = db.get('iphase')
pol = _str(db.get('fm')).lower()
if 'c' in pol or 'u' in pol:
p.polarity = "positive"
elif 'd' in pol or 'r' in pol:
p.polarity = "negative"
elif '.' in pol:
p.polarity = "undecidable"
else:
p.polarity = None
p.evaluation_mode = "automatic"
if 'orbassoc' not in _str(db.get('auth')):
p.evaluation_mode = "manual"
p.evaluation_status = "preliminary"
if p.evaluation_mode is "manual":
p.evaluation_status = "reviewed"
p.creation_info = CreationInfo(
version = db.get('arid'),
creation_time = _utc(db.get('arrival.lddate')),
agency_id = self.agency,
author = db.get('auth'),
)
p.resource_id = self._rid(p)
a = Arrival()
a.pick_id = ResourceIdentifier(str(p.resource_id), referred_object=p)
a.phase = db.get('phase')
a.azimuth = db.get('esaz')
a.distance = db.get('delta')
a.takeoff_angle = db.get('ema')
#a.takeoff_angle_errors = self._create_dict(db, 'emares')
a.time_residual = db.get('timeres')
a.horizontal_slowness_residual = db.get('slores')
a.time_weight = db.get('wgt')
a.earth_model_id = ResourceIdentifier(self._prefix+'/VelocityModel/'+_str(db.get('vmodel')))
a.creation_info = CreationInfo(
version = db.get('arid'),
creation_time = _utc(db.get('lddate')),
agency_id = self.agency,
)
a.extra = {}
a.extra['timedef'] = {
'value': _str(db.get('timedef')),
'namespace': CSS_NAMESPACE
}
#.........这里部分代码省略.........