# obspy.signal.rotate.rotate\_NE\_RT  ???

**URL:** https://discourse.obspy.org/t/obspy-signal-rotate-rotate-ne-rt/138
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [September 26, 2012, 1:49pm UTC](https://discourse.obspy.org/t/obspy-signal-rotate-rotate-ne-rt/138 "2012-09-26T13:49:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ahu\_Komec\_Mutlu](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/a/b9bd4f/32.png) [@Ahu\_Komec\_Mutlu](https://discourse.obspy.org/u/Ahu_Komec_Mutlu)
#### Post date: [September 26, 2012, 1:49pm UTC](https://discourse.obspy.org/t/obspy-signal-rotate-rotate-ne-rt/138/1 "2012-09-26T13:49:48Z")

</div>

Hello,

I would like your advise about a problem I have.

I am running IPython version 2.7.3 (default, Aug 1 2012, 05:14:39) \n[GCC 4.6.3] on Ubuntu.  
I want to rotate north and east component of a seismogram to radial and transverse components which seems "easy".

I wrote the line  
" rotate\_NE\_RT(north,east, baz) "  
&nbsp;&nbsp;and get Typeerror message :

TypeError: unsupported operand type(s) for +: 'exceptions.TypeError' and  
'exceptions.TypeError'

I was wondering if you had any ideas about this error?

Thanks & Regards,

Here is the code I used and the error message:

from obspy.core import read,Trace

from obspy.core import UTCDateTime

from obspy.signal import cornFreq2Paz

from obspy.signal import seisSim

from obspy.sac import SacIO, attach\_paz, attach\_resp

from obspy.sac.sacio import SacIO

import matplotlib.pyplot as plt

import numpy as np

---

<div class="post-metadata">

### Author: ![trichter](https://discourse.obspy.org/user_avatar/discourse.obspy.org/trichter/32/226_2.png) [@trichter](https://discourse.obspy.org/u/trichter)
#### Post date: [September 27, 2012, 8:28am UTC](https://discourse.obspy.org/t/obspy-signal-rotate-rotate-ne-rt/138/2 "2012-09-27T08:28:08Z")

</div>

Hello Ahu,

probably the error arises, because rotate\_NE\_RT expects data arrays  
and not trace objects.  
Assuming you have the components ZNE at traces 0, 1, 2 of st, you  
could try e.g.:

st[1].data, st[2].data = rotate\_NE\_RT(st[1].data, st[2].data, baz)  
st[1].stats.channel = st[1].stats.channel[:-1] + 'R'  
st[2].stats.channel = st[2].stats.channel[:-1] + 'T'

Hope it helps, Tom
