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 level parameter to inventory.write stationXML #1830
Conversation
Yea - would be very useful. This discussion here is also relevant: krischer/jane#33 |
Still requires a couple basic tests. |
obspy/io/stationxml/core.py
Outdated
@@ -825,8 +825,12 @@ def _write_stationxml(inventory, file_or_file_object, validate=False, | |||
|
|||
etree.SubElement(root, "Created").text = _format_time(inventory.created) | |||
|
|||
level = kwargs.get("level") or "response" |
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.
could also do kwargs.get("level", "response")
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.
Neat
Maybe this kwarg could also be added to |
Added a basic test. Is Jane actively undergoing development? |
It works and crucial bugs are fixed but currently there are no large efforts to add new features whatever these may be. We are definitely also open to pull and feature requests. |
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.
I only have a minor comment. Also please add a changelog entry. Otherwise this looks pretty good to me.
obspy/io/stationxml/core.py
Outdated
@@ -825,8 +825,12 @@ def _write_stationxml(inventory, file_or_file_object, validate=False, | |||
|
|||
etree.SubElement(root, "Created").text = _format_time(inventory.created) | |||
|
|||
level = kwargs.get("level", "response") |
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.
Please make this a proper argument to _write_stationxml()
.
Do we want a changelog for this PR? |
Added to change log. |
Looks pretty done to me. Can this be merged? Thanks a lot! |
Adds kwarg
level
for Inventory.write for StationXML.FDSNWS-Station
supports these four levels and I wanted to try to use ObsPy running behind FDSNWS Station writing at different levels. Maybe it's useful.