WIP: Support more metadata for templates and each template trace#506
WIP: Support more metadata for templates and each template trace#506flixha wants to merge 11 commits intoeqcorrscan:developfrom
Conversation
|
tests fail due to Scipy 1.9.0; I was hoping that |
|
@cjhopp might have opinions on what he would like included in template metadata as well. |
|
Well, I have to admit that I didn't consider Tribe._par_write as much; and indeed from what I can think of now it should work just as well, especially if we write it to a json. I guess I was focusing more on where to keep the trace-stats - and came to the conclusion that they have to be added to the traces themselves because the two other options I saw, [1: referencing by resource ID (not thread safe), 2: referencing by waveform ID or ID + pick (not unique / cumbersome)] seemed less optimal. Even though it works ok now in the QuakeML file, one thing I don't like perfectly there is that the list of parameters for each trace is read in as a string, and then needs to be evaluated to a list again: EQcorrscan/eqcorrscan/core/match_filter/tribe.py Lines 444 to 446 in ee8a94c So any opinions on the choice:
|
|
I'm fairly keen to write to a json, because I think it will allow us more expansion later, without having to do strange string mangling out of extras. Internally though, I think you are right to have the metadata associated with the trace itself, that definitely makes sense. It may make sense to have a phase-hint associated with each trace at some point as well when we end up having multiple traces from a single channel? |
|
Thanks for the feedback; i'll move the trace-metadata to a json together with the previously existing template metadata. Will need to wait until late next week when I'm back from the field though |
|
Just a note that this PR is not forgotten; I just haven't gotten around to writing it such that the metadata are written to a json file.
|
|
Hey @flixha - I'm keen to pick this back up because I have a need to get weights going for a project. Do you have any more you want to do to this, or would you like me to pick this up and run with it? |
What does this PR do?
Implement first ideas / attempts for adding more metadata to templates, including trace-specific metadata.
Main points:
AttribDictin event.extra.weight,peak_snr,rms_snr,starttime,endtime,length_npts(i.e., the actual starttime / endtime / npts of each trace BEFORE writing, to allow checks when reading)Why was it initiated? Any relevant Issues?
We've been mentioning for a while that we'd like to save more metadata for each template, and also each trace in the templates. We didn't yet have a way of handling trace-specific metadata that do not fit into miniseed-supported header fields.
Saving metadata for each trace should allow some more tasks:
matched_filterPossible downsides:
@calum-chamberlain , @d-chambers: What do you think about saving trace metadata like this? I went through a few other ideas, but they all seemed to have bigger downsides.
Example:
PR Checklist
developbase branch selected?CHANGES.md.CONTRIBUTORS.md.