Skip to content

New header **kwargs patch for plot_data_greens3#333

Closed
thurinj wants to merge 9 commits intomasterfrom
waveform_plot_update
Closed

New header **kwargs patch for plot_data_greens3#333
thurinj wants to merge 9 commits intomasterfrom
waveform_plot_update

Conversation

@thurinj
Copy link
Member

@thurinj thurinj commented Oct 23, 2025

This should solve issue #332 - fairly minimal fix.

I am not a huge fan of the resulting header when using 3 different filtering parameters:
image
(the time window duration is clipped out of the figure).

I can merge the PR as is in the next day or two if you want (so @ammcpherson can move forward with her work), or take a bit more time to rework the overall text arrangement so everything fits tightly in frame of the figure. (We can probably have the layout a bit smarter depending on what we have to insert in the figure's header.)
Let me know what's the best for you.

tag: @rmodrak, @ammcpherson

This should solve issue #332.
@ammcpherson
Copy link
Member

I am fine waiting a bit for you to tighten things up. My workaround currently works fine for this particular project

…r in waveform figures.

This triggers per-line (only the line that would overflow is rescaled). I tested it on the mtuq examples and it looks okay to me.

Also tested with plot_data_greens3 and everything looks fine as well. I turned it on by default, but we could change that if needed.
@thurinj
Copy link
Member Author

thurinj commented Oct 27, 2025

Hi @ammcpherson,

Could you please test this one out, I think it should do the trick! (It should shrink down the overflowing line).
Thanks for waiting for the update!

@thurinj
Copy link
Member Author

thurinj commented Oct 27, 2025

Not sure why the build isn't working with this one, I have not added any dependencies.
Might be 'okay' since this branch misfit function is still dated from before all @rmodrak recent changes (numba based misfit evaluation)

@ammcpherson
Copy link
Member

@thurinj So this branch would not have the new misfit function? That is more vital to this particular project of mine than the header/waveform plotting issue

@thurinj
Copy link
Member Author

thurinj commented Nov 1, 2025

Hi @ammcpherson, the branch doesn't have it, but the PR only brings the changes in the header.py file (see the list of modified files in the PR GitHub recap).

@thurinj thurinj force-pushed the waveform_plot_update branch from 0244c8c to c8cc4a7 Compare December 9, 2025 02:42
Changed default behavior for collect_synthetics (but also collect_attributes, even if not really used much in the code -- for consistency).

I also noticed that if the normalized misfit per trace was not stored as attributes in the level0, then it would divide the raw misfit by the total (normalized) misfit. So in the 2009 eq event, this translates to doing ~1e-9 / ~1e0

'hybrid' had not been properly implemented, so I did a light rework of the calculate_norm_data function.
@thurinj
Copy link
Member Author

thurinj commented Dec 9, 2025

Since it was loosely related with the waveform plot, I also made changes to address issue #335.
It seems to be working on the test I have done on my end, but if you can have a look @ammcpherson that would be awsome. In any case I am planning of merging before the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants