-
Notifications
You must be signed in to change notification settings - Fork 87
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
Change template_gen naming of output. #345
Comments
I'm finding it hard to remember where this comes from: can you point to the code lines that cause this, and what lines you propose to change? |
I'd like to change all these "st1[0].stats.starttime" and etc to origin time of event. in template_gen(): in _template_gen(): And other related changes that is necessary for this implementation. |
I don't think this can work in the way EQcorrscan currently defines templates: events are not strictly required for templates, and event then, events do not have to have an origin time. |
I can't understand your means.
It's easy, I define if event has origin time then use it and if not, use trace's start time same as now. |
A template made using the I would rather keep it consistent so that all template plots are named in the same way. |
What do you think about something like this?
And we can use some prefix to show which one saved with trace's time like: |
If you do want to go down this route then you will need to get the origin time something like this: try:
origin = event.preferred_origin() or event.origins[0]
except IndexError:
origin = None
if origin and origin.time is not None:
name = str(origin.time)
else:
name = str(st[0].stats.starttime) but IMHO this is quite a bit of code for something that isn't that necessary. |
I'm still not sure about this - I think it would be nice if the plots had the same name as the template, but templates are named (by default) by the earliest time in the template stream. I'm loath to change that default naming convention, which means I'm against changing how the plots are named - however they probably should be named by the earliest trace time, rather than just the first. |
Yes, they should be named by earliest trace time, rather than first. In my use of template_gen, I sort the traces by starttime and use the first (earliest) trace for the name. |
Is your feature request related to a problem? Please describe.
All output's of template_gen are named by the trace's time. It makes it hard to find which template and plots (noise_plot&pretty_template_plot) are related to which event.
Describe the solution you'd like
I'd like to replace the event's origin-time with the trace's time in template_gen naming and make related changes.
The text was updated successfully, but these errors were encountered: