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

Stream.plot(type='section') does not respect method='full' #3375

Closed
1 task done
liamtoney opened this issue Nov 22, 2023 · 6 comments
Closed
1 task done

Stream.plot(type='section') does not respect method='full' #3375

liamtoney opened this issue Nov 22, 2023 · 6 comments
Labels
bug-unconfirmed reported bug that still needs to be confirmed

Comments

@liamtoney
Copy link
Contributor

Avoid duplicates

  • I searched existing issues

Bug Summary

When using the Stream plotting method with type='section', no matter the method used the data are resampled if they exceed 10,000 samples, see here in the __init__() method for WaveformPlotting:

if self.type == 'section':
# section may consists of hundreds of seismograms
self.max_npts = 10000
else:
self.max_npts = 400000

and in __sect_init_traces():
for _i, tr in enumerate(self.stream):
if len(tr.data) >= self.max_npts:
tmp_data = signal.resample(tr.data, self.max_npts)
else:
tmp_data = tr.data

It seems to me that the latter bit of code should be checking if method='full' and if so, setting tmp_data = tr.data — rather than resampling. Currently that kwarg is not checked. Therefore, as it stands, users have no way of fully plotting the data without resampling if they're using type='section'.

I'm happy to make a PR to address this.

Code to Reproduce

No response

Error Traceback

No response

ObsPy Version?

1.4.0

Operating System?

macOS (M1)

Python Version?

3.11.5

Installation Method?

conda

@liamtoney liamtoney added the bug-unconfirmed reported bug that still needs to be confirmed label Nov 22, 2023
@megies
Copy link
Member

megies commented Nov 23, 2023

I'm happy to make a PR to address this.

Sure, go ahead!

@liamtoney
Copy link
Contributor Author

Great. What branch should I base my feature branch off of? maintenance_1.4.x?

@megies
Copy link
Member

megies commented Nov 30, 2023

Great. What branch should I base my feature branch off of? maintenance_1.4.x?

Yes. Qualifies as a "bug", so that's where I would base it off of.

@liamtoney
Copy link
Contributor Author

Closing this seeing as #3379 was merged.

@megies
Copy link
Member

megies commented May 16, 2024

Closing this seeing as #3379 was merged.

github does close stuff automatically, but when the PR goes into maintenance branch it will only close the related issue after maintenance is merged into master, which will happen eventually but sometimes not immediately 👍

@liamtoney
Copy link
Contributor Author

when the PR goes into maintenance branch it will only close the related issue after maintenance is merged into master

Ah! Didn't know this. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed reported bug that still needs to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants