本文整理汇总了Python中obspy.core.event.Event.amplitudes方法的典型用法代码示例。如果您正苦于以下问题:Python Event.amplitudes方法的具体用法?Python Event.amplitudes怎么用?Python Event.amplitudes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.core.event.Event
的用法示例。
在下文中一共展示了Event.amplitudes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: full_test_event
# 需要导入模块: from obspy.core.event import Event [as 别名]
# 或者: from obspy.core.event.Event import amplitudes [as 别名]
def full_test_event():
"""
Function to generate a basic, full test event
"""
test_event = Event()
test_event.origins.append(Origin(
time=UTCDateTime("2012-03-26") + 1.2, latitude=45.0, longitude=25.0,
depth=15000))
test_event.event_descriptions.append(EventDescription())
test_event.event_descriptions[0].text = 'LE'
test_event.creation_info = CreationInfo(agency_id='TES')
test_event.magnitudes.append(Magnitude(
mag=0.1, magnitude_type='ML', creation_info=CreationInfo('TES'),
origin_id=test_event.origins[0].resource_id))
test_event.magnitudes.append(Magnitude(
mag=0.5, magnitude_type='Mc', creation_info=CreationInfo('TES'),
origin_id=test_event.origins[0].resource_id))
test_event.magnitudes.append(Magnitude(
mag=1.3, magnitude_type='Ms', creation_info=CreationInfo('TES'),
origin_id=test_event.origins[0].resource_id))
# Define the test pick
_waveform_id_1 = WaveformStreamID(station_code='FOZ', channel_code='SHZ',
network_code='NZ')
_waveform_id_2 = WaveformStreamID(station_code='WTSZ', channel_code='BH1',
network_code=' ')
# Pick to associate with amplitude - 0
test_event.picks = [
Pick(waveform_id=_waveform_id_1, phase_hint='IAML',
polarity='undecidable', time=UTCDateTime("2012-03-26") + 1.68,
evaluation_mode="manual"),
Pick(waveform_id=_waveform_id_1, onset='impulsive', phase_hint='PN',
polarity='positive', time=UTCDateTime("2012-03-26") + 1.68,
evaluation_mode="manual"),
Pick(waveform_id=_waveform_id_1, phase_hint='IAML',
polarity='undecidable', time=UTCDateTime("2012-03-26") + 1.68,
evaluation_mode="manual"),
Pick(waveform_id=_waveform_id_2, onset='impulsive', phase_hint='SG',
polarity='undecidable', time=UTCDateTime("2012-03-26") + 1.72,
evaluation_mode="manual"),
Pick(waveform_id=_waveform_id_2, onset='impulsive', phase_hint='PN',
polarity='undecidable', time=UTCDateTime("2012-03-26") + 1.62,
evaluation_mode="automatic")]
# Test a generic local magnitude amplitude pick
test_event.amplitudes = [
Amplitude(generic_amplitude=2.0, period=0.4,
pick_id=test_event.picks[0].resource_id,
waveform_id=test_event.picks[0].waveform_id, unit='m',
magnitude_hint='ML', category='point', type='AML'),
Amplitude(generic_amplitude=10,
pick_id=test_event.picks[1].resource_id,
waveform_id=test_event.picks[1].waveform_id, type='END',
category='duration', unit='s', magnitude_hint='Mc',
snr=2.3),
Amplitude(generic_amplitude=5.0, period=0.6,
pick_id=test_event.picks[2].resource_id,
waveform_id=test_event.picks[0].waveform_id, unit='m',
category='point', type='AML')]
test_event.origins[0].arrivals = [
Arrival(time_weight=0, phase=test_event.picks[1].phase_hint,
pick_id=test_event.picks[1].resource_id),
Arrival(time_weight=2, phase=test_event.picks[3].phase_hint,
pick_id=test_event.picks[3].resource_id,
backazimuth_residual=5, time_residual=0.2, distance=15,
azimuth=25),
Arrival(time_weight=2, phase=test_event.picks[4].phase_hint,
pick_id=test_event.picks[4].resource_id,
backazimuth_residual=5, time_residual=0.2, distance=15,
azimuth=25)]
# Add in error info (line E)
test_event.origins[0].quality = OriginQuality(
standard_error=0.01, azimuthal_gap=36)
# Origin uncertainty in Seisan is output as long-lat-depth, quakeML has
# semi-major and semi-minor
test_event.origins[0].origin_uncertainty = OriginUncertainty(
confidence_ellipsoid=ConfidenceEllipsoid(
semi_major_axis_length=3000, semi_minor_axis_length=1000,
semi_intermediate_axis_length=2000, major_axis_plunge=20,
major_axis_azimuth=100, major_axis_rotation=4))
test_event.origins[0].time_errors = QuantityError(uncertainty=0.5)
# Add in fault-plane solution info (line F) - Note have to check program
# used to determine which fields are filled....
test_event.focal_mechanisms.append(FocalMechanism(
nodal_planes=NodalPlanes(nodal_plane_1=NodalPlane(
strike=180, dip=20, rake=30, strike_errors=QuantityError(10),
dip_errors=QuantityError(10), rake_errors=QuantityError(20))),
method_id=ResourceIdentifier("smi:nc.anss.org/focalMechanism/FPFIT"),
creation_info=CreationInfo(agency_id="NC"), misfit=0.5,
station_distribution_ratio=0.8))
# Need to test high-precision origin and that it is preferred origin.
# Moment tensor includes another origin
test_event.origins.append(Origin(
time=UTCDateTime("2012-03-26") + 1.2, latitude=45.1, longitude=25.2,
depth=14500))
test_event.magnitudes.append(Magnitude(
mag=0.1, magnitude_type='MW', creation_info=CreationInfo('TES'),
origin_id=test_event.origins[-1].resource_id))
# Moment tensors go with focal-mechanisms
test_event.focal_mechanisms.append(FocalMechanism(
moment_tensor=MomentTensor(
#.........这里部分代码省略.........