-
Notifications
You must be signed in to change notification settings - Fork 86
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
Problem with low sample rates #515
Comments
Thanks for raising this! This is an unusual use case, but hopefully the code can be useful for you. Do all your traces have the same (imprecise) sampling-rate? If not then you should make sure they are all set to the same value if you expect them to be. Then I would suggest that you set It would be good to expose an option to not resample (e.g. by setting |
Thanks for such a fast response! I dug in a bit more and realized that the problem is in my conversion to a SAC file, so I can use the SAC method in template_gen. I convert csv files to miniseed, then convert and write to SAC (with a pick time), and subsequently template_gen reads these back in. Somewhere in either the writing or reading of the SAC file, the sampling rate gets converted from delta=60.0 to 0.01666666753590107 (instead of 1/60 or 0.01666666666666666). I agree that forcing it to resample would not be ideal. What are your thoughts on either using np.isclose on line 570 of pre_processing.py (instead of a logical testing equality - the default could be atol=0 which is the same as identical values), or otherwise adding an option to read in mseed files to template_gen? If easier, I could make suggested code changes. Thank you! |
You can pass any Also, generally it is better to use the object oriented API ( Using |
Perfect, the from_meta_file method works! Thank you so much! |
I really need to get back to finishing the local file tutorial in based on #468! If there is anything else you would like to see in a tutorial then let me know. I'm going to close this, but feel free to reply. |
I'm using eqcorrscan for a slightly obscure application, on 1 minute sampled turbidity data on an oceanographic cabled array.
When generating templates of turbidity current events, I notice that the shortproc and processing functions are forcing a resample on line 570 of pre_processing.py (
EQcorrscan/eqcorrscan/utils/pre_processing.py
Line 570 in 72e769d
It appears to be because the sampling rate of the data ("tr.stats.sampling_rate") is very low (1/60 Hz), the precision of this float is such that tr.stats.sampling_rate turns out to be 0.01666666753590107, while it should be 0.016666666666666666 (which is what I'm specifying 1/60 as the sampling rate "samp_rate" in the template_gen function).
Is it possible to modify this to handle low sample rates?
I'm working on Python 3.9.12.
The text was updated successfully, but these errors were encountered: