# Reading Earth Worm PZ files as inventory

**URL:** https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [October 28, 2016, 11:52am UTC](https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573 "2016-10-28T11:52:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yaman\_ozakin](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/y/7ab992/32.png) [@yaman\_ozakin](https://discourse.obspy.org/u/yaman_ozakin)
#### Post date: [October 28, 2016, 11:52am UTC](https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573/1 "2016-10-28T11:52:08Z")

</div>

Dear all,  
Is there a way to read PZ files (sample attached) into obspy as an inventory object?

[ALTN\_BHE\_KOU\_19900101\_OnSite\_HZ.PZ](https://discourse.obspy.org/uploads/short-url/s9VknK0iHvrZ6SbAwlIWeUYUEnW.PZ) (1.08 KB)

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [October 28, 2016, 2:00pm UTC](https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573/2 "2016-10-28T14:00:18Z")

</div>

Hi,

ObsPy can do the opposite, see here:

> <https://github.com/obspy/obspy/pull/879>
>
> I was asked about this in person..
> 
> Includes a test against one station served b…y IRIS SACPZ WS.

It should be straight forward to implement the other way around, esp.  
with the "StationXML from scratch" tutorial, Lion added:

> <https://github.com/obspy/obspy/pull/1574>
>
> In effort to answer questions with a pull request as an answer: a tutorial on ho…w to create a stationxml file from scratch with ObsPy. +DOCS

> **[Creating a StationXML file from Scratch — ObsPy...](https://docs.obspy.org/master/tutorial/code_snippets/stationxml_file_from_scratch.html)**

If you come up with code to do this, please open a pull request on github.

cheers,  
T

---

<div class="post-metadata">

### Author: ![yaman\_ozakin](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/y/7ab992/32.png) [@yaman\_ozakin](https://discourse.obspy.org/u/yaman_ozakin)
#### Post date: [October 28, 2016, 2:05pm UTC](https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573/3 "2016-10-28T14:05:53Z")

</div>

That is great but it would be great if it also included the creation of the response stages.

---

<div class="post-metadata">

### Author: ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)
#### Post date: [October 31, 2016, 6:31pm UTC](https://discourse.obspy.org/t/reading-earth-worm-pz-files-as-inventory/573/4 "2016-10-31T18:31:37Z")

</div>

This will come in the nearish future. It is not that useful to do that  
without support for the NRL. Once ObsPy can deal with this we will write  
a tutorial for how to create full StationXML files including the response.

Cheers!

Lion
