Changes for page FDSN Guide

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

From version 1.3
edited by robert
on 2025/03/24 10:07
Change comment: There is no comment for this version
To version 1.5
edited by robert
on 2025/03/24 10:08
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -43,7 +43,6 @@
43 43  
44 44  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.
45 45  
46 -
47 47  
48 48  = Earthquake Data =
49 49  
... ... @@ -74,4 +74,29 @@
74 74  catalog.write("Woodspoint_earthquakes.xml", format="QUAKEML")
75 75  {{/code}}
76 76  
76 +== How to plot (Global) Earthquakes ==
77 +
78 +{{code language="python"}}
79 +from obspy import UTCDateTime
80 +from obspy.clients.fdsn import Client
81 +
82 +# Initialize FDSN client to connect to the IRIS data center
83 +client = Client("IRIS")
84 +
85 +# Set the time range for fetching earthquake data
86 +# Start time: January 1, 2023
87 +# End time: Current time
88 +starttime = UTCDateTime("2023-01-01")
89 +endtime = UTCDateTime()
90 +
91 +# Fetch earthquake events with a minimum magnitude of 7
92 +catalog = client.get_events(starttime=starttime, endtime=endtime, minmagnitude=7)
93 +#client.get_events(). This function returns a Catalog object that contains a list of Event objects.
94 +#Each Event object, in turn, has an Origins attribute that contains the depth information
95 +
96 +# Plot the fetched earthquake data using an orthographic projection
97 +catalog.plot(projection="ortho", title="Global Earthquakes with Magnitude >= 7 since 2023")
98 +#catalog.plot(), ObsPy automatically uses the depth information to color the events in the plot
99 +{{/code}}
100 +
77 77