stream rotation

Dear all,

I'm trying to rotate stream (containing 3 traces -Z,N,E) to the ZNE system.

Code:

from obspy import read_inventory
from obspy import read
from obspy.signal.rotate import rotate2zne

_mseed="NETWORK.STATION.LOCATION*"
_xml="NETWORK.STATION.xml"

st = read(_mseed)
inv = read_inventory(_xml)
st.attach_response(inv)

data=[]
azm=[]
dip=[]
orientations=['Z','N','E']

for orientation in orientations:
     data.append(st.select(channel='*'+orientation).traces[0].data)
     dip.append(inv.select(channel='*'+orientation)[0][0][0].dip)
     azm.append(inv.select(channel='*'+orientation)[0][0][0].azimuth)

_results = rotate2zne(data[0], azm[0], dip[0], data[1], azm[1], dip[1], data[2], azm[2], dip[2])

But I get the following error:

Traceback (most recent call last):
   File "new_rotate.py", line 27, in <module>
     _results = rotate2zne(data[0], azm[0], dip[0], data[1], azm[1], dip[1], data[2], azm[2], dip[2])
   File "/usr/local/lib/python2.7/dist-packages/obspy/signal/rotate.py", line 257, in rotate2zne
     x, y, z = np.dot(_t, [data_1, data_2, data_3])
ValueError: setting an array element with a sequence.

Any ideas?

Thank you in advance,
Nikos

Hi Nikos,

hard to tell what's happening, I'd recommend jumping in there with
IPython debugger and checking types (could be e.g. empty data slices, ...).
You can also have a look at https://github.com/obspy/obspy/pull/1310.

cheers,
T