-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbigWaveformPlot.py
31 lines (27 loc) · 971 Bytes
/
bigWaveformPlot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Before running the program, enter your specifications into
SETUP_waveforms.txt
"""
###############################################################
import matplotlib.pyplot as plt
from obspy import read
from obspy.clients.fdsn import Client
from obspy.core import UTCDateTime
import os
start = UTCDateTime() # time the program
#### Read program specs from the setup file
with open('SETUP/SETUP_bigWaveformPlot.txt', 'r') as f:
setup=f.read().splitlines()
MSEED_FILE=setup[0][11:]
TEXT_FILE=setup[1][10:]
IMAGE_FILE=setup[2][11:]
#### read in stream from file
stream = read(MSEED_FILE)
print(stream[0].stats.location)
with open(TEXT_FILE, 'w') as textFile:
textFile.write(stream.__str__(extended=True))
stream.plot(outfile=IMAGE_FILE)
#stream.plot(type='section',outfile=IMAGE_FILE)
print('\n\nRuntime: '+str(UTCDateTime()-start)+' seconds\n\n')
os.system('say "Waveform plotting complete"')
#################################################################