paudetseis / RfPy

Teleseismic receiver function calculation and post-processing
https://paudetseis.github.io/RfPy/
MIT License
39 stars 28 forks source link

How to interpret the fftshift of the final receiver function product #13

Closed jaredbryan881 closed 4 years ago

jaredbryan881 commented 4 years ago

The final receiver functions are fftshifted just before they're returned, but I can only reproduce the receiver function calculation demo if I remove the fftshift.

https://github.com/paudetseis/RfPy/blob/49131045b4a355ab62b8149f9304c14c1c2eb723/rfpy/rfdata.py#L757-L763

I am not sure this is a true issue, but I am just looking for clarification about:

  1. How should I interpret the time axis after the fftshift?
  2. Why should we apply the fftshift to the time-domain receiver function? Looking at the vertical component receiver function (rfp), we should expect a delta function (to 0th order). I think the delta function should be at elapsed time t=0, but it plots at the midpoint of the time axis due to the fftshift.

Thank you, and please let me know if I can clarify my questions!

paudetseis commented 4 years ago

Hi @jaredbryan881 - this is another problem related to the demo files that accompany the code. These were produced and packaged with RfPy before I made a few changes that render these demo files obsolete.

The fftshift is performed to bring the P-wave arrival (0 lag) to the center of the time axis, which will go from -nt * dt/2 through 0 to nt * dt/2 (minus one sample). This step allows looking at the negative lags on the (filtered) RFs, which can give some insight about the quality of the deconvolution/data.

I haven't had time to fix the demo files yet - I'll get to it as soon as I can.

jaredbryan881 commented 4 years ago

Hi @paudetseis, no rush fixing the demo files, and thank you very much for answering my questions. I am closing this issue since it is a duplicate of #12.