mtuq icon indicating copy to clipboard operation
mtuq copied to clipboard

amplitude scaling for waveform plots

Open carltape opened this issue 1 year ago • 1 comments

The default behavior to normalize waveforms using maximum_amplitude is good, since it preserves the relative amplitudes among waveforms, which is helpful for examining radiation patterns (e.g., some waveforms will be nodal for P and Rayleigh waves). However, if there are outliers with spurious huge amplitudes, then the "good" waveforms will be too tiny to see. (Using trace_amplitude or station_amplitude does not preserve the relative amplitudes.) Relevant code lines: https://github.com/uafgeotools/mtuq/blob/master/mtuq%2Fgraphics%2Fwaveforms.py#L388-L401 Could we find an overall scaling that will exclude outliers? How about take the abs(max) for each station's set of windows (one value based on 2 P windows; one value based on 3 surf windows), then take the median of all of those (one for P, one for surf)? That would help with debugging, since the good waveforms would alway be properly scaled, and the bad waveforms would be huge. Thanks.

carltape avatar Feb 06 '24 03:02 carltape

It sounds like the above approach is self-contained in the sense that the normalization factor for a given station is obtained using only the numeric trace data for that station? That would seem to make it somewhat simple to implement...

Maybe proceed by adding a new option normalize=='experimental' to the if-then block?

This may be something a UAF student/postdoc could implement, so that they could iterate with you to get the behavior exactly as desired?

rmodrak avatar Feb 06 '24 22:02 rmodrak

I believe the requested normalization has been fully implemented by jthurin

rmodrak avatar Mar 07 '25 18:03 rmodrak