save waveform with instrument correction

Dear Obspy forum

Wishing you all the best for the holydays…I have some questions and doubts

When I apply the instrument correction following the obspy example I got a nice waveform, I would like to save the waveform on a new mseed file, so the question:

st.simulate(paz_remove=paz,paz_simulate=paz_1hz)

The new corrected waveform is under st.simulate?.

or the new waveform is under tr.data , as the example used tr.data to plot

tr = st[0]
tr_orig = st_orig[0]
t = np.arange(tr.stats.npts) / tr.stats.sampling_rate
plt.subplot(211)
plt.plot(t, tr_orig.data, ‘k’)
plt.ylabel(‘Amplitud [counts]’)
plt.subplot(212)
plt.plot(t, tr.data, ‘k’)

When I do the following comand

tr1=tr.data

tr1.write(r’D:\Seismic_Inves\SARA\OSC DATA_2014-04-01-mww69-near-coast-of-northern-chile\20140401_BHN.mseed’,format=‘MSEED’)

I get the following error:

Traceback (most recent call last):
File “<pyshell#21>”, line 1, in
tr1.plot()
AttributeError: ‘numpy.float64’ object has no attribute ‘plot’

Where the new waveform corrected is stored?, thank yor for your time and patient.

Best regards.

Gonzalo

Dear Gonzalo,

When I do the following comand tr1=tr.data

here you copy the numpy array into tr1 which does not have the method
plot() - instead you want to do

tr1 = tr.copy()

and tr1.plot() and tr1.write(...) should work as expected

Cheers,
Robert

- --
Dr. Robert Barsch

EGU Office Munich
Luisenstr. 37
80333 Munich
Germany

Phone: +49-89-21806565
Fax: +49-89-218017855
eMail: barsch@egu.eu