-
Notifications
You must be signed in to change notification settings - Fork 13
Noise windows are shifted #21
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
Comments
Hi Claudio, I made this change to make sure that the start of the noise window is not before the start of the trace. Without that constraint, the obspy trim operation (in the _cut_signal_noise function) just fills the missing part with zeros. So, the noise window was never considered too short, even if it was absent. I'm not sure why the noise window is shifted in your case, but it is possible that a trace that was not rejected before is now rejected. The filling in of the missing part with zeros (old behavior) would result in a higher SNR (which is not real). Could you check if the amount of time before the P arrival with respect to your noise_pre_time for the rejected record? |
Ok, I think I should change the way traces are plotted (or are trimmed?) to avoid this impression of having signal, when it is not there. Ideally, your plot for, e.g., BE.CLHA should not show any signal before a few seconds before S arrival. |
I'll prepare a pull request and I will ask you to test it, if you don't mind. |
OK, could you also check if the noise windows are drawn for each trace separately or if it the same box is used for each trace? |
You mean each of the three components, for a given station? |
Yes. |
Probably it is the same box. I'll try and fix that. |
Looks like the fix is quite easy: could you please comment out line 380 in _trim_traces(config, st_sel) And see what happens in your case? |
Ok, can you try changing line 311: trace.trim(starttime=t1, endtime=t2, pad=True, fill_value=0) with trace.trim(starttime=t1, endtime=t2) Of course, remove the comment from line 380 😉 |
The idea in |
Great! Looking at the code, noise windows should be plotted separately for each component. Do you have an example where they're not there same, to check that? |
Not straightaway. I trimmed all records in my archive to the same start time. |
The only problem I see is that noise and signal windows are plotted as vertical spans, so they always cover the full plot in vertical. This can be improved by plotting rectangular patches of 1/3rd of the plot height... looking into that. |
I was going to say that it also depends on the selected wave_type (e.g. for P-wave only Z component is used), but I think in ssp_process_traces all components are processed separately. So, the noise windows could still be different. |
That looks fine! |
- Do not zero-pad traces to common length when plotting, so that missing data at beginning or at the end can be easily detected - Plot noise and signal windows separately for each component Fixes #21
Sorry, I had to force-push 92ddf7a |
I switched back to master and it works! |
Hi @krisvanneste,
the changes introduced with #18 are causing a small but significant problem in my case: the noise window is shifted and a trace is rejected.
This is due to this line:
which used to be:
Attached two figures showing the old and the new behaviour.
Could you explain why this change is important for you use case? Any idea for a workaround?
The text was updated successfully, but these errors were encountered: