Comments (5)
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 samp_rate
to that value. I don't think that the precision of samp_rate
is changed anywhere (I hope it isn't), so that should compare as equal. Perhaps you have tried that though and this issue still happens?
It would be good to expose an option to not resample (e.g. by setting samp_rate=None
to disable resampling), but in the matched-filter steps the sample-rate of the continuous data are compared to the sample rate of the template to ensure that they are the same and if they are not it will resample. If this is a floating point accuracy bug that gives different results for different epochs then that will be an issue. Keen to know what you have found in your experience and happy to try and help.
from eqcorrscan.
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!
from eqcorrscan.
You can pass any Stream
to most of the template creation functions/methods, but we don't support passing filenames - you have to read the file using obspy first, so you can pass miniseed to those (so long as you read the file first). You would use the from_meta_file
method and pass a stream. In general I would avoid the SAC methods!
Also, generally it is better to use the object oriented API (Template
and Tribe
objects). The functions in template_gen
are only there for legacy purposes. Similar to template_gen
you should use the from_meta_file
method.
Using np.isclose
is a nice idea, we could do that, but I'm loath to introduce something that could be used to hide other issues (e.g. file conversion issues).
from eqcorrscan.
Perfect, the from_meta_file method works! Thank you so much!
from eqcorrscan.
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.
from eqcorrscan.
Related Issues (20)
- Correlation time series HOT 1
- Template write / read merges traces in rare case where traces from same channel align exactly HOT 2
- Cannot find compiled libtuils on Windows HOT 1
- original template pick time and time after lag_calc is not same HOT 6
- Release 0.4.4 HOT 5
- [PACKAGING BUG] Template Creation - ValueError: Unknown window type (hanning) HOT 2
- Plotting return_figure docs do not match default
- Party.lag_calc unclear what happens if stream does not cover all detections
- WIP: Speed up a few slowdowns when handling large datasets HOT 11
- [HELP] Can't install EQcorrscan on Apple M1 from conda-forge HOT 3
- pre-processing GPU support
- pytest fixtures in correlate_test alter omp threads
- Int overflow error in decluster unreported HOT 1
- Suppressed self-detection correlations if resampled samples do not align
- [HELP] - I can't install in minicoda packages are not available HOT 5
- Version 0.5.0
- [HELP] - Installation of EQcorrscan HOT 3
- [HELP] - create template through FDSN client HOT 3
- [HELP] write_correlations has a too many values to unpack error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eqcorrscan.