forked from pyrocko/pyrocko
- fix ignored `quantity` param - fix color scale range problem - add `interpolation` param to set GF interpolation methd - add `target_depth` param to set receiver depth - changed waveform processing to prevent demeaning of traces - changed waveform processing to not do bandpass but separate high and low - docs: add simple analytical radiation pattern example - fix typosgf3d
parent
86d01554d0
commit
c47e40450d
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 243 KiB After Width: | Height: | Size: 191 KiB |
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,70 @@
|
||||
import os
|
||||
import shutil
|
||||
from pyrocko.plot.directivity import plot_directivity
|
||||
from pyrocko.gf import LocalEngine, DCSource, Store
|
||||
from pyrocko.fomosto import ahfullgreen
|
||||
|
||||
km = 1e3
|
||||
|
||||
|
||||
def make_homogeneous_gf_store(
|
||||
path, store_id, source_depth, receiver_depth, distance):
|
||||
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
ahfullgreen.init(path, None, config_params=dict(
|
||||
id=store_id,
|
||||
sample_rate=20.,
|
||||
receiver_depth=receiver_depth,
|
||||
source_depth_min=source_depth,
|
||||
source_depth_max=source_depth,
|
||||
distance_min=distance,
|
||||
distance_max=distance))
|
||||
|
||||
store = Store(path)
|
||||
store.make_ttt()
|
||||
ahfullgreen.build(path)
|
||||
|
||||
|
||||
store_id = 'gf_homogeneous_radpat'
|
||||
store_path = os.path.join('.', store_id)
|
||||
distance = 10*km
|
||||
receiver_depth = 0.0
|
||||
|
||||
source = DCSource(
|
||||
depth=0.,
|
||||
strike=0.,
|
||||
dip=90.,
|
||||
rake=0.)
|
||||
|
||||
make_homogeneous_gf_store(
|
||||
store_path, store_id, source.depth, receiver_depth, distance)
|
||||
|
||||
engine = LocalEngine(store_dirs=[store_path])
|
||||
|
||||
# import matplotlib.pyplot as plt
|
||||
# fig = plt.figure(figsize=(7,5))
|
||||
# axes = fig.add_subplot(111, polar=True)
|
||||
|
||||
resp = plot_directivity(
|
||||
engine, source, store_id,
|
||||
# axes=axes,
|
||||
distance=distance,
|
||||
dazi=5.,
|
||||
component='R',
|
||||
target_depth=receiver_depth,
|
||||
plot_mt='full',
|
||||
show_phases=True,
|
||||
fmin=None,
|
||||
fmax=1.0,
|
||||
phases={
|
||||
'P': '{stored:anyP}-50%',
|
||||
'S': '{stored:anyS}+50%'
|
||||
},
|
||||
interpolation='nearest_neighbor',
|
||||
quantity='velocity',
|
||||
envelope=False,
|
||||
hillshade=False)
|
||||
|
||||
# fig.savefig('radiation_pattern.png')
|
Loading…
Reference in new issue