xumi1993 / seispy

Python module of seismology and receiver functions

Home Page:https://seispy.xumijian.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to write numpy.ndarray to a sacfile without missing required header info

datseismo opened this issue · comments

Hii, seispy developer, I am running your example script https://seispy.xumijian.me/usage/calrf.html for gaining some knowledge regarding receiver functions.I have a very small querry, can the numpy.ndarray can be saved to the sac file after this step
PRF_R, RMS, it = seispy.decon.deconit(R, Z, dt, R.shape[0], shift, f0, tmax, minderr)
I want to write PRF_R to be saved in sac file by something PRF_R.write('outfile',format='SAC'), When i does it gives error AttributeError: 'numpy.ndarray' object has no attribute 'write'

I hope developers may help me overcoming my problem.Thanks in advance.

Good idea, I'm considering add this function in next stable version.

In current version, this feature has been added to seispy.decon.RFTrace, inheriting from obspy.core.Trace. Please see usage in detail.