Changes for page FDSN Guide
Last modified by robert on 2025/03/24 12:02
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -43,8 +43,59 @@ 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 -== Sub-paragraph == 47 47 48 -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. 49 - 50 50 = Earthquake Data = 48 + 49 +== How to download an Earthquake Catalog == 50 + 51 +{{code language="python"}} 52 +from obspy.clients.fdsn import Client 53 +from obspy import UTCDateTime 54 + 55 +# Initialize the AusPass FDSN client 56 +client = Client("AUSPASS") 57 + 58 +# Define the time range for the earthquake catalog 59 +start_time = UTCDateTime("2021-08-01") 60 +end_time = UTCDateTime("2022-01-01") # End of year 61 + 62 +# Define the geographic region (latitude and longitude for Woodspoint, Victoria, Australia) 63 +latitude = -37.47 64 +longitude = 146.10 65 +max_radius = 5 # in degrees 66 + 67 +# Download the earthquake catalog 68 +catalog = client.get_events(starttime=start_time, endtime=end_time, 69 + minmagnitude=2, latitude=latitude, longitude=longitude, 70 + maxradius=max_radius) 71 + 72 +# Save the catalog to a file (e.g., QuakeML format) 73 +catalog.write("Woodspoint_earthquakes.xml", format="QUAKEML") 74 +{{/code}} 75 + 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 + 101 +