# SAC / SeismicUnix questions

**URL:** <https://discourse.obspy.org/t/sac-seismicunix-questions/721>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [November 21, 2017, 11:19pm UTC](https://discourse.obspy.org/t/sac-seismicunix-questions/721 "2017-11-21T23:19:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![R\_Modrak](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@R\_Modrak](https://discourse.obspy.org/u/R_Modrak)\
**Post date:** [November 21, 2017, 11:19pm UTC](https://discourse.obspy.org/t/sac-seismicunix-questions/721/1 "2017-11-21T23:19:23Z")

</div>

Any suggestions regarding the following would be greatly appreciated. Thanks, Ryan

1. Does anyone know of any existing tools, in obspy or elsewhere, for creating Origin/QuakeML/Station/StationXML objects by parsing SAC or SeismicUnix metadata?

2. I’d like to read multiple SAC files into an obspy stream, perform data processing, and write out the processed traces again as SAC files. Any suggestions on how to keep track of the original SAC filenames? I could simply add a ‘sac\_filename’ attribute for each trace, but is there a better/more standardized way?

---

<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:** [November 22, 2017, 10:55am UTC](https://discourse.obspy.org/t/sac-seismicunix-questions/721/2 "2017-11-22T10:55:19Z")

</div>

Hi Ryan,

> 1. Does anyone know of any existing tools, in obspy or elsewhere, for creating Origin/QuakeML/Station/StationXML objects by parsing SAC or SeismicUnix metadata?

There is no straight-forward mapping between SAC/SU and Station/QuakeML. Here are two tutorials describing how to generate these two XML formats from scratch in ObsPy which should get you started:

- 
  - Currently not. So just adding it to each trace’s stats dictionary seems to be the way to go. Cheers! Lion

---

<div class="post-metadata">

**Author:** ![R\_Modrak](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@R\_Modrak](https://discourse.obspy.org/u/R_Modrak)\
**Post date:** [November 22, 2017, 12:26pm UTC](https://discourse.obspy.org/t/sac-seismicunix-questions/721/3 "2017-11-22T12:26:36Z")

</div>

There is no straight-forward mapping between SAC/SU and Station/QuakeML.  
Here are two tutorials describing how to generate these two XML formats  
from scratch in ObsPy which should get you started:

> \* [http://docs.obspy.org/tutorial/code\_snippets/](http://docs.obspy.org/tutorial/code_snippets/)  
> stationxml\_file\_from\_scratch.html  
> \* [https://github.com/krischer/seismo\_live/blob/master/](https://github.com/krischer/seismo_live/blob/master/)  
> notebooks/ObsPy/05\_Event\_metadata-with\_solutions.ipynb

Good to know. In that case I may implement some type of mapping myself--my  
use case requires me to pick one and go with it. Thanks for the help!
