Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future #27

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open

Future #27

wants to merge 59 commits into from

Conversation

paudetseis
Copy link
Owner

In the last few large commits, the code base was modified in the following ways:

  • The method deconvolve was split up into calc_spectra, which stores the cross-spectra (numerator and denominator) as new attributes of the RFData object, and a new method called deconvolve, which uses the pre-calculated spectra in the spectral ratio. The traces can be normalized by the pre-event noise amplitude [(trace.data - meanNoise)/stdNoise for trace in rfdata.data]. This is useful for the stacking of events with different magnitudes.
  • The function binning.baz_slow_bin was edited to take in either real or complex data, in order to use the (possibly complex) spectra during binning.
  • I added a new plotting.panel function to plot binned RFs as a panel sorted by back-azimuth and slowness values. It is used in both rfpy_calc_simdec and rfpy_plot below.

I made changes to the scripts in the following ways:

  • The script rfpy_calc was split up into rfpy_get_data and rfpy_calc, where the data download is done first with minimal pre-processing. The code rfpy_calc is now similar to what rfpy_recalc used to be, and that script became obsolete and was removed.
  • I created a script rfpy_calc_simdec that loads all ZNE data and performs simultaneous deconvolution. This script stores all (auto- and cross-) spectra into a stream and then bins them according to BAZ and slowness. The RFs are then calculated by performing the spectral ratio using the summed quantities. At this time it does not save or write to file any of the final RFs.
  • The script rfpy_plot now allows plotting as a panel of RF bins (obtained from rfpy_calc). The "panel" option is called whenever the user specifies both --nbaz and --nslow as arguments.

After going through all this trouble, it appears that the simultaneous deconvolution does not produce any noticeable improvement, at least visually.

To test both versions, go through these steps:

# Single-event version
rfpy_get_data --start=2018-01-01 --end=2020-01-01 PGC.pkl
rfpy_calc --resample=10. PGC.pkl
rfpy_plot --bp=0.1,0.5 --nbaz=72 --nslow=40 --trange=0.,30. --snr=5. --title="Single-event deconvolution" PGC.pkl

# simultaneous deconvolution
rfpy_calc_simdec --bp=0.1,0.5 --nbaz=72 --nslow=40 --trange=0.,30. --snr=5. --resample=10. --title="Simultaneous Deconvolution" PGC.pkl

PGC_simdec
PGC_single_event
.

A few things to note:

  • Documentation is NOT up to date.
  • The new script has not been thoroughly tested, and debugging is on-going.
  • In the simultaneous deconvolution, the spectral ratio is regularized using the summed noise spectra, therefore the method is akin to the Wiener approach.
  • Finally, it shouldn't be surprising that the two methods return the same results, since the iFFT of the summed spectra is the same as the sum of iFFT'ed spectra. The only difference here is the amplitude normalization by the pre-event noise, but this does not appear to make any difference.

Do not merge yet - we need to create an "old" branch that we could revert to just in case

Wasja Bloch and others added 30 commits July 22, 2021 13:41
This reverts commit b54c6d5.
Remove logging module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants