Skip to content
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

Add an option for AddGap and ChannelDropout to modify label directly #229

Merged
merged 4 commits into from Aug 18, 2023

Conversation

zhong-yy
Copy link
Contributor

@zhong-yy zhong-yy commented Aug 14, 2023

In pull request #222, only the metadata is changed if there is any pick in a gap.

It may be helpful to add an option to change labels directly. For example. when one waveform is staked on another (e.g. benchmark/augmentations.py) to generate a new trace, the metadata is kept unchanged and only the label is changed. In this case, adding the gap to the labels directly is a better choice.

  • I added two label_keys label_keys and noise_id to AddGap and ChannelDropout
  • Two new tests: test_channel_dropout_with_picks_in_gap and test_add_gap_to_waveform_and_labels

I forgot to pull your commit at the beginning, so I manually resolved the conflicts. I hope it didn't break the commits b253784 and 319d944

Add an option for AddGap and ChannelDropout to modify labels directly.
For AddGap, the gap can be added to both the waveform and the labels.
For ChannelDropout, if all channels are zeros, labels will also be
zeroed out. If there is a noise label, the noise label within the gap
is 1.
Add two tests 'test_channel_dropout_modify_labels_directly' and
'test_add_gap_to_waveform_and_labels' to test the option of modifying
labels directly for AddGap and ChannelDropout
@yetinam yetinam added the enhancement New feature or request label Aug 14, 2023
@yetinam yetinam added this to the v0.5 milestone Aug 14, 2023
@yetinam
Copy link
Member

yetinam commented Aug 14, 2023

Thanks for the contribution. I'll have a look at it but may not be able to do so before next week.

@yetinam yetinam self-requested a review August 14, 2023 19:59
Copy link
Member

@yetinam yetinam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good 👍

@yetinam yetinam merged commit 56eb041 into seisbench:main Aug 18, 2023
13 checks passed
@yetinam
Copy link
Member

yetinam commented Aug 18, 2023

Thanks for the contribution! That was a very pleasant PR to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants