xumi1993 / seispy Goto Github PK
View Code? Open in Web Editor NEWPython module of seismology and receiver functions
Home Page: https://seispy.xumijian.me
License: GNU General Public License v3.0
Python module of seismology and receiver functions
Home Page: https://seispy.xumijian.me
License: GNU General Public License v3.0
Hi seispy developer,
I tried to use prf rf.cfg
to calculate RFs of a single station and encountered the following errors:
Here is command log:
2022-07-13 15:28:36,837 [RF] INFO: Load station info from ./rawdata/1001 2022-07-13 15:28:36,838 [RF] INFO: Searching earthquakes from IRIS 2022-07-13 15:28:38,722 [RF] INFO: 22 earthquakes are found 2022-07-13 15:28:38,722 [RF] INFO: Match SAC files 2022-07-13 15:28:38,724 [RF] ERROR: unconverted data remains: 5
Describe the bug
wyb@Wufatian:/mnt/c/Users/22247/Desktop/littledata/ex-prf/ex-prf$ srf rf.cfg -p
2023-11-25 16:41:04,288 [RF] INFO: Load station info from ./Data.CB.NJ2
2023-11-25 16:41:04,292 [RF] INFO: CB.NJ2, latitude: 32.052, longitude: 118.854
2023-11-25 16:41:04,292 [RF] INFO: Searching earthquakes from IRIS
2023-11-25 16:41:11,969 [RF] INFO: 204 earthquakes are found
2023-11-25 16:41:11,970 [RF] INFO: Associating SAC files with earthquakes
2023-11-25 16:41:14,509 [RF] INFO: 52 earthquakes are associated
2023-11-25 16:41:14,509 [RF] INFO: Detrend all data
2023-11-25 16:41:14,829 [RF] INFO: Filter all data from 0.03 to 1.0
2023-11-25 16:41:15,133 [RF] INFO: Calculate P arrivals and ray parameters for all data
2023-11-25 16:41:15,571 [RF] INFO: Reject data record with SNR less than 3.0
2023-11-25 16:41:15,698 [RF] INFO: 47 events left after SNR calculation
2023-11-25 16:41:15,698 [RF] INFO: Rotate P phase to ZNE->LQT
2023-11-25 16:41:15,736 [RF] INFO: Pre-pick P arrival using STA/LTA method
Traceback (most recent call last):
File "/home/wyb/.local/bin/srf", line 8, in
sys.exit(srf())
File "/home/wyb/.local/lib/python3.8/site-packages/seispy/scripts.py", line 216, in srf
pjt.pick()
File "/home/wyb/.local/lib/python3.8/site-packages/seispy/rf.py", line 464, in pick
row['data'].phase_trigger(self.para.time_before, self.para.time_after,
File "/home/wyb/.local/lib/python3.8/site-packages/seispy/eq.py", line 282, in phase_trigger
tr = self.st_pick.select(channel='*Z')[0]
File "/home/wyb/.local/lib/python3.8/site-packages/obspy/core/stream.py", line 643, in getitem
return self.traces.getitem(index)
IndexError: list index out of range
Describe the bug
The naming of station name seem not consistant in different modules
for example in rfcorrect.py the staname is {net}.{station}
but in ccpprofile.py the staname is just station
since they both read station from same list (in ccp.cfg), this would cause some inconvinience
For example i have a station name TR01 in net TW, and my station list is also naming it TR01.
When saving data in rfdepth, it would be named as TW.TR01. But when doing ccpstacking, it would say that the station TR01 is not in rfdepth structure. Then I would have to rename my station in list to TW.TR01, it would work as expected.
Expected behavior
using same config (station list) for rfdepth and ccpprofile should not cause this error
Error raised
2024-05-01 10:01:10,591 [CCP] WARNING: TR01 does not in RFdepth structure
Platform (please complete the following information):
Additional context
I think when saving data in rfdepth, just use the station name without the network.
Add a function in seispy.rf
for re-matching eq_lst
with finallist
.
#Several earthquake events like those in the example folder were applied for in IRIS, but the earthquake events were not matched when the command was executed. Is this related to the header information of the applied earthquake events?
2022-07-29 11:40:38,587 [RF] INFO: Load station info from ./NJ
2022-07-29 11:40:38,609 [RF] INFO: Searching earthquakes from IRIS
2022-07-29 11:40:43,914 [RF] INFO: 33 earthquakes are found
2022-07-29 11:40:43,943 [RF] INFO: Match SAC files
2022-07-29 11:40:43,987 [RF] ERROR:
2022-07-29 11:40:43,991 [RF] ERROR:
2022-07-29 11:40:43,994 [RF] ERROR:
2022-07-29 11:40:43,997 [RF] ERROR:
2022-07-29 11:40:44,000 [RF] ERROR:
2022-07-29 11:40:44,001 [RF] WARNING: No earthquakes matched, please check configurations.
2.The following is my script for applying for earthquake events on IRIS
import os
import obspy
import numpy as np
from obspy import UTCDateTime
from matplotlib import pyplot as plt
##from obspy.clients.fdsn import Client
from obspy.clients.fdsn import Client
from obspy.clients.fdsn.mass_downloader import RectangularDomain, \
Restrictions, MassDownloader
client = Client('IRIS')
time = UTCDateTime('2014-02-02T09:26:41')
starttime = time + 00
endtime = starttime + 1000
net = 'CB'
sta = 'NJ2'
loc = '00'
chan = 'BHZ'
Format = "SAC"
st = client.get_waveforms(net,sta,loc,chan,starttime,endtime)#,attach_response = True)
st.plot()
time_name = obspy.UTCDateTime.strftime(time, '%Y.%j.%H%M%S')
dir_name = 'D:\\EVENTS\\NJ2\\'
if not os.path.exists(dir_name):
os.mkdir(dir_name)
Filename_path = os.path.join(dir_name, net + '.' + sta + '.' + loc + '.' + chan + '.' + 'M' + '.' + time_name + '.' + 'SAC')
st.write(filename=Filename_path, formate=Format)
print("%s写入完成!" % Filename_path)
The data of Nanjing station applied with this script cannot match.The applied sac documents are CB.NJ2.00.BHZ.M.2014.001.160334.SAC, CB.NJ2.00.BHZ.M.2014.020.025250.SAC, CB.NJ2.00.BHZ.M.2014.021.012920.SAC, CB.NJ2.00.BHZ.M.2014.025.051422.SAC and CB.NJ2.00.BHZ.M.2014.033.092641.SAC respectively
While running the rf2depth function, the ray parameter values are getting an error.
It happens with or without rayparameter file in the config.
HERE IS THE ERROR:
rf2depth ccp.cfg
2024-04-16 12:28:09,019 [RF2depth] INFO: the 1th/1 station with 73 events
/Users/xxx/anaconda3/envs/seispy/lib/python3.11/site-packages/seispy/core/depmodel.py:355: RuntimeWarning: invalid value encountered in sqrt
hor_dis = np.cumsum((self.dz / radius) / np.sqrt((1. / (rayp ** 2. * (radius / vel) ** -2)) - 1))
/Users/xxx/anaconda3/envs/seispy/lib/python3.11/site-packages/seispy/core/depmodel.py:275: RuntimeWarning: invalid value encountered in sqrt
np.sqrt((radius / self.vp) ** 2 - raypp ** 2)) *
Is your feature request related to a problem? Please describe.
SKS and SKKS phases can be used for SRF.
Describe the solution you'd like
Add support for SKS and SKKS in the para.phase
.
Describe alternatives you've considered
Test it on real data.
Please I have been stuck with this response error. I checked the configuration to see what could be wrong but I'm not so sure what else to check. The data set are raw data from station archives.
Here is the command and the response
khalix@Khalix-VirtualBox:~/Desktop/RF$ prf rf.cfg
2022-09-23 17:56:02,221 [RF] INFO: Load station info from ./Data.N1.NGSA1
2022-09-23 17:56:02,269 [RF] INFO: Searching earthquakes from IRIS
2022-09-23 17:56:21,072 [RF] INFO: 176 earthquakes are found
2022-09-23 17:56:21,073 [RF] INFO: Match SAC files
2022-09-23 17:56:21,280 [RF] WARNING: No earthquakes matched, please check configurations.
Thank you
在将psrayp迁移到SRF以及其他震相上,有几个东西不是很理解:
taup -ph P40s,P60s -deg 60 -h 10
这样的结果,实际上只是得到了35km处间断面Ps波的信息。是否需要根据layers的划分单独生成一个model来做()。第一个问题很好解决。
这个我们可以使用DepModel和layers做插值后,生成tvel格式的速度文件给taup算。
但是还是得明确与深度的明确关系,以及怎么生成格式正确的rayplib。
I am using the RF package, and the data I am loading in from IRIS has EHZ,EH1,EH2 channels. The EH1 and EH2 channel azimuths need to be corrected by anywhere from -6 to +6 degrees, and EHZ dip needs to be changed from 90 to -90, depending on the station. It does not appear this package automatically corrects the azimuth. I see there is a baz_shift variable in rotate in RF and also seispy.eq.rotate_ZNE in the the seispy package.
Is the baz_shift what I need or do I need to use seispy.eq.rotate_ZNE? If I need to use seispy.eq.rotate_ZNE, how do I implement this in the RF package and data I am loading in through query.
Here is a snippet of the code I am using with rf.rotate(baz_shift=6)
rf.load_stainfo()
rf.search_eq(catalog='NEIC PDE')
print(rf.eq_lst) ##The matched event lists are listed.
rf.match_eq()
rf.detrend()
rf.filter()
rf.cal_phase()
rf.rotate(baz_shift=6) #Like this?
rf.drop_eq_snr()
rf.save_raw_data()
rf.trim()
rf.deconv()
Describe the bug
A clear and concise description of what the bug is.
Expected behavior
A clear and concise description of what you expected to happen.
Error raised
If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
Additional context
Add any other context about the problem here.
I tried to use the earthquakes with epicental distance of 25°-150° to calculate RFs as the short-period seismic observation time is limited, but failed for ValueError: The phase of P is not exists
. I have successfully calculated RFs using earthquakes with epicental distance of 30°-90° by seispy before. So I want to ask what could lead to this failure and whether seispy support to use PP phase signals.
2022-10-10 16:19:57,143 [RF] INFO: 160 earthquakes are found
2022-10-10 16:19:57,144 [RF] INFO: Match SAC files
2022-10-10 16:19:57,981 [RF] INFO: 73 earthquakes are matched
2022-10-10 16:19:57,981 [RF] INFO: Detrend all data
2022-10-10 16:19:59,682 [RF] INFO: Filter all data from 0.05 to 2.0
2022-10-10 16:20:00,284 [RF] INFO: Calculate P arrivals and ray parameters for all data
Traceback (most recent call last):
File "/raid/mengjie/SouthChina/RFs/run.py", line 46, in
pjt.cal_phase()
File "/raid/mengjie/anaconda3/envs/seis/lib/python3.10/site-packages/seispy/rf.py", line 354, in cal_phase
row['data'].get_arrival(self.model, row['evdp'], row['dis'], phase=self.para.phase)
File "/raid/mengjie/anaconda3/envs/seis/lib/python3.10/site-packages/seispy/eq.py", line 108, in get_arrival
raise ValueError('The phase of {} is not exists'.format(phase))
ValueError: The phase of P is not exists
Describe the bug
The program crashes when I am processing receiver functions, and inputs in the configuration files are well set
Expected behavior
One P phase?
Error raised
If applicable, add screenshots to help explain your problem.
2024-04-06 17:57:14,564 [RF] INFO: Calculate P arrivals and ray parameters for all data
Traceback (most recent call last):
File "/opt/anaconda3/envs/seispy/bin/prf", line 8, in
sys.exit(prf())
^^^^^
File "/opt/anaconda3/envs/seispy/lib/python3.11/site-packages/seispy/scripts.py", line 178, in prf
pjt.cal_phase()
File "/opt/anaconda3/envs/seispy/lib/python3.11/site-packages/seispy/rf.py", line 436, in cal_phase
row['data'].get_arrival(self.model, row['evdp'], row['dis'], phase=self.para.phase)
File "/opt/anaconda3/envs/seispy/lib/python3.11/site-packages/seispy/eq.py", line 185, in get_arrival
raise ValueError('More than one phase were calculated with distance of {} and focal depth of {}'.format(dis, evdp))
ValueError: More than one phase were calculated with distance of 18.761302041426234 and focal depth of 10.0
Platform (please complete the following information):
Please I'm still learning how to run PRF for a single station with multiple events with the example you provided in the script but each time i run the command 'prf rf.cfg'. I keep getting (invalid syntax)
Input In
prf rf.cfg
^
SyntaxError: invalid syntax
thank you for your help
Originally posted by tianjueli April 14, 2022
Hi Mijian,
I'm trying to use module pickrf to visually check RF waveforms, while encountered such error:
"(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8033:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8047:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8051:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8058:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8065:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8072:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.848: Theme parsing error: gtk.css:8076:53: Invalid name of pseudo-class
(python3.8:2056688): Gtk-WARNING **: 11:29:47.849: Theme parsing error: gtk.css:8081:53: Invalid name of pseudo-class
2022-04-14 11:29:47,943 [RF] INFO: Reading PRFs from ./ZX.256
2022-04-14 11:29:48,610 [RF] INFO: A total of 123 PRFs loaded
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.8/site-packages/obspy/core/util/attribdict.py", line 142, in getattr
return self.getitem(name, default)
File "/opt/anaconda3/lib/python3.8/site-packages/obspy/core/util/attribdict.py", line 97, in getitem
return self.dict[name]
KeyError: 'ka'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/anaconda3/bin/pickrf", line 8, in
sys.exit(main())
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickui.py", line 190, in main
ui = MatplotlibWidget(rfpath, only_r=only_r, xlim=[-2, xlim], order=arg.order)
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickui.py", line 45, in init
self.initUi(rfpath, only_r, xlim, order=order)
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickui.py", line 50, in initUi
self.mpl = MyMplCanvas(self, rfpath=rfpath, only_r=only_r, width=21, height=11,
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickui.py", line 29, in init
self.rffig.init_canvas(order=order)
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickfigure.py", line 56, in init_canvas
self.read_sac(order=order)
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickfigure.py", line 151, in read_sac
self.phases = [tr.stats.sac.ka for tr in self.rrf]
File "/opt/anaconda3/lib/python3.8/site-packages/seispy/pickfigure.py", line 151, in
self.phases = [tr.stats.sac.ka for tr in self.rrf]
File "/opt/anaconda3/lib/python3.8/site-packages/obspy/core/util/attribdict.py", line 144, in getattr
raise AttributeError(e.args[0])
AttributeError: ka"
The command I used is "pickrf ./ZX.256", where ZX.256 is an example station provided by ex-ccp.tar.gz.
Hi all,
I have been encountering an issue while downloading data from a server for the selected channel 'HH?' using the configuration below. The error message suggests that some events have more than 3 components, prompting the need to delete redundant seismic components.
Here is the output of the run:
2024-01-28 16:13:12,512 [RF] INFO: Fetch waveforms of (160/451) event 2010.357.14.00.32 from KOERI
2024-01-28 16:13:12,928 [RF] INFO: Fetch waveforms of (161/451) event 2011.012.21.32.53 from KOERI
2024-01-28 16:13:13,390 [RF] INFO: Fetch waveforms of (162/451) event 2011.018.20.23.23 from KOERI
2024-01-28 16:13:13,833 [RF] INFO: Fetch waveforms of (163/451) event 2011.041.14.39.27 from KOERI
2024-01-28 16:13:14,189 [RF] ERROR: 2011.041.14.49.50 has more than 3 components, please select to delete redundant seismic components
2024-01-28 16:13:14,231 [RF] INFO: Fetch waveforms of (164/451) event 2011.041.14.41.58 from KOERI
2024-01-28 16:13:14,575 [RF] ERROR: 2011.041.14.52.21 has more than 3 components, please select to delete redundant seismic components
2024-01-28 16:13:14,582 [RF] INFO: Fetch waveforms of (165/451) event 2011.068.02.45.20 from KOERI
2024-01-28 16:13:14,935 [RF] INFO: Fetch waveforms of (166/451) event 2011.068.21.24.01 from KOERI
2024-01-28 16:13:15,238 [RF] INFO: Fetch waveforms of (167/451) event 2011.070.05.46.24 from KOERI
I copied the config file below:
query = Query(server='KOERI')
query.get_stations(network='KO', station=station_name, level='channel', 'channel=HH?')
print(query.stations)
rf = RF()
rf.para.data_server = 'KOERI'
rf.para.cata_server = 'IRIS'
rf.para.stainfo.network = 'KO'
rf.para.stainfo.station = station_name
rf.para.stainfo.channel = 'HH?'
rf.para.stainfo.location = '*'
rf.para.datapath = './Data/{}.{}'.format(rf.para.stainfo.network, rf.para.stainfo.station)
rf.para.use_remote_data = True
rf.para.ref_comp ='HHZ'
rf.para.phase = 'P'
rf.para.noisegate = 1
rf.para.magmin = 6.3
rf.para.gauss = [1.0,1.5,2.0,2.5] ##RF with different Gauss factor will be calculated simultaneously.
rf.para.rmsgate = 0.4
rf.para.freqmin = 0.05
rf.para.freqmax = 2.0
rf.para.comp = 'RTZ'
rf.para.date_begin = UTCDateTime('20000101')
rf.para.date_end = UTCDateTime('20231231')
Additionally, I often have data from both BH and HH components for the same station, and it would be helpful to prioritize one over the other.
Can someone help me understand why this error is occurring, and how I can address it? Also, any suggestions on giving priority to either BH or HH components for the same station would be appreciated.
Thank you!
Describe the bug
when I run the command prf rf.cfg -l in ex-batrf folder there is a bug : ERROR: Could not parse './evts.dat' to an etree element.
it's ok to run prf rf.cfg, i guass the local catalog may have some problem
Describe the bug
When running rf2depth ccp.cfg, some bugs happend:
File "/home/dell/anaconda3/envs/seispy/bin/rf2depth", line 10, in <module>
sys.exit(rf2depth())
File "/home/dell/anaconda3/envs/seispy/lib/python3.8/site-packages/seispy/rf2depth_makedata.py", line 183, in rf2depth
makedata(cpara)
File "/home/dell/anaconda3/envs/seispy/lib/python3.8/site-packages/seispy/rf2depth_makedata.py", line 98, in makedata
PS_RFdepth, end_index, x_s, _ = psrf2depth(stadatar, cpara.depth_axis,
File "/home/anaconda3/envs/seispy/lib/python3.8/site-packages/seispy/rfcorrect.py", line 298, in psrf2depth
tps[i], x_s[i], x_p[i] = xps_tps_map(dep_mod, rayp, stadatar.rayp[i])
File "/home/dell/anaconda3/envs/seispy/lib/python3.8/site-packages/seispy/rfcorrect.py", line 335, in xps_tps_map
x_s = np.cumsum((dep_mod.dz / dep_mod.R) / np.sqrt((1. / (srayp ** 2. * (dep_mod.R / dep_mod.vs) ** -2)) - 1))
ValueError: operands could not be broadcast together with shapes (801,) (803,)
I think there are some bugs about topographic correction. So I cancelled topographic correction for temporary use by adding elevation=0
in utils.py.
Now it works, but there are still some warnings in Seispy 1.2.15, these warnings disappear when changing to version 1.2.14.
/home/dell/anaconda3/envs/seispy/lib/python3.8/site-packages/python_seispy-1.2.15-py3.8.egg/seispy/rfcorrect.py:387: RuntimeWarning: invalid value encountered in sqrt
x_p = np.cumsum((dep_mod.dz / dep_mod.R) / np.sqrt((1. / (prayp ** 2. * (dep_mod.R / dep_mod.vp) ** -2)) - 1))
/home/dell/anaconda3/envs/seispy/lib/python3.8/site-packages/python_seispy-1.2.15-py3.8.egg/seispy/utils.py:78: RuntimeWarning: invalid value encountered in sqrt
return np.cumsum((np.sqrt((dep_mod.R / dep_mod.vs) ** 2 - rayps ** 2) - np.sqrt((dep_mod.R / dep_mod.vp) ** 2 - raypp ** 2)) * (dep_mod.dz / dep_mod.R))
Platform (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
when i try to download XR.ST39, there are 2 erros:
2024-03-05 22:29:34,225 [RF] INFO: Load station info of XR.ST39 from IRIS web-service
2024-03-05 22:29:34,749 [RF] INFO: XR.ST39, latitude: 33.764, longitude: 88.400
2024-03-05 22:29:34,749 [RF] INFO: Searching earthquakes from IRIS
2024-03-05 22:29:41,680 [RF] INFO: 156 earthquakes are found
2024-03-05 22:29:41,681 [RF] INFO: Fetch seismic data from IRIS
2024-03-05 22:29:41,701 [RF] ERROR: More than one phase were calculated with source depth of 33.0 and distance of 14.551067692913245
2024-03-05 22:29:41,701 [RF] ERROR: cannot access local variable 'arr_time' where it is not associated with a value
date evla evlo evdp mag magtype
0 1998-07-12T07:16:16.640000Z 47.722 82.882 33.0 5.2 mwc
1 1998-07-15T04:36:01.080000Z 29.576 81.466 33.0 4.7 mb
2 1998-07-18T01:40:30.210000Z 35.303 81.560 33.0 4.6 mb
3 1998-07-18T06:21:17.010000Z 35.357 78.378 33.0 4.8 mb
4 1998-07-19T16:56:46.190000Z 35.517 78.286 33.0 4.8 mb
.. ... ... ... ... ... ...
151 1999-11-30T10:08:08.100000Z 36.306 81.273 33.0 4.9 mb
152 1999-12-01T13:56:43.750000Z 30.024 81.444 33.0 4.5 mb
153 1999-12-06T07:33:11.160000Z 42.629 76.322 20.9 5.2 mwc
154 1999-12-17T10:15:02.200000Z 40.759 77.272 33.0 4.5 mb
155 1999-12-20T11:46:54.290000Z 24.517 97.774 52.1 4.6 mb
[156 rows x 6 columns]
an error occurred: cannot access local variable 'arr_time' where it is not associated with a value
Additional context
while other stations like XR.ST00-XR.ST10 works well,here is my code:
rf = RF()
rf.para.data_server = 'IRIS'
rf.para.cata_server = 'IRIS'
rf.para.stainfo.network = 'XR'
rf.para.stainfo.station = 'ST39'
rf.para.stainfo.channel = 'BH?'
rf.para.stainfo.location = '01'
rf.para.datapath = './Data_INDEPTH3/{}.{}'.format(rf.para.stainfo.network, rf.para.stainfo.station)
rf.para.use_remote_data = True
rf.para.ref_comp ='BHZ'
rf.para.phase = 'P'
rf.para.noisegate = 1
rf.para.magmin = 4.5
rf.para.dismin = 5
rf.para.dismax = 15
rf.para.depthmax = 80
rf.para.gauss = [0.5, 1.0, 1.5, 2.0] ##RF with different Gauss factor will be calculated simultaneously.
rf.para.rmsgate = 0.4
rf.para.freqmin = 0.05
rf.para.freqmax = 2.0
rf.para.comp = 'RTZ'
rf.para.date_begin = UTCDateTime('19970711')
rf.para.date_end = UTCDateTime('19991231')
rf.load_stainfo()
rf.search_eq(catalog='NEIC PDE')
print(rf.eq_lst) ##The matched event lists are listed
rf.match_eq()
rf.save_raw_data()
rf.eqs.to_csv('{}/eqs.csv'.format(rf.para.datapath))
Is your feature request related to a problem? Please describe.
Username and Password protected federated data cannot be accessed in IRIS web service
error received:
2023-09-01 22:55:27,784 [RF] ERROR: Error in loading station info: No data available for request.
HTTP Status code: 204
Detailed response of server:
Describe the solution you'd like
Area to enter username and password as a variable in the parameter file
Describe alternatives you've considered
I tried to manually enter it into the code but was unsuccessful
Additional context
Add any other context or screenshots about the feature request here.
Thank you
A wonderful tool, especially for a newbie of receiver functions.
When I used the pickrf
to my own data, due to the time window is too long, it's not convenient to focus the desiring seismic phases. Thus I would suggest adding the customizing setting for time window length.
hello developer,
I quite enjoy your code on rf analysis. following the example and the script, i got stuck during deconvolution processing.
here is my code
f0 = 2.0
itmax = 400
minderr = 0.001
rf = RFTrace.deconvolute(st_rot[1], st_rot[2],
method='iter',
tshift=shift,
f0=f0,
itmax=itmax,
minderr=minderr)
rf.plot(show = False, type = 'relative',
starttime = rf.stats.starttime + shift,
endtime = rf.stats.starttime + shift + 30)
And here is the response
NameError Traceback (most recent call last)
Input In [12], in
2 itmax = 400
3 minderr = 0.001
----> 4 rf = RFTrace.deconvolute(st_rot[1], st_rot[2],
5 method='iter',
6 tshift=shift,
7 f0=f0,
8 itmax=itmax,
9 minderr=minderr)
10 rf.plot(show = False, type = 'relative',
11 starttime = rf.stats.starttime + shift,
12 endtime = rf.stats.starttime + shift + 30)
NameError: name 'RFTrace' is not defined
Please help. I'm a new user
Thank you
因为始终叠加不到bin里,在为SRF CCP stacking写点东西。
先说下bug原因。之前用相同台站做过PRF CCP stacking,结果比较准确。然后把里面xps的功能拆出来写了个时深转换的功能,PRF与SRF的Moho深度还比较一致。所以这个问题比较奇怪。
rayp写的是s/deg,SRF是倒转了时间序列的,没有给rayp_lib,也就是采用平面波假设。
速度模型这边,尝试了原始速度模型和Vp,Vs调换的速度模型
有几件内容想不太明白,可能是几个公式,几个功能比较重叠,给整迷糊了
目前做完的一些简化的东西:
Hello, I was trying to do some tests with the ccp_profile function and I can't make the circle shape bin to work because it shows the error:
Traceback (most recent call last):
File "/home/felipe/.local/bin/ccp_profile", line 8, in
sys.exit(ccp_profile())
File "/home/felipe/.local/lib/python3.8/site-packages/seispy/scripts.py", line 94, in ccp_profile
ccp.stack()
File "/home/felipe/.local/lib/python3.8/site-packages/seispy/ccpprofile.py", line 228, in stack
for k in idxs:
TypeError: 'int' object is not iterable
Matter-of-factly I looked in the ccpprofile.py routine and I didn't get how it would interate with the idxs bin a number because in the function "stack(self)" we get :
...
if self.cpara.width is None and self.cpara.shape == 'circle':
idxs = self.idxs[i]
else:
idxs = self.idxs
for j, dep in enumerate(self.cpara.stack_range):
idx = int(j * self.stack_mul + self.cpara.stack_range[0]/self.cpara.dep_val)
bin_dep_amp = np.array([])
for k in idxs:
stop_idx = np.where(self.rfdep[k]['stopindex'] >= idx)[0]
fall_idx = np.where(distaz(self.rfdep[k][field_lat][stop_idx, idx], self.rfdep[k][field_lon][stop_idx, idx],
bin_info[0], bin_info[1]).delta < self.fzone[j])[0]
meaning that, if we choose a circle we only get a int that is not interable. So, I commonly don't see something here, so can someone help what I didn't get right, please?
Is your feature request related to a problem? Please describe.
Mutitheard downloading waveforms.
Describe the solution you'd like
star_download
ThreadPool
and throw arguments of star_download
into the ThreadPool
.mass_download
in obspydef star_download_mseed(args):
"""
Star maps the arguments to the
utils.download_and_split_mseed_bulk() function.
:param args: The arguments to be passed.
"""
try:
ret_val = utils.download_and_split_mseed_bulk(
*args, logger=self.logger)
except utils.ERRORS as e:
msg = ("Client '%s' - " % args[1]) + str(e)
if "no data available" in msg.lower():
self.logger.info(msg.split("Detailed response")[0].strip())
else:
self.logger.error(msg)
return []
return ret_val
pool = ThreadPool(min(threads_per_client, len(chunks)))
pool.map(
star_download_mseed,
[(self.client, self.client_name, chunk) for chunk in chunks])
pool.close()
Add UI for picking SRF via PyQt5
Post-processing of SRF is a new feature for the next version. Following cases need to be tested and compared with other RF code
Hii, seispy developer, I am running your example script https://seispy.xumijian.me/usage/calrf.html for gaining some knowledge regarding receiver functions.I have a very small querry, can the numpy.ndarray can be saved to the sac file after this step
PRF_R, RMS, it = seispy.decon.deconit(R, Z, dt, R.shape[0], shift, f0, tmax, minderr)
I want to write PRF_R to be saved in sac file by something PRF_R.write('outfile',format='SAC'), When i does it gives error AttributeError: 'numpy.ndarray' object has no attribute 'write'
I hope developers may help me overcoming my problem.Thanks in advance.
#Consult the seispy library for problems related to calculating a seismic event receiving function separately
File f:\Python\Python309\lib\site-packages\obspy\core\stream.py:643, in Stream.__getitem__(self, index)
641 return self.__class__(traces=self.traces.__getitem__(index))
642 else:
--> 643 return self.traces.__getitem__(index)
IndexError: list index out of range
Windows 10
;
Python 3.10.2
;
pip install python-seispy
。
Hi, very thank you to develop receiver function in python !
However, when I tried to use seispy, I confused what paraRF.cfg metioned.
Like as
data_path = /Users/xumj/Documents/sac/rftest/
out_path = /Users/xumj/Documents/sac/rftest/cut
What kind of data I should put data in ? Only put in data_path ? or both?
evt_list = ./EventCMT.dat
And what kind of catalog to use ?
It will be very useful to upload example files for people trying seispy !
Thank you again !
Describe the bug
I was trying to use water lever deconvolution method, but it raises the following error:
rf=RFTrace.deconvolute(st.select(component="R"), st.select(component="Z"), method='water', tshift=shift, f0=f, wlevel=0.01)
File "/home/felipe/.local/lib/python3.9/site-packages/seispy/decon.py", line 232, in deconvolute
header = utr.stats.getstate()
AttributeError: 'Stream' object has no attribute 'stats'`
as if it calls not the trace, the obspy stream to it, but I don't know how to fix it. I think it's a general bug, but I am using a Linux mint 20.2.
I'm trying to modify class RFStation from 3 aspect.
a obspy.core.trace.add_processing_info
like decorator. Introduce a compatible and easier way to add processing info to given logger (almost done)
RMS and other method for quality control before stacking.( optional )
simplify init and introduce more magic method to support future development.
Hii seispy developer. How to prepare complete raw data collected from a offline station for receiver function processing.
Hello, seispy developer, when I ran the script,I found that the 28th line of the 'eq.py' script indicated that the seismic event must have three components. However, when matching seismic events, the number of components of seismic events due to different location codes will be multiples of three.
For example, if there are six or nine components, it will prompt "No earthquakes matched, please check configurations." , but it is difficult for user to know what caused it.
I think it is possible to add a judgment statement after line 28 in the 'eq.py' script whether each earthquakes event has only three components. If not, you can prompt "Each earthquake event in the file has more than three components, please select to delete redundant seismic components" .
Hello~ I'm a user of seispy. Recently I tried to use seispy to calculate SRF. Unfortunately, I didn't find the configuration template file for SRF (hope I didn't miss it by negligence?) on the documentation website.
Although a template file for PRF is available, the differences may still be hard to tackle for beginners like me :)
For example, I just realized that I need to put phase = S in the configuration if the srf command is used, instead of not putting it in, or taking it for phase = 'S'. Later I tried to retrieve Q component SRF, but this time I can't find the suitable settings for that :(
So I'm here to ask if a configuration template file for SRF is/will be available. Really appreciate it if letting me know~
#Error calling psrf2depth function
TypeError Traceback (most recent call last)
TypeError: psrf2depth() got an unexpected keyword argument 'sampling'
Describe the bug
I was running the usual workflow doing time to depth migration using rf2depth module, but ran in to arror somewhere reading depmodel. I was using same vmod as I was in seispy 1.3.4, but after updating to 1.3.5 it show this error. I downgrade my package and it worked again.
Expected behavior
should run a time migration and output an npy file
Error raised
File "/home/scshao/.conda/envs/seispy/lib/python3.11/site-packages/seispy/core/depmodel.py", line 51, in _search_vel_file
model[:3, :] = raw_model[:, :]
~~~~^^^
ValueError: could not broadcast input array from shape (92,3) into shape (3,4)
Platform (please complete the following information):
Linux
seispy 1.3.5
Additional context
Appreciated developer's work, very good project!
Following errors were raised when executing pickrf ./CB.NJ2
in the examples :
时间 [RF] INFO: Reading PRFs from ./CB.NJ2
时间 [RF] INFO: A total of 86 PRFs loaded
Tracceback (most recent call list):
File "seispy库的路径\pickrf-script.py", line 33,in <module>
sys.exit(load_entry_point('python-seispy==1.2.14','console_scripts','pickrf')())
File "seispy库的路径\pickui.py", line 191,in main
ui = MatplotlibWidget(rfpath, only_r=only_r, xlim=[-2, xlim],order=arg.order)
File "seispy库的路径\pickui.py", line 46,in __init__
self.initUi(rfpath, only_r, xlim, order=order)
File "seispy库的路径\pickui.py", line 69,in initUi
self._set_geom_center()
File "seispy库的路径\pickui.py", line 129, in _set_geom_r
self.move((screen_width / 2) - (self.frameSize().width() / 2),
TypeError: arguments did not match any overloaded call:
move(self, QPoint): argument 1 has unexpected type 'float'
move(self, int, int): argument 1 has unexpected type 'float'
Plantform:Windows 10
Python version:Python 3.10.2
How to install seispy:pip install python-seispy
Hii,
Dear Dr. Xu,
Thanks for your seispy code, it's a great work.
I have a suggestion about rfani function. Before using the joint analysis method from(Liu and Niu, 2012 GJI), the moveout caused by the difference between the ray parameters of P and Ps should better be computed and corrected. For example, Liu and Niu employed a revised IASP91 velocity model with a modified crust to correct the moveout in(Liu and Niu, 2012 GJI). (Sun et al., 2012) used the H-k results to compute the moveout, (Cai et al., 2016) did the same.
But in the current seispy, rfani doesn't include the correction of moveout yet. Could you fix this problem at your convenience?
Thanks for a lot!
Zekun Li
Hi!!! I've tried the example of "moveout correction" shown in the video at 01:30:30. But, there was an error of plotting.
Code
rf_corr = rfsta.moveoutcorrect(dep_range=np.arange(0,200),ref_rayp=0.06)
correct_stack = np.mean(rf_corr,axis=0)
plt.plot(rfsta.time_axis,raw_stack)
plt.plot(rfsta.time_axis,correct_stack)
plt.xlim([-1,25])
Error
ValueError: x and y must have same first dimension, but have shapes (13001,) and (99, 13001)
Then, I checked the shape of "rf_corr"
AttributeError: 'tuple' object has no attribute 'shape'
However, the shape of "correct_stack" is (99, 13001)!!! Why??
Shouldn't "correct_stack" be like (13001,) and "rf_corr" is (99, 13001)?
ls the Time-to-depth conversion of SRF available now?
Describe the bug
A clear and concise description of what the bug is.
When BEZ rotate to QRT and QRF is selected, the terminal will prompt an exception 'No file matching file pattern: .//_ L.sac’. Then I found that in the rpickfigure.py script, the '*P_Q.sac' on lines 49 and 50 corresponds to the 'self.comp = 'L'' on line 51.
Expected behavior
A clear and concise description of what you expected to happen.
Replace "L" with "Q" in line 51.
Error raised
If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.