Wiki source code of FDSN Guide

Version 2.2 by robert on 2025/03/24 10:17

Hide last authors
robert 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
robert 1.2 5 = [[How to Install ObsPy>>url:https://github.com/obspy/obspy/wiki#installation]] =
6
7 = [[Seed-Vault>>https://github.com/AuScope/seed-vault]] =
8
robert 1.1 9 = Connecting to an FDSN Server =
10
robert 1.2 11 == How to connect to AusPass with & without authenticated access ==
12
13
14 {{code language="python"}}
15 import obspy
16 from obspy.clients.fdsn import Client
17
18 # Initialize FDSN client for AusPass
19
20 # For open access data, no username or password is required.
21 client = Client('AUSPASS')
22
23 # To access restricted data, supply your username and password
24 # Replace 'Z1' and '12345' with your actual credentials
25 client = Client('AUSPASS', user='Z1', password='12345')
26 {{/code}}
27
robert 1.1 28 = Station Metadata =
29
robert 2.2 30 Information such as site locations, sensor and data logger types, response information, etc are in the station metadata. This can be accessed directly(link) or via the obspy get_stations (link) tool.
robert 1.1 31
32
33 == Sub-paragraph ==
34
35 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
36
37 === Sub-sub paragraph ===
38
39 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
40
41
42 = Waveform Data =
43
robert 2.2 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).
robert 1.1 45
46
robert 1.3 47 = Earthquake Data =
robert 1.1 48
robert 2.2 49
50
robert 1.3 51 == How to download an Earthquake Catalog ==
52
53 {{code language="python"}}
54 from obspy.clients.fdsn import Client
55 from obspy import UTCDateTime
56
57 # Initialize the AusPass FDSN client
58 client = Client("AUSPASS")
59
60 # Define the time range for the earthquake catalog
61 start_time = UTCDateTime("2021-08-01")
62 end_time = UTCDateTime("2022-01-01") # End of year
63
64 # Define the geographic region (latitude and longitude for Woodspoint, Victoria, Australia)
65 latitude = -37.47
66 longitude = 146.10
67 max_radius = 5 # in degrees
68
69 # Download the earthquake catalog
70 catalog = client.get_events(starttime=start_time, endtime=end_time,
71 minmagnitude=2, latitude=latitude, longitude=longitude,
72 maxradius=max_radius)
73
74 # Save the catalog to a file (e.g., QuakeML format)
75 catalog.write("Woodspoint_earthquakes.xml", format="QUAKEML")
76 {{/code}}
77
robert 1.5 78 == How to plot (Global) Earthquakes ==
robert 1.4 79
80 {{code language="python"}}
81 from obspy import UTCDateTime
82 from obspy.clients.fdsn import Client
83
84 # Initialize FDSN client to connect to the IRIS data center
85 client = Client("IRIS")
86
87 # Set the time range for fetching earthquake data
88 # Start time: January 1, 2023
89 # End time: Current time
90 starttime = UTCDateTime("2023-01-01")
91 endtime = UTCDateTime()
92
93 # Fetch earthquake events with a minimum magnitude of 7
94 catalog = client.get_events(starttime=starttime, endtime=endtime, minmagnitude=7)
95 #client.get_events(). This function returns a Catalog object that contains a list of Event objects.
96 #Each Event object, in turn, has an Origins attribute that contains the depth information
97
98 # Plot the fetched earthquake data using an orthographic projection
99 catalog.plot(projection="ortho", title="Global Earthquakes with Magnitude >= 7 since 2023")
100 #catalog.plot(), ObsPy automatically uses the depth information to color the events in the plot
101 {{/code}}
102
robert 2.2 103 == How to plot (Local) Earthquakes ==
104
105 {{code language="python"}}
106 from obspy import UTCDateTime
107 from obspy.clients.fdsn import Client
108
109 # Initialize FDSN client
110 client = Client("AUSPASS")
111
112 # Define time range
113 starttime = UTCDateTime("2023-01-01")
114 endtime = UTCDateTime()
115
116 # Latitude and longitude bounds for Australia
117 minlatitude = -44.0
118 maxlatitude = -10.0
119 minlongitude = 113.0
120 maxlongitude = 154.0
121
122 # Fetch event data for Australia with a minimum magnitude
123 catalog = client.get_events(starttime=starttime, endtime=endtime, minmagnitude=4,
124 minlatitude=minlatitude, maxlatitude=maxlatitude,
125 minlongitude=minlongitude, maxlongitude=maxlongitude)
126
127 # Plot the earthquakes
128 catalog.plot(projection="local", title="Australia Earthquakes", resolution="i")
129 {{/code}}
130
robert 1.3 131