-
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
Use SparseEvent for Detection.event #286
Comments
I would be interested in seeing how you have implemented the sparse classes, are they somewhere publicly viewable? |
They are really basic, I don't have any useful functionality in them, just names. Its super naive and just works as a place-holder that maps across to What I have been using is here, which suits that purpose (which is just storing some parameters I need for a nationwide repeating earthquake search). It would need more work for EQcorrscan, and in particular to cope more cleanly when methods or parameters that aren't there are asked for. |
Ok, make sense. Sometimes all you need is the quack, until you realize you are really after a (wild) goose 😉. I have been thinking for some time about implementing a lazy catalog that would be backed by a SQL database (SQLite by default). If something like that had an option to periodically push newly added picks to disk (keeping them out of memory) would it meet this need? It is something I hope to include in ObsPy eventually but it may take awhile to get right. I would be keen to get your feedback early on to make sure it could be useful to EQcorrscan-like use cases. |
A lazy catalog could be really good, yes. I would be keen to help out on that, but (I must confess), partially because I have been looking for a good reason to learn more about the world of SQL. |
Is your feature request related to a problem? Please describe.
Obspy
Event
s are great, but, storing millions of them in memory is expensive. Currentlymatch-filter
called fromTribe.detect
will generate anEvent
for each detection. The information in those events is very sparse (anOrigin
,ResourceID
and somePick
s). We do not need all the additional slots or functionality.Describe the solution you'd like
A set of simple
SparseEvent
,SparseOrigin
andSparsePick
classes, with theSparseEvent
object having ato_obspy
method to convert to a full obspyEvent
. This would allow simple transitions between a more memory efficient implementation and all the extra stuff (including io) that comes with obspy events.Describe alternatives you've considered
At the moment I set
return_events=False
for largeTribe.detect
runs. This works fine, but it is kind of annoying, and not all that obvious that generating the events is (one of the things) that takes up heaps of memory.Additional context
I have written some sparse classes for other work that seem to work quite well and could be dropped into EQcorrscan quite easily.
The text was updated successfully, but these errors were encountered: