コード例 #1
0
ファイル: plot_dataset.py プロジェクト: afeborgeaud/pytomo
from pytomo.dataset.plotutils import display_windows
from dsmpy.windowmaker import WindowMaker
import pygmt

if __name__ == '__main__':
    windows = WindowMaker.load('selected_shift_windows_ScS_S_sS.pkl')
    windows = windows['0.01_0.08']

    windows_selected = [
        w for w in windows
        if ((-170 < w.station.longitude < -150 or (
            -130 < w.station.longitude < -100 and 30 < w.station.latitude < 40)
             ) and (w.event.longitude > 175 or w.event.longitude < -170))
    ]

    fig = pygmt.Figure()
    with fig.subplot(
            nrows=1,
            ncols=1,
            figsize=('20c', '20c'),
            frame=["af", "WSne"],
            # autolabel='(a)'
    ):
        display_windows(fig,
                        windows_selected, ['ScS'], [0, 0],
                        proj='G-160/30/18c',
                        frame=["af", "WSne", "g"],
                        region=[-100, 220, -60, 70])
    fig.savefig('map.pdf')
コード例 #2
0
ファイル: fwi.py プロジェクト: afeborgeaud/pytomo
    phases = ['ScS']
    window_file = 'windows.pkl'

    dataset, output = get_dataset(get_model_syntest1_prem_vshvsv(),
                                  tlen=1638.4,
                                  nspc=256,
                                  sampling_hz=sampling_hz,
                                  mode=mode,
                                  add_noise=False,
                                  noise_normalized_std=1.)

    # windows = WindowMaker.windows_from_dataset(
    #     dataset, 'prem', phases, [Component.T, Component.R],
    #     t_before=t_before, t_after=t_after)

    windows = WindowMaker.load(window_file)
    windows_ScS = [w for w in windows if w.phase_name == 'ScS']
    windows_S = [w for w in windows if w.phase_name == 'S']
    windows_S_sS = [w for w in windows if w.phase_name in {'S', 'sS'}]
    windows_S_sS_trim = WindowMaker.set_limit(windows_ScS,
                                              t_before=5,
                                              t_after=15,
                                              inplace=False)
    windows_ScS_trimmed = WindowMaker.trim_windows(windows_ScS,
                                                   windows_S_sS_trim)
    windows_ScS_proc = []
    for window in windows_ScS_trimmed:
        window_S = [
            w for w in windows_S
            if (w.station == window.station and w.event == window.event
                and w.component == window.component)