Author Topic: Earthquake and local seismic data  (Read 2320 times)

0 Members and 1 Guest are viewing this topic.

Offline marshad

  • Member
  • *
  • Posts: 22
Earthquake and local seismic data
« on: May 20, 2021, 11:59:22 AM »
Here is an example of my local seismic data.
 [ You are not allowed to view attachments ]

It represents the last 3 hours data from my local seismograph station and also the last important event.

If, like me, you are in a seismic zone and are interested, here is how to obtain it.

Go to this site: https://www.orfeus-eu.org/data/eida/

Find the station closest to you that is active and note the archive and station code. Apologies, this is a European site - there will be an equivalent for the USA.

To get the data and process it you will need python and specifically a python library called obspy - https://docs.obspy.org/

You will also need matplotlib and numpy.

Here is the python code to produce the last 3 hours seismic data:

import matplotlib
matplotlib.use('Agg')
from obspy.clients.fdsn import Client
from datetime import datetime
from obspy import UTCDateTime
from pytz import timezone
zonename = "UTC"
now = datetime.now(tz=timezone(zonename))

#this is the archive name
client = Client("INGV")
#the first and second part of the station identifier
net = "IV"
station = "PLMA"

t = UTCDateTime(now)

#this returns all the available data for the last 3 hours
st = client.get_waveforms(net, station, "*", "*", t - 3*60*60, t)

#and saves it graphically
st.plot(color = 'red', outfile='seismic.png')
#end
To get the data for a specific event you just need to change t.

Read the obspy documentation for more options.

http://moonappreciationsociety.com/Meteo/VillarPerosa

Offline zoomx

  • Senior Contributor
  • ****
  • Posts: 198
Re: Earthquake and local seismic data
« Reply #1 on: May 21, 2021, 02:41:51 PM »
Great, thank you!

to install matplotlib in debian distribution and python3
Code: [Select]
sudo apt-get install python3-matplotlibthen numpy
Code: [Select]
pip3 install numpyand finally ObsPy
Code: [Select]
pip3 install obspyThen I got an error since my numpy version was too old 1.13.3 so
Code: [Select]
pip3 install numpy --upgradeThen I got another error since there was no data for the station chosen
Code: [Select]
obspy.clients.fdsn.header.FDSNNoDataException: No data available for request.I changed station and got my quake
 [ You are not allowed to view attachments ]
this one
2021-05-21 18:04:15UTC    Mwp 7.0    Qinghai, China [Land: China]
« Last Edit: May 21, 2021, 03:39:44 PM by zoomx »

Offline marshad

  • Member
  • *
  • Posts: 22
Re: Earthquake and local seismic data
« Reply #2 on: May 22, 2021, 05:44:08 AM »
Well done! And thanks for giving the detail for the matplotlib and numpy installation - I should have included it in my post.

http://moonappreciationsociety.com/Meteo/VillarPerosa

Offline zoomx

  • Senior Contributor
  • ****
  • Posts: 198
Re: Earthquake and local seismic data
« Reply #3 on: May 22, 2021, 07:25:30 AM »
For installation I simply searched on search engines and I learned that pip doesn't upgrade libraries, the same for apt.
Forgot to tell that all commands must be preceded by sudo if you are not working as root, the Administrator account in Unix/Linux.
.