beamforming -paz (complete question)


I am new to obspy and I think I need a little help.
I am trying to perform a beamforming.

I have taken as a basis the example in the tutorial

The only things I changed were

  1. Reading the data. : I read the traces from 8 stations in miniseed format using
    st = read(“PATH/Station*.2013.144”)

  2. I changed the coordintaes of the stations. For example, I put

st[0].stats.coordinates = AttribDict({
‘x’: 582651.442,
‘y’: 4252226.251,
‘elevation’: 143.013})

I have done this for st[0] until st[7]

  1. For the poles and zeros, I wasn’t very sure what to use so I put for all stations :

st[1].stats.paz = AttribDict({
‘poles’: [(-0.03736 - 0.03617j), (-0.03736 + 0.03617j)],
‘zeros’: [0j, 0j],
‘sensitivity’: 1.0,
‘gain’: 1.0})

The rest, I left it the same as in the example, and I get an error that is : KeyError ‘paz’.

Do any of you have an idea of what I am doing wrong? Or where I can read to get a hint on how to solve my problem?

I apologize if the question is too basic and I thank you in advance for your help,
+33 04 83 61 86 62
Université de Nice Sophia Antipolis

Dear Clara,

As I was testing that, I figured that if you read the dictionary without first assigning a value to it, this error was raised.

For example:

s = read()
s[0].stats.paz = "test"
print s[0].stats.paz #no error occurred

But if you do:

s = read()
print s[0].stats.paz # KeyError: 'paz'

So, check if you first assigning the value and then you read it.
Best Regards,

Hola Clara, Where did the error raise? Was it at st.simulate ? Did you check you have filled the paz for all the traces in the stream? If the paz are same for all traces you could fill very fast this info with something like for tr in st: tr.stats.paz = AttribDict({ ‘poles’: [(-0.03736 - 0.03617j), (-0.03736 + 0.03617j)], ‘zeros’: [0j, 0j], ‘sensitivity’: 1.0, ‘gain’: 1.0}) Hope this helps. Saludos, Santiago V