Skip to content

Commit

Permalink
Chekc local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lsawade committed Aug 1, 2023
1 parent ce1b76d commit 36c14f8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/gf3d/bin/gf3d_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
2 OUTPUT
"""
from gf3d.plot.section import plotsection
from gf3d.seismograms import GFManager
from gf3d.source import CMTSOLUTION
import matplotlib.pyplot as plt
import click


Expand Down Expand Up @@ -465,5 +469,41 @@ def plot_station_seismogram(subsetfilename, cmtsolutionfilename, network, statio
plt.show(block=True)


@station.command(name='section')
@click.argument('subsetfilename', type=click.Path(exists=True))
@click.argument('cmtsolutionfilename', type=click.Path(exists=True))
@click.argument('component', type=str)
def plot_subset_section(
subsetfilename: str,
cmtsolutionfilename: str,
component: str):

# External

# Internal

# CMTSOLUTION
cmt = CMTSOLUTION.read(cmtsolutionfilename)

# Load subset
gfsub = GFManager(subsetfilename)
gfsub.load()

# Get seismograms from the database

rp = gfsub.get_seismograms(cmt)

# Get time limits
starttime = rp[0].stats.starttime
endtime = rp[0].stats.starttime + 3800 # rp[0].stats.endtime
limits = (starttime, endtime)

# Plots a section of observed and synthetic
plotsection(rp, rp, cmt, comp=component, lw=0.75,
limits=limits, sync='k', scale=3)

plt.show()


if __name__ == "__main__":
cli()

0 comments on commit 36c14f8

Please sign in to comment.