Hi Tom!
As I see it is more convenient to do the QC right before deconvolution.
For processing the RF, some of the lines of my code are:
Script 1 example
Since stream3c.rf() is doing the rotation and deconvolution, I don’t find a way to inset my signal-to-noise ratio in between.
I was trying to do:
Script 2 example
stream3c.rotate(method='ZNE->LQT')
#[posible signal-to-noise ratio function] here
stream3c.deconvolve(method='time')
stream3c.moveout()
I just ran this script (script 2 example) without the Signal to noise ratio function and the inserted arguments, but I am not getting same results as the script 1 example.
Do you have some ideas to perform the QC before deconvolution?
Many thanks in advance!
You can look up the source code of RFStream.rf()here. And yes, it is basically rotation and deconvolution, but also switching the polarity of the Q component.
I think for QC I used a signal-to-noise ratio of 2, but I guess a lot of different approaches are possible here.
I replaced the dots ... in your post with back ticks. Code blocks then are nicely formatted.
stream3c.rotate(method='ZNE->LQT')
for tr in stream3c: #sign change
if tr.stats.channel.endswith('Q'):
tr.data = -tr.data
stream3c.snr_compute() #signal to noise ratio function
if stream3c[1].stats.SNR>6:
stream3c.deconvolve(method='time', source_components='LZ')
stream3c.moveout()
stream.extend(stream3c)
Do you think that I am missing an important argument? Specially for the deconvolution. I just added method and source_components=‘LZ’.
There is one line that I skipped kwargs.setdefault(‘winsrc’, method).
Do you think it is important?
Looks perfect. winsrc is not important in your case. It defines the time window for cutting the data of the source component and defaults to 'P', resp. (-10, 30, 5) for time deconvolution (starttime, endtime in seconds relative to onset, taper at both ends in seconds). winsrc should be changed for Srfs.