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
Added check for response function #1829
base: master
Are you sure you want to change the base?
Conversation
obspy/io/ah/core.py
Outdated
packer.pack_float(0) | ||
packer.pack_float(0) | ||
if hasattr(tr.stats, 'response'): | ||
poles, zeros = tr.stats.response.get_paz() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general we nowadays don't encourage "magic uses" of additional items in Trace.stats
anymore.. but if it's important for you we might still accept this change I guess..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be a better way to check if there is a response attached?
I'd personally either like to see this as |
I use the information provided for instance by the |
Yea- this is one of the instances in our code base where it does already happen. I'd be fine with a construct like this which offers a cleaner interface but also falls back to using the existing def _write_ah(..., response=None, ...):
...
# First use passed response, otherwise look in trace.stats.
if response is None and "response" in tr.stats:
response = tr.stats.response
if response:
... |
What does this PR do?
Adds write support for AH (Ad Hoc) format to stream.write(), It is an addition to PR #1757
Why was it initiated? Any relevant Issues?
related to issue #1754
PR Checklist
CHANGELOG.txt
.CONTRIBUTORS.txt
.