mtuq icon indicating copy to clipboard operation
mtuq copied to clipboard

Feature Request: Waveform plots ordered by order in weights.dat

Open ammcpherson opened this issue 11 months ago • 4 comments

Hello,

Currently the waveform plots seem to have a default ordering option of 'by_azimuth', and users can of course choose to sort 'by_distance' or 'by_azimuth.' In the old CAP code, if you did not choose an ordering option, it would order the waveforms by the order in the weights.dat file. This offers immense customization about what waveforms to showcase, particularly in the case where the user has a large number of stations (>10) and needs to crop the wavefield plot for publication purposes.

Thanks, Amanda

ammcpherson avatar Feb 17 '25 00:02 ammcpherson

Perhaps try your hand at this using the following? Dataset.sort_by_function(function, reverse=False)

rmodrak avatar Feb 17 '25 00:02 rmodrak

One possible complicating factor is that weights are defined per trace, whereas sorting would occur per station (because datasets are organized per station).

rmodrak avatar Feb 17 '25 00:02 rmodrak

We are faced with needing this feature for the second manuscript in a row. I think it will be useful to have this flexibility, since publication figures will often require a bit of customization, since we rarely want to display the entire set of waveforms.

(Also, on a related note, we generally do not want stations sorted by azimuth, but actually the lower-hemisphere piercing points sorted by azimuth. When you have both upward- and downward-pointing ray paths, this distinction will matter. This could be a separate issue.)

carltape avatar Jun 27 '25 21:06 carltape

perhaps try this as a starting point?

new_dataset = [old_dataset[idx] for idx in new_order]

On Fri, Jun 27, 2025 at 3:11 PM Carl Tape @.***> wrote:

carltape left a comment (mtuqorg/mtuq#299) https://github.com/mtuqorg/mtuq/issues/299#issuecomment-3014362272

We are faced with needing this feature for the second manuscript in a row. I think it will be useful to have this flexibility, since publication figures will often require a bit of customization, since we rarely want to display the entire set of waveforms.

(Also, on a related note, we generally do not want stations sorted by azimuth, but actually the lower-hemisphere piercing points sorted by azimuth. When you have both upward- and downward-pointing ray paths, this distinction will matter. This could be a separate issue.)

— Reply to this email directly, view it on GitHub https://github.com/mtuqorg/mtuq/issues/299#issuecomment-3014362272, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCGSSQQ2OE6NNCC6C2AGUL3FWXPZAVCNFSM6AAAAABXIEGD76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMJUGM3DEMRXGI . You are receiving this because you commented.Message ID: @.***>

rmodrak avatar Jun 27 '25 21:06 rmodrak