Changes for page FDSN Guide

Last modified by robert on 2025/03/24 12:02

From version 2.3
edited by robert
on 2025/03/24 10:21
Change comment: There is no comment for this version
To version 2.2
edited by robert
on 2025/03/24 10:17
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -43,124 +43,11 @@
43 43  
44 44  Waveform data (e.g. the actual seismic data) can be accessed directly (link) or via obspy's get_waveforms (link) tool. It can also be accessed via various tools such as seed-vault, pyweed, etc (add links).
45 45  
46 -== How to download waveform data ==
47 47  
48 -{{code language="python"}}
49 -from obspy import UTCDateTime
50 -from obspy.clients.fdsn import Client
51 -
52 -# Initialize the FDSN client (you can also specify other data centers)
53 -client = Client("AUSPASS")
54 -
55 -# Event information
56 -network = "S1"
57 -station = "AUGRF"
58 -starttime = UTCDateTime("2021-09-21T23:15:53") # The time of the earthquake
59 -endtime = starttime + 360 # One hour of data after the earthquake
60 -
61 -# Download the MiniSEED data
62 -st = client.get_waveforms(network=network, station=station, location="*", channel="BHZ",
63 - starttime=starttime, endtime=endtime)
64 -# Save the stream to a MiniSEED file
65 -st.write("Woodspoint_2021.mseed", format="MSEED")
66 -print("Downloaded and saved the MiniSEED file.")
67 -{{/code}}
68 -
69 -== How to remove instrument response ==
70 -
71 -{{code language="python"}}
72 -from obspy import read
73 -from obspy.core.util import AttribDict
74 -
75 -# Load the MiniSEED file
76 -st = read("Woodspoint_2021.mseed")
77 -
78 -# Download the instrument response
79 -inv = client.get_stations(network=network, station=station, location="*",
80 - channel="*", starttime=starttime, endtime=endtime,
81 - level="response")
82 -
83 -# Remove the instrument response
84 -output = 'VEL' # Output unit ('VEL' = velocity (default), 'DISP' = displacement, 'ACC' = acceleration)
85 -
86 -for tr in st:
87 - tr.remove_response(inventory=inv, output=output, plot=True)
88 -
89 -# Save the corrected MiniSEED file
90 -st.write("Woodspoint_2021_corrected.mseed", format="MSEED")
91 -{{/code}}
92 -
93 -== How to apply a bandpass filter ==
94 -
95 -{{code language="python"}}
96 -from obspy import read
97 -
98 -# Load the MiniSEED file
99 -st = read("Woodspoint_2021.mseed")
100 -
101 -# Define the frequency band
102 -freq_min = 0.1 # Minimum frequency in Hz
103 -freq_max = 1.0 # Maximum frequency in Hz
104 -
105 -# Apply the bandpass filter
106 -for tr in st:
107 - tr.filter(type='bandpass', freqmin=freq_min, freqmax=freq_max)
108 -
109 -# Save the filtered MiniSEED file
110 -st.write("Woodspoint_2021_filtered.mseed", format="MSEED")
111 -{{/code}}
112 -
113 -== How to slice a waveform ==
114 -
115 -{{code language="python"}}
116 -from obspy import read, UTCDateTime, Stream # Importing Stream here
117 -
118 -# Load the filtered MiniSEED file
119 -st = read("Woodspoint_2021_filtered.mseed")
120 -
121 -# Define the time window for slicing
122 -slice_start = UTCDateTime("2021-09-21T23:20:00")
123 -slice_end = slice_start +10
124 -
125 -# Slice the waveform for each Trace in the Stream
126 -sliced_st = Stream() # Now Stream is defined
127 -for tr in st:
128 - sliced_tr = tr.slice(starttime=slice_start, endtime=slice_end)
129 - sliced_st.append(sliced_tr)
130 -
131 -# Save the sliced MiniSEED file
132 -sliced_st.write("Woodspoint_2021_filtered_sliced.mseed", format="MSEED")
133 -{{/code}}
134 -
135 -== How to save a waveform ==
136 -
137 -{{code language="python"}}
138 -# Save the sliced file as MiniSEED
139 -sliced_st.write("Woodspoint_2021_filtered_sliced.mseed", format="MSEED")
140 -
141 -# Or, save the sliced SAC file
142 -sliced_st.write("Woodspoint_2021_filtered_sliced.sac", format="SAC")
143 -{{/code}}
144 -
145 -== How to convert miniseed to sac ==
146 -
147 -{{code language="python"}}
148 -from obspy import read
149 -
150 -# Read the MiniSEED file
151 -st = read("Woodspoint_2021.mseed")
152 -
153 -# Take the first Trace from the Stream
154 -tr = st[0]
155 -
156 -# Save that Trace as a SAC file
157 -tr.write("Woodspoint_2021.sac", format="SAC")
158 -{{/code}}
159 -
160 -
161 161  = Earthquake Data =
162 162  
163 163  
50 +
164 164  == How to download an Earthquake Catalog ==
165 165  
166 166  {{code language="python"}}