The below code is available from the tutorial. I would like to know how I can read my own .csv file and analyze the waveform using obsPy packages?
from obspy.core import read
st = read(“https://examples.obspy.org/ev0_6.a01.gse2”)
st = st.select(component=“Z”)
tr = st
What does your csv file format look like? For reading text based waveform formats, you could look at the reader routines of TSPAIR and SLIST formats to get started: obspy/core.py at 884e1a423a12695fd9661f0a57cfa7d7b2dbb4de · obspy/obspy · GitHub
It’s a .CSV (basically an Excel sheet) file with just one column vector of values between 0 and 1. I’m trying obspy packages in Google Collab and I would like to know how I can read a local file from my system using obspy read function.
You could use
numpy.loadtxt to load the file into a numpy array and create an ObsPy trace by initializing a
I’m able to upload my file.