Hi,
I need to work on instrument corrected traces with a program that reads
only mseed files with encoding STEIM1 or 2.
the function of Obspy for instrument correction returns float64 numbers.
When I try to save the data, I´ve downloaded , in MSEED with encoding =10
or 11
I get an error message.
Any solution to that?
thanks
Luigia
Below are the commands I use to download and save the data and the error
message:
........................
import numpy as np
import matplotlib.pyplot as plt
from obspy.core import read, UTCDateTime, Stream, Trace
from obspy.arclink import Client
from obspy.signal import cornFreq2Paz, seisSim
# Retrieve waveforms via ArcLink
client = Client(host="webdc.eu", port=18001)
t = UTCDateTime("2009-08-24 00:20:03")
st = client.getWaveform('BW', 'RJOB', '', 'EHZ', t, t+30)
paz = client.getPAZ('BW', 'RJOB', '', 'EHZ', t, t+30)
paz = paz.values()[0]
# Correct for frequency response of the instrument
res = seisSim(st[0].data, st[0].stats.sampling_rate, paz, inst_sim=None) #
Correct for overall sensitivity
res=(res / paz['sensitivity'])
#save corrected in MSEED 5 encoding float 32 , 10 encoding STEIM1
stcorr = Stream([Trace(data=res, header=st[0].stats)])
stcorr.write("prova.mseed", format='MSEED', encoding=10)
Exception:
Wrong dtype for Stream[0].data for encoding STEIM1.
Please change the dtype of your data or use an
appropriate
encoding. See the obspy.mseed documentation for more
information.